[llvm] Export LLVM plugin entrypoint for windows shared library builds (PR #115431)
Thomas Fransham via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 7 23:03:02 PST 2024
https://github.com/fsfod created https://github.com/llvm/llvm-project/pull/115431
Add Symbol visibility macro to llvmGetPassPluginInfo so plugins export it for windows shared library builds with explicit symbol visibility macros enabled. This also avoids the need for existing plugins having to manually add visibility macros to there llvmGetPassPluginInfo function to work on windows.
This is part of the work to enable LLVM_BUILD_LLVM_DYLIB and plugins on window.
>From fe7200c66b9f865638c4eb8b6eb5af4c4e210f4f Mon Sep 17 00:00:00 2001
From: Thomas Fransham <tfransham at gmail.com>
Date: Thu, 7 Nov 2024 19:48:34 +0000
Subject: [PATCH] Export LLVM plugin entrypoint for windows shared library
builds
Add Symbol visibility macro to llvmGetPassPluginInfo so plugins export it for
windows shared library builds with explicit symbol visibility macros enabled.
This avoids the need for existing plugins having to manually add visibility
macros to there llvmGetPassPluginInfo function to work on windows.
This is part of the work to enable LLVM_BUILD_LLVM_DYLIB and plugins on window.
---
llvm/include/llvm/Passes/PassPlugin.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/include/llvm/Passes/PassPlugin.h b/llvm/include/llvm/Passes/PassPlugin.h
index 013b7a827c47dd..43310d0b9f14af 100644
--- a/llvm/include/llvm/Passes/PassPlugin.h
+++ b/llvm/include/llvm/Passes/PassPlugin.h
@@ -107,7 +107,7 @@ class PassPlugin {
/// };
/// }
/// ```
-extern "C" ::llvm::PassPluginLibraryInfo LLVM_ATTRIBUTE_WEAK
+extern "C" ::llvm::PassPluginLibraryInfo LLVM_ATTRIBUTE_WEAK LLVM_ABI_EXPORT
llvmGetPassPluginInfo();
#endif /* LLVM_PASSES_PASSPLUGIN_H */
More information about the llvm-commits
mailing list