Skip to content
Open
5 changes: 5 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ Non-comprehensive list of changes in this release
Currently, the use of ``__builtin_dedup_pack`` is limited to template arguments and base
specifiers, it also must be used within a template context.

- On non-Windows platforms, Clang now builds as a large shared library,
``libclang-cpp``, by default. To revert to the old behavior of producing and
linking static libraries, pass ``-DCLANG_LINK_CLANG_DYLIB=OFF`` to CMake when
configuring your build. The new behavior matches LLVM, which also builds as a
large shared library.

New Compiler Flags
------------------
Expand Down
12 changes: 10 additions & 2 deletions llvm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -932,14 +932,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).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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