build: use .dynsym for selecting symbols to export

Nm uses .symtab by default which is less reliable for this use case.

Previously this would fail if user enabled stripping or used linker
that doesn't add undefined symbols to .symtab, like here:
https://github.com/davidlattimore/wild/issues/819#issuecomment-3215079862
This commit is contained in:
Mateusz Mikuła 2025-08-26 20:19:38 +02:00 committed by Beniamino Galvani
parent 7242c478a1
commit e5884cfb18

View file

@ -19,7 +19,7 @@ _sort() {
call_nm() {
if [ -n "$from_meson" ]; then
"${NM:-nm}" "$1" |
"${NM:-nm}" -D "$1" |
sed -n 's/.* \([^ ]\) \([^ ]*\)$/\1 \2/p'
else
libtool=(${LIBTOOL:-libtool})
@ -105,4 +105,3 @@ case "$1" in
do_generate
;;
esac