-
-
Notifications
You must be signed in to change notification settings - Fork 262
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
Add LLVM-pass plugin support to LDC. Commandline flag: -plugin=...
.
#2554
Conversation
Adds a simple test that demonstrates how to create a plugin. Test only enabled on Darwin and Linux.
resolves #2547 |
Interesting: on Linux this needs |
(the |
Green :) |
I just built this PR and current master with LLVM 5.0.0 (Release + asserts), Release config, on Linux x64. The executable size increases by 20% (50 MB => 60 MB). |
Yeah, I was afraid it'd be a lot :/ Any alternatives? (I'm having a hard time figuring out what Clang does to provide the symbols for the plugin) Edit: the symbols that are reported missing without |
I don't know, but simply making the plugin support opt-in (or -out) via CMake sounds good enough to me, so that ARM builds etc. can remain 'small' if need be. |
I'll add a (default off) CMake option for it. But I'm sure it'll mean that very few people will be able to use plugins then... :/ |
CMakeLists.txt
Outdated
@@ -570,6 +570,7 @@ else() | |||
endif() | |||
set(LDC_ENABLE_PLUGINS ${LDC_ENABLE_PLUGINS_DEFAULT} CACHE BOOL "Build LDC with plugin support (increases binary size)") | |||
if(LDC_ENABLE_PLUGINS) | |||
message(STATUS "Building LDC with plugin support") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a default of 'off' means that few people will try it, perhaps you should add a status "Building LDC without plugin support"?
I'd be fine with it defaulting to ON on non-Windows. Alternatively, enabling it explicitly for the Circle build is another way to significantly increase the feature availability (and additionally makes sure it is tested on Linux too, not just OSX as of now). |
Plugins are default on on Linux+Apple systems. Can be turned off with |
Lgtm. |
This adds functionality to load plugins such as the AFL llvm-mode plugin: https://github.com/mirrorer/afl/blob/master/llvm_mode/afl-llvm-pass.so.cc
Adds a simple test that demonstrates how to create a plugin.
Test only enabled on Darwin and Linux.