Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export LLVM plugin entrypoint for windows shared library builds #115431

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

fsfod
Copy link
Contributor

@fsfod fsfod commented Nov 8, 2024

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.

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.
@vgvassilev
Copy link
Contributor

@compnerd, can we make another review round?

extern "C" ::llvm::PassPluginLibraryInfo LLVM_ATTRIBUTE_WEAK
llvmGetPassPluginInfo();
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we can share most of the declaration between the platforms, it is only the attribute that differs.

extern "C" ::llvm::PassPluginLibraryInfo
#if defined(_WIN32)
#if defined(LLVM_BUILD_LLVM_DYLIB)
__declspec(dllexport)
#endif
#else
LLVM_ATTRIBUTE_WEAK
#endif
llvmGetPassPluginInfo();

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks a really painful way to declare it.

@vgvassilev
Copy link
Contributor

@fsfod, this one looks towards its final phase. Can you address the comments?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants