aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/gen-version-script.sh
diff options
context:
space:
mode:
authorGravatar David Bremner <bremner@debian.org>2011-07-16 15:59:44 -0300
committerGravatar David Bremner <bremner@debian.org>2011-07-16 22:16:46 -0300
commitfeb22fef2e3f6f1cf1722f00945c580e506df0df (patch)
treeefe0edb202123401e4083070d66a794e0128c5d5 /lib/gen-version-script.sh
parent8b310a157c06c826c0ee7f677fbbf9f19e78537b (diff)
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).
Diffstat (limited to 'lib/gen-version-script.sh')
-rw-r--r--lib/gen-version-script.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/gen-version-script.sh b/lib/gen-version-script.sh
new file mode 100644
index 00000000..e753eaf5
--- /dev/null
+++ b/lib/gen-version-script.sh
@@ -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"