-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[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
base: main
Are you sure you want to change the base?
Changes from 7 commits
7e23666
53c1338
96fddd1
1eb025c
788bd48
2f1529f
5904206
2fd375e
09f7c3f
bab774e
99ec42f
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 |
|---|---|---|
|
|
@@ -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) | ||
|
Collaborator
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).
Collaborator
Author
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 opted AIX out of the change and updated the release notes. I expect this will not be the last platform opt-out. |
||
| 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 | ||
|
|
||
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.
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.
Will do