From 205519b97e3e8483ce9a8b0474dfff0367a29169 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Tue, 27 Jun 2017 18:37:06 +0000 Subject: [PATCH] [libunwind] Add _LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS It's useful to be able to disable visibility annotations entirely; for example, if we're building libunwind static to include in another library, and we don't want any libunwind functions getting exported out of that library. https://reviews.llvm.org/D34637 Patch from Thomas Anderson ! llvm-svn: 306442 --- libunwind/src/config.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libunwind/src/config.h b/libunwind/src/config.h index 4be98c8c15ae..ac8d7d98dc31 100644 --- a/libunwind/src/config.h +++ b/libunwind/src/config.h @@ -44,9 +44,14 @@ #endif #endif -// FIXME: these macros are not correct for COFF targets -#define _LIBUNWIND_EXPORT __attribute__((visibility("default"))) -#define _LIBUNWIND_HIDDEN __attribute__((visibility("hidden"))) +#if defined(_LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS) + #define _LIBUNWIND_EXPORT + #define _LIBUNWIND_HIDDEN +#else + // FIXME: these macros are not correct for COFF targets + #define _LIBUNWIND_EXPORT __attribute__((visibility("default"))) + #define _LIBUNWIND_HIDDEN __attribute__((visibility("hidden"))) +#endif #if (defined(__APPLE__) && defined(__arm__)) || defined(__USING_SJLJ_EXCEPTIONS__) #define _LIBUNWIND_BUILD_SJLJ_APIS