Fix for hidden symbols in library on Mac. It's a strange issue to do with
authorMorgan Deters <mdeters@gmail.com>
Thu, 29 Nov 2012 23:08:25 +0000 (23:08 +0000)
committerMorgan Deters <mdeters@gmail.com>
Thu, 29 Nov 2012 23:08:25 +0000 (23:08 +0000)
explicit template instantiation rules, -fvisibility=hidden, and the way that
Apple distributes libstdc++.

(this commit was certified error- and warning-free by the test-and-commit script.)

configure.ac

index 70351681ba4432d8005fc4a26a2456aa06b4f419..e8be43fc1158ce7afa1658dcf4f2d5c9ba21c636 100644 (file)
@@ -751,6 +751,15 @@ AC_SUBST([WNO_UNINITIALIZED])
 AC_SUBST([WNO_UNUSED_VARIABLE])
 AC_SUBST([FNO_STRICT_ALIASING])
 
+# On Mac, we have to fix the visibility of standard library symbols.
+# Otherwise, exported template instantiations---even though explicitly
+# CVC4_PUBLIC, can be generated as symbols with internal-only linkage.
+# Presumably, Apple is distributing a libstdc++ that is built *without*
+# --enable-libstdcxx-visibility (?)
+if test "$target_vendor" = apple; then
+  CVC4CPPFLAGS="${CVC4CPPFLAGS:+$CVC4CPPFLAGS }-D_GLIBCXX_VISIBILITY_DEFAULT=\"__attribute__((__visibility__(\\\"default\\\")))\""
+fi
+
 # Doxygen configuration
 AC_ARG_ENABLE([internals-documentation],
   [AS_HELP_STRING([--enable-internals-documentation],