[llvm] Initial changes for llvm shared library build using explicit visibility annotations (PR #96630)

Thomas Fransham via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 20 08:06:03 PDT 2024


================
@@ -125,18 +126,79 @@
 #define LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
 #endif
 
-
-#if (!(defined(_WIN32) || defined(__CYGWIN__)) ||                              \
-     (defined(__MINGW32__) && defined(__clang__)))
-#define LLVM_LIBRARY_VISIBILITY LLVM_ATTRIBUTE_VISIBILITY_HIDDEN
 #if defined(LLVM_BUILD_LLVM_DYLIB) || defined(LLVM_BUILD_SHARED_LIBS)
 #define LLVM_EXTERNAL_VISIBILITY LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
 #else
 #define LLVM_EXTERNAL_VISIBILITY
 #endif
+
+#if (!(defined(_WIN32) || defined(__CYGWIN__)) ||                              \
+     (defined(__MINGW32__) && defined(__clang__)))
+#define LLVM_LIBRARY_VISIBILITY LLVM_ATTRIBUTE_VISIBILITY_HIDDEN
+#define LLVM_ALWAYS_EXPORT LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
----------------
fsfod wrote:

I didn't know about protected, wouldn't it also indirectly stop symbols being merging across shared libraries and executables by the loader? maybe that would be what you always want for the JIT debugger symbols.

https://github.com/llvm/llvm-project/pull/96630


More information about the llvm-commits mailing list