-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[CMake] Correctly handle LLVM_ENABLE_RUNTIMES in targets #69869
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
[CMake] Correctly handle LLVM_ENABLE_RUNTIMES in targets #69869
Conversation
431934b
to
244b1ab
Compare
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.
LGTM
When a target sets LLVM_ENABLE_RUNTIMES, we should only generate proxy targets for those runtimes rather than using the global list which may contain runtimes that are not supported by that particular target.
244b1ab
to
87b62dd
Compare
Looks like this broke the
|
@petrhosek I kind of missed that change, but can you give an example of what this change is doing? What is an example of a "proxy" target? |
@ldionne I ran into this issue when trying to build LLVM libc in the bootstrapping build. I need to include The issue is that the logic in runtimes prior to this patch would always iterate over the global When we first implemented the bootstrapping (aka runtimes build), we only supported the global @JDevlieghere sorry about the breakage, that was unintentional. I'll try to reproduce your failure locally and see if it's a problem with this change. |
function(_get_runtime_name name out_var) | ||
string(FIND ${name} "lib" idx) | ||
if(idx EQUAL 0 AND NOT ${name} STREQUAL "libc") | ||
string(SUBSTRING ${name} 3 -1 entry) |
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.
In response to the issue seen by @JDevlieghere where the cxx and cxxabi targets are not present:
I believe entry
needs changed to name
for the SUBSTRING on line 177.
When using -DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi'
, ${name}
is being returned from the function instead of the SUBSTRING ${entry}
.
With your original patch the targets remain libcxx and libcxxabi.
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.
Thanks for catching that, I fixed it in fb619b3.
When a target sets LLVM_ENABLE_RUNTIMES, we should only generate proxy targets for those runtimes rather than using the global list which may contain runtimes that are not supported by that particular target.
Fix and reland When a target sets LLVM_ENABLE_RUNTIMES, we should only generate proxy targets for those runtimes rather than using the global list which may contain runtimes that are not supported by that particular target. Change-Id: I90971ced1b6c0188bc9652d960e48390124a32a7
While extracting the existing functionality into a function, one of the variable usages wasn't correctly updated.
When a target sets LLVM_ENABLE_RUNTIMES, we should only generate proxy targets for those runtimes rather than using the global list which may contain runtimes that are not supported by that particular target.