From: David Bremner <bremner@debian.org> 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). --- lib/Makefile.local | 4 +--- lib/gen-version-script.sh | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 lib/gen-version-script.sh diff --git a/lib/Makefile.local b/lib/Makefile.local index 7e2bc87..48f8852 100644 --- a/lib/Makefile.local +++ b/lib/Makefile.local @@ -76,9 +76,7 @@ $(dir)/$(LIBNAME): $(libnotmuch_modules) notmuch.sym $(call quiet,CXX $(CXXFLAGS)) $(libnotmuch_modules) $(FINAL_LIBNOTMUCH_LDFLAGS) $(LIBRARY_LINK_FLAG) -o $@ notmuch.sym: lib/notmuch.h - printf "{\nglobal:\n" > notmuch.sym - sed -n 's/^\s*\(notmuch_[a-z_]*\)\s*(.*/\t\1;/p' $< >> notmuch.sym - printf "local: *;\n};\n" >> notmuch.sym + sh lib/gen-version-script.sh < $< > $@ $(dir)/$(SONAME): $(dir)/$(LIBNAME) ln -sf $(LIBNAME) $@ diff --git a/lib/gen-version-script.sh b/lib/gen-version-script.sh new file mode 100644 index 0000000..1cd33be --- /dev/null +++ b/lib/gen-version-script.sh @@ -0,0 +1,16 @@ +cat <<EOF +{ +global: + _ZTIN6Xapian10LogicErrorE; + _ZTIN6Xapian12RuntimeErrorE; + _ZTIN6Xapian16DocNotFoundErrorE; + _ZTIN6Xapian20InvalidArgumentErrorE; + _ZTIN6Xapian5ErrorE; + _ZTSN6Xapian10LogicErrorE; + _ZTSN6Xapian12RuntimeErrorE; + _ZTSN6Xapian16DocNotFoundErrorE; + _ZTSN6Xapian20InvalidArgumentErrorE; + _ZTSN6Xapian5ErrorE; +EOF +sed -n 's/^\s*\(notmuch_[a-z_]*\)\s*(.*/\t\1;/p' +printf "local: *;\n};\n" -- 1.7.5.4