Skip to content

[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
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions llvm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Collaborator

Choose a reason for hiding this comment

The 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
Expand Down
5 changes: 5 additions & 0 deletions llvm/docs/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ Changes to LLVM infrastructure
Changes to building LLVM
------------------------

* On non-Windows platforms, LLVM now builds as a large shared library, libLLVM,
by default. To revert to the old behavior of producing and linking static
libraries, pass ``-DLLVM_LINK_LLVM_DYLIB=OFF`` to CMake when configuring your
build.

Changes to TableGen
-------------------

Expand Down
Loading