[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
Wed Aug 14 11:22:25 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:

What is the alternative for non windows platforms other than this? I used LLVM_ALWAYS_EXPORT for some special JIT debugger registration functions that were annotated with LLVM_ATTRIBUTE_VISIBILITY_DEFAULT before.

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


More information about the llvm-commits mailing list