aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-03-29 03:37:17 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-03-29 03:37:17 +0000
commitbe5ff2f830d1833891051472d29818aa9f783cce (patch)
tree7bde1df55887737aa0fd5bfb1d0b366fe1a7c22b
parent52f10d5f474741d2226630f576d44f1bf946d40a (diff)
unwind.h fix for -fvisibility=hidden users. This fixes firefox build in a system
with libunwind installed. Patch by Jeffrey Yasskin! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153633 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Headers/unwind.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
index a99c8a1176..a0659203b1 100644
--- a/lib/Headers/unwind.h
+++ b/lib/Headers/unwind.h
@@ -31,7 +31,19 @@
# define _SHOULD_UNDEFINE_GNU_SOURCE
# define _GNU_SOURCE
# endif
-# include_next <unwind.h>
+// libunwind's unwind.h reflects the current visibility. However, Mozilla
+// builds with -fvisibility=hidden and relies on gcc's unwind.h to reset the
+// visibility to default and export its contents. gcc also allows users to
+// override its override by #defining HIDE_EXPORTS (but note, this only obeys
+// the user's -fvisibility setting; it doesn't hide any exports on its own). We
+// imitate gcc's header here:
+# ifdef HIDE_EXPORTS
+# include_next <unwind.h>
+# else
+# pragma GCC visibility push(default)
+# include_next <unwind.h>
+# pragma GCC visibility pop
+# endif
# ifdef _SHOULD_UNDEFINE_GNU_SOURCE
# undef _GNU_SOURCE
# undef _SHOULD_UNDEFINE_GNU_SOURCE