-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[CMake] Fixes and improvements for buildng with builtin_clang=OFF
#18386
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -407,6 +407,12 @@ if (builtin_clang) | |
else() | ||
find_package(Clang REQUIRED CONFIG) | ||
message(STATUS "Found Clang ${CLANG_PACKAGE_VERSION} in ${CLANG_CMAKE_DIR}") | ||
|
||
# Disable linking against shared LLVM. | ||
# We have to do this after find_package(Clang). Finding Clang internally | ||
# calls find_package(LLVM), which overwrites LLVM_LINK_LLVM_DYLIB to what it | ||
# was set when building LLVM. | ||
set(LLVM_LINK_LLVM_DYLIB FALSE) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Revisiting the code, this is also not ideal: The right solution that we have chosen in Cling is to pass There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not as easy, as we have discussed in private. Also, the exact same thing is done in the So this PR here only made the configuration code less inconsistent, which is always good IMHO. So I don't see the reason to revert if the supposedly "right" solution is not implemented in our main configuration code path either. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I disagree with this summary of our discussions. For me it is clear, and always has been, that the right solution is implemented on the linking side for
Yes, though it is slightly different because there we are actually building Clang, not just modifying a variable after
(for a bit more consistency in the file, it should have been
This PR was proposed on a Sunday afternoon, on the day before locking the branch, and merged within 2 hours, without review from any of the developers recently involved in this area before. I have pointed out one immediate mistake, and I maintain that fiddling with As changes to the build system this late in the cycle can have a significant blast area, I maintain that this PR should be reverted. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
You seemed to have no problem approving and merging the precedent for the What you say seems contradictory to me. In the issue I opened you said that
You're right, I apologize. I forgot that the precedent was for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Beyond that, I don't consider it good style to link a PR from almost two years ago and say "you accepted it back then"...
What I argue is that build system changes in general can have a significant blast radius. This PR contains changes on the main configuration code path in
Because "best effort" doesn't mean that I don't care, and it doesn't mean that the use cases can be broken at will.
YMMV.
Then this should be changed, there will be a next cycle. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've submitted a revert in #18446 |
||
endif() | ||
|
||
# Reset the compiler flags after compiling LLVM and Clang | ||
|
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.
LLVM_DIR
is the wrong variable, it is only a hint specified by the user. The right approach is to take one of the variables set byLLVMConfig.cmake
, see also commit bb4fde0There 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.
You're right, thanks! I'll fix this up, going back to the
${LLVM_LIBRARY_DIR}
that was used beforeThere 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.
PR opened: #18407