-
Notifications
You must be signed in to change notification settings - Fork 43
Add basic LLVM_DISTRIBUTION_COMPONENTS compatibility #694
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
base: main
Are you sure you want to change the base?
Conversation
|
will this patch allow me to do |
|
Yep! Playing with this a bit though now that you mention it, it looks like doing just a |
great, this is useful
probably need to add LW as ld.eld's dependency |
b5cd5b2 to
0c38316
Compare
Yep! I think that works |
75c0d6b to
2a0beca
Compare
|
The header files for linker plugin API need to be in the distribution too. How will that work ? The header files are installed from llvm/tools/eld/include/eld |
|
Oh, whoops. It should just be adding the relevant install targets again (llvm projects do similar things, ex: https://github.com/llvm/llvm-project/blob/de3e9b04178cc8fca77ef6396ba604f47ffdeb6f/clang/CMakeLists.txt#L408-L414) then ex: As a more general question though, does it make sense that these should all be installed/listed separately? Seems like LW is essentially required by eld and the plugin headers are basically always enabled as far as I can tell (the cache var is |
LLVM_DISTRIBUTION_COMPONENTS seems to require that each component have a) install-* and install-*-stripped targets and b) a component associated with the things to install. So, there's a few separate changes made to add this support into eld: - For each of the components we want to support, `add_llvm_install_targets` is used to create the install* and install-*-stripped targets. I think this is the easiest (and a recommended) way to do this. - I think eld has five components we need to handle: ld.eld, LW, PluginAPIHeaders, linker-script (templates), and YAMLMapParser. Each of these had the appropriate install targets and components added, as needed. Hopefully I'm not missing any additional components we need to consider for distributions. It might make sense to more aggressively couple some of these, but I think the granularity here matches pretty well with available CMake options (to ex: disable the YAMLMapParser) and current toolchains with eld included (where the PluginAPIHeaders, templates, etc. may be stripped out). So, I left this as-is. - A dependency was added between the ld.eld and LW install targets--without these ld.eld would always fail at runtime about the missing LW library, if only ex: `ninja install-ld.eld` was run. Which, doesn't seem that helpful. So, make ld.eld's install depend on LW's. Expected usage looks something like: `-DLLVM_DISTRIBUTION_COMPONENTS='...;ld.eld;LW;PluginAPIHeaders;linker-script;YAMLMapParser'` and these items can generally be added/removed based on what people want in the distribution (modulo ld.eld's dependency on LW). And, as per the install-* target requirement mentioned above, each of these components can now be individually installed with ex: install-ld.eld. Fixes qualcomm#693 Signed-off-by: Jonathon Penix <jpenix@quicinc.com>
2a0beca to
c728fb2
Compare
LLVM_DISTRIBUTION_COMPONENTS seems to require that each component have
a) install-* and install-*-stripped targets and b) a component associated with
the things to install.
So, there's a few separate changes made to add this support into eld:
For each of the components we want to support,
add_llvm_install_targetsis used to create the install* and install-*-stripped targets. I think this
is the easiest (and a recommended) way to do this.
I think eld has five components we need to handle: ld.eld, LW,
PluginAPIHeaders, linker-script (templates), and YAMLMapParser. Each
of these had the appropriate install targets and components added, as
needed. Hopefully I'm not missing any additional components we need to
consider for distributions.
It might make sense to more aggressively couple some of these, but I
think the granularity here matches pretty well with available CMake
options (to ex: disable the YAMLMapParser) and current toolchains with
eld included (where the PluginAPIHeaders, templates, etc. may be stripped
out). So, I left this as-is.
A dependency was added between the ld.eld and LW install targets--without
these ld.eld would always fail at runtime about the missing LW library, if
only ex:
ninja install-ld.eldwas run. Which, doesn't seem that helpful.So, make ld.eld's install depend on LW's.
Expected usage looks something like:
-DLLVM_DISTRIBUTION_COMPONENTS='...;ld.eld;LW;PluginAPIHeaders;linker-script;YAMLMapParser'and these items can generally be added/removed based on what people want in
the distribution (modulo ld.eld's dependency on LW).
And, as per the install-* target requirement mentioned above, each of
these components can now be individually installed with ex: install-ld.eld.
Fixes #693