X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fgen-version-script.sh;h=c98a07b0c701e70f4963c17c63c42a19de2e6cf0;hp=e753eaf5d397a9a5d3cff766d9a8968eade34bec;hb=d5ed9af0e42c0f32bcababd6ac5ce42ccb1bf283;hpb=feb22fef2e3f6f1cf1722f00945c580e506df0df diff --git a/lib/gen-version-script.sh b/lib/gen-version-script.sh index e753eaf5..c98a07b0 100644 --- a/lib/gen-version-script.sh +++ b/lib/gen-version-script.sh @@ -1,7 +1,8 @@ +set -eu # we go through a bit of work to get the unmangled names of the # typeinfo symbols because of -# http://sourceware.org/bugzilla/show_bug.cgi?id=10326 +# https://sourceware.org/bugzilla/show_bug.cgi?id=10326 if [ $# -lt 2 ]; then echo Usage: $0 header obj1 obj2 obj3 @@ -12,16 +13,16 @@ HEADER=$1 shift printf '{\nglobal:\n' -nm --defined $* | awk '$3 ~ "Xapian.*Error" {print $3}' | sort | uniq | \ +nm $* | awk '$1 ~ "^[0-9a-fA-F][0-9a-fA-F]*$" && $3 ~ "Xapian.*Error" {print $3}' | sort | uniq | \ while read sym; do demangled=$(c++filt $sym) case $demangled in - typeinfo*) + typeinfo*) printf "\t$sym;\n" ;; *) ;; esac done -sed -n 's/^\s*\(notmuch_[a-z_]*\)\s*(.*/\t\1;/p' $HEADER +sed -n 's/^[[:space:]]*\(notmuch_[a-z_]*\)[[:space:]]*(.*/ \1;/p' $HEADER printf "local: *;\n};\n"