mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-23 09:54:52 +01:00
libnotmuch: export Xapian typeinfo symbols
The lack of such exporting seems to cause problems catching exceptions, as suggested by http://gcc.gnu.org/wiki/Visibility This manifested in the symbol-hiding test failing when notmuch was compile with gcc 4.4.5. On i386, this further manifested as notmuch new failing to run (crashing with an uncaught exception on first run).
This commit is contained in:
parent
8b310a157c
commit
feb22fef2e
2 changed files with 28 additions and 3 deletions
|
@ -76,9 +76,7 @@ $(dir)/$(LIBNAME): $(libnotmuch_modules) notmuch.sym
|
||||||
$(call quiet,CXX $(CXXFLAGS)) $(libnotmuch_modules) $(FINAL_LIBNOTMUCH_LDFLAGS) $(LIBRARY_LINK_FLAG) -o $@
|
$(call quiet,CXX $(CXXFLAGS)) $(libnotmuch_modules) $(FINAL_LIBNOTMUCH_LDFLAGS) $(LIBRARY_LINK_FLAG) -o $@
|
||||||
|
|
||||||
notmuch.sym: lib/notmuch.h
|
notmuch.sym: lib/notmuch.h
|
||||||
printf "{\nglobal:\n" > notmuch.sym
|
sh lib/gen-version-script.sh $< $(libnotmuch_modules) > $@
|
||||||
sed -n 's/^\s*\(notmuch_[a-z_]*\)\s*(.*/\t\1;/p' $< >> notmuch.sym
|
|
||||||
printf "local: *;\n};\n" >> notmuch.sym
|
|
||||||
|
|
||||||
$(dir)/$(SONAME): $(dir)/$(LIBNAME)
|
$(dir)/$(SONAME): $(dir)/$(LIBNAME)
|
||||||
ln -sf $(LIBNAME) $@
|
ln -sf $(LIBNAME) $@
|
||||||
|
|
27
lib/gen-version-script.sh
Normal file
27
lib/gen-version-script.sh
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
if [ $# -lt 2 ]; then
|
||||||
|
echo Usage: $0 header obj1 obj2 obj3
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
HEADER=$1
|
||||||
|
shift
|
||||||
|
|
||||||
|
printf '{\nglobal:\n'
|
||||||
|
nm --defined $* | awk '$3 ~ "Xapian.*Error" {print $3}' | sort | uniq | \
|
||||||
|
while read sym; do
|
||||||
|
demangled=$(c++filt $sym)
|
||||||
|
case $demangled in
|
||||||
|
typeinfo*)
|
||||||
|
printf "\t$sym;\n"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
sed -n 's/^\s*\(notmuch_[a-z_]*\)\s*(.*/\t\1;/p' $HEADER
|
||||||
|
printf "local: *;\n};\n"
|
Loading…
Reference in a new issue