-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[llvm] Enable LLVM_LINK_LLVM_DYLIB by default on non-Windows platforms #138187
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
Open
rnk
wants to merge
7
commits into
llvm:main
Choose a base branch
from
rnk:llvm-dylib-default
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7e23666
[llvm] Enable LLVM_LINK_LLVM_DYLIB by default on non-Windows platforms
rnk 53c1338
Merge branch 'main' into llvm-dylib-default
rnk 96fddd1
Merge branch 'main' into llvm-dylib-default
rnk 1eb025c
Remove debug prints
rnk 788bd48
Disable linking the dylib from TestingSupport, it only uses Support
rnk 2f1529f
Add release notes
rnk 5904206
Remove bolt unittest dep on LLVMTestingSupport to fix link
rnk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -919,14 +919,22 @@ if(NOT MSVC OR LLVM_BUILD_LLVM_DYLIB_VIS) | |
set(CAN_BUILD_LLVM_DYLIB ON) | ||
endif() | ||
|
||
cmake_dependent_option(LLVM_LINK_LLVM_DYLIB "Link tools against the libllvm dynamic library" OFF | ||
# Link the tools against the libllvm DSO by default. | ||
set(LLVM_LINK_LLVM_DYLIB_default ON) | ||
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. As mentioned on the RFC thread, the deployment story on AIX does not work well with such a configuration (due to lack of relative rpath support). |
||
if (BUILD_SHARED_LIBS OR WIN32) | ||
set(LLVM_LINK_LLVM_DYLIB_default OFF) | ||
endif() | ||
|
||
cmake_dependent_option(LLVM_LINK_LLVM_DYLIB "Link tools against the libllvm dynamic library" | ||
"${LLVM_LINK_LLVM_DYLIB_default}" | ||
"CAN_BUILD_LLVM_DYLIB" OFF) | ||
|
||
set(LLVM_BUILD_LLVM_DYLIB_default OFF) | ||
if(LLVM_LINK_LLVM_DYLIB OR LLVM_BUILD_LLVM_C_DYLIB) | ||
set(LLVM_BUILD_LLVM_DYLIB_default ON) | ||
endif() | ||
cmake_dependent_option(LLVM_BUILD_LLVM_DYLIB "Build libllvm dynamic library" ${LLVM_BUILD_LLVM_DYLIB_default} | ||
cmake_dependent_option(LLVM_BUILD_LLVM_DYLIB "Build libllvm dynamic library" | ||
"${LLVM_BUILD_LLVM_DYLIB_default}" | ||
"CAN_BUILD_LLVM_DYLIB" OFF) | ||
|
||
cmake_dependent_option(LLVM_DYLIB_EXPORT_INLINES "Force inline members of classes to be DLL exported when | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This removal here was interesting. Bolt doesn't support the LLVM dylib build, and it tries to disable linking the LLVM dylib. However, it ends up depending on it transitively through LLVMTestingSupport, resulting in double registration of command line flags due to two copies of Support libraries, static and from the dylib. I think it should be possible to link LLVMTestingSupport as a single static archive and not reference the dylib, but I couldn't figure that out. In the end, I cut the library dependency because it was easier.
This library dependency was introduced in Dec 2024 5100307 and I think it breaks building bolt with cmake and the dylib build enabled, so I think that was actually a regression in functionality, but I need to confirm it.
Anyway, I think this will finally pass premerge checks.
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.
Should split this into a separate PR. Worth noting that #145448 has an alternative approach where a separate statically linked LLVMTestingSupportStatic is introduced. But given that that this is barely used here, just dropping it entirely is fine.