ldionne updated this revision to Diff 430051.
ldionne added a comment.
Don't remove the old options yet for backwards compatibility.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D125683/new/
https://reviews.llvm.org/D125683
Files:
clang/cmake/caches/Android.cmake
clang/cmake/caches/Fuchsia-stage2.cmake
clang/cmake/caches/Fuchsia.cmake
compiler-rt/cmake/Modules/AddCompilerRT.cmake
libcxx/CMakeLists.txt
libcxx/cmake/Modules/HandleLibCXXABI.cmake
libcxx/cmake/caches/MinGW.cmake
libcxx/docs/BuildingLibcxx.rst
libcxx/docs/ReleaseNotes.rst
libcxx/src/CMakeLists.txt
libcxx/test/CMakeLists.txt
libcxx/test/configs/legacy.cfg.in
libcxxabi/CMakeLists.txt
llvm/docs/HowToBuildWindowsItaniumPrograms.rst
Index: llvm/docs/HowToBuildWindowsItaniumPrograms.rst
===================================================================
--- llvm/docs/HowToBuildWindowsItaniumPrograms.rst
+++ llvm/docs/HowToBuildWindowsItaniumPrograms.rst
@@ -124,7 +124,6 @@
* ``-DLIBCXXABI_ENABLE_SHARED=OFF``
* ``-DLIBCXXABI_ENABLE_STATIC=ON``
* ``-DLIBCXX_ENABLE_SHARED=ON'``
-* ``-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON``
To break the symbol dependency between libc++abi and libc++ we
build libc++abi as a static library and then statically link it
@@ -157,7 +156,6 @@
Windows Itanium does not offer a POSIX-like layer over WIN32.
-* ``-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON``
* ``-DLIBCXX_CXX_ABI=libcxxabi``
* ``-DLIBCXX_CXX_ABI_INCLUDE_PATHS=<libcxxabi src path>/include``
* ``-DLIBCXX_CXX_ABI_LIBRARY_PATH=<libcxxabi build path>/lib``
Index: libcxxabi/CMakeLists.txt
===================================================================
--- libcxxabi/CMakeLists.txt
+++ libcxxabi/CMakeLists.txt
@@ -251,7 +251,7 @@
if (WIN32 AND LIBCXXABI_ENABLE_STATIC AND NOT LIBCXXABI_ENABLE_SHARED)
# If LIBCXX_ENABLE_SHARED isn't set (by the user on the cmake command
# line or via a cache file), use its expected default value (enabled).
- if ((LIBCXX_ENABLE_SHARED OR NOT DEFINED LIBCXX_ENABLE_SHARED) AND LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
+ if ((LIBCXX_ENABLE_SHARED OR NOT DEFINED LIBCXX_ENABLE_SHARED) AND LIBCXX_CXX_ABI STREQUAL libcxxabi-objects)
# Building libcxxabi statically, but intending for it to be statically
# linked into a shared libcxx; keep dllexport enabled within libcxxabi,
# as the symbols will need to be exported from libcxx.
Index: libcxx/test/configs/legacy.cfg.in
===================================================================
--- libcxx/test/configs/legacy.cfg.in
+++ libcxx/test/configs/legacy.cfg.in
@@ -14,7 +14,7 @@
config.cxx_library_root = "@LIBCXX_LIBRARY_DIR@"
config.abi_library_root = "@LIBCXX_CXX_ABI_LIBRARY_PATH@"
config.enable_shared = @LIBCXX_LINK_TESTS_WITH_SHARED_LIBCXX@
-config.cxx_abi = "@LIBCXX_CXXABI_FOR_TESTS@"
+config.cxx_abi = "@LIBCXX_CXX_ABI@"
config.configuration_variant = "@LIBCXX_LIT_VARIANT@"
config.host_triple = "@LLVM_HOST_TRIPLE@"
config.sysroot = "@CMAKE_SYSROOT@"
Index: libcxx/test/CMakeLists.txt
===================================================================
--- libcxx/test/CMakeLists.txt
+++ libcxx/test/CMakeLists.txt
@@ -14,14 +14,6 @@
set(LIBCXX_TEST_COMPILER_FLAGS "" CACHE STRING
"Additonal linker flags to pass when compiling the tests")
-# The tests shouldn't link to any ABI library when it has been linked into
-# libc++ statically or via a linker script.
-if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY OR LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
- set(LIBCXX_CXXABI_FOR_TESTS "none")
-else()
- set(LIBCXX_CXXABI_FOR_TESTS "${LIBCXX_CXX_ABI}")
-endif()
-
# The tests shouldn't link to libunwind if we have a linker script which
# already does so.
if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
Index: libcxx/src/CMakeLists.txt
===================================================================
--- libcxx/src/CMakeLists.txt
+++ libcxx/src/CMakeLists.txt
@@ -204,7 +204,7 @@
if (LIBCXX_ENABLE_SHARED)
add_library(cxx_shared SHARED ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
target_include_directories(cxx_shared PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
- target_link_libraries(cxx_shared PUBLIC cxx-headers
+ target_link_libraries(cxx_shared PUBLIC cxx-headers libcxx-abi-shared
PRIVATE ${LIBCXX_LIBRARIES})
set_target_properties(cxx_shared
PROPERTIES
@@ -232,19 +232,9 @@
endif()
endif()
- # Link against libc++abi
- if (LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY)
- target_link_libraries(cxx_shared PRIVATE libcxx-abi-shared-objects)
- else()
- target_link_libraries(cxx_shared PUBLIC libcxx-abi-shared)
- endif()
-
# Maybe re-export symbols from libc++abi
- # In particular, we don't re-export the symbols if libc++abi is merged statically
- # into libc++ because in that case there's no dylib to re-export from.
if (APPLE AND LIBCXX_CXX_ABI STREQUAL "libcxxabi"
- AND NOT DEFINED LIBCXX_OSX_REEXPORT_LIBCXXABI_SYMBOLS
- AND NOT LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY)
+ AND NOT DEFINED LIBCXX_OSX_REEXPORT_LIBCXXABI_SYMBOLS)
set(LIBCXX_OSX_REEXPORT_LIBCXXABI_SYMBOLS ON)
endif()
@@ -304,10 +294,6 @@
endif()
list(APPEND LIBCXX_BUILD_TARGETS "cxx_static")
- # Attempt to merge the libc++.a archive and the ABI library archive into one.
- if (LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY)
- target_link_libraries(cxx_static PRIVATE libcxx-abi-static-objects)
- endif()
endif()
# Add a meta-target for both libraries.
Index: libcxx/docs/ReleaseNotes.rst
===================================================================
--- libcxx/docs/ReleaseNotes.rst
+++ libcxx/docs/ReleaseNotes.rst
@@ -152,3 +152,9 @@
or on a platform that used to be supported by the legacy testing configuration and isn't supported
by one of the configurations in ``libcxx/test/configs``, please reach out to the libc++ developers
to get your configuration supported officially.
+
+- The following CMake options to control how the ABI library is linked into libc++ have been deprecated:
+ ``LIBCXX_ENABLE_STATIC_ABI_LIBRARY``, ``LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY``,
+ ``LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY``. If you want to merge the objects of libc++abi into
+ libc++, please specify ``-DLIBCXX_CXX_ABI=libcxxabi-objects`` instead. These options will be
+ removed entirely in LLVM 16.
Index: libcxx/docs/BuildingLibcxx.rst
===================================================================
--- libcxx/docs/BuildingLibcxx.rst
+++ libcxx/docs/BuildingLibcxx.rst
@@ -323,7 +323,7 @@
.. option:: LIBCXX_CXX_ABI:STRING
- **Values**: ``none``, ``libcxxabi``, ``system-libcxxabi``, ``libcxxrt``, ``libstdc++``, ``libsupc++``, ``vcruntime``.
+ **Values**: ``none``, ``libcxxabi``, ``libcxxabi-objects``, ``system-libcxxabi``, ``libcxxrt``, ``libstdc++``, ``libsupc++``, ``vcruntime``.
Select the ABI library to build libc++ against.
@@ -336,17 +336,10 @@
Provide the path to the ABI library that libc++ should link against. This is only
useful when linking against an out-of-tree ABI library.
-.. option:: LIBCXX_ENABLE_STATIC_ABI_LIBRARY:BOOL
-
- **Default**: ``OFF``
-
- If this option is enabled, libc++ will try and link the selected ABI library
- statically.
-
.. option:: LIBCXX_ENABLE_ABI_LINKER_SCRIPT:BOOL
**Default**: ``ON`` by default on UNIX platforms other than Apple unless
- 'LIBCXX_ENABLE_STATIC_ABI_LIBRARY' is ON. Otherwise the default value is ``OFF``.
+ using the ``libcxxabi-objects`` ABI library. Otherwise the default value is ``OFF``.
This option generate and installs a linker script as ``libc++.so`` which
links the correct ABI library.
Index: libcxx/cmake/caches/MinGW.cmake
===================================================================
--- libcxx/cmake/caches/MinGW.cmake
+++ libcxx/cmake/caches/MinGW.cmake
@@ -1,10 +1,9 @@
set(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY OFF CACHE BOOL "")
-set(LIBCXX_CXX_ABI libcxxabi CACHE STRING "")
+set(LIBCXX_CXX_ABI libcxxabi-objects CACHE STRING "")
set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
set(LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
-set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
set(LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
Index: libcxx/cmake/Modules/HandleLibCXXABI.cmake
===================================================================
--- libcxx/cmake/Modules/HandleLibCXXABI.cmake
+++ libcxx/cmake/Modules/HandleLibCXXABI.cmake
@@ -6,14 +6,6 @@
# headers of the selected ABI library.
# - libcxx-abi-shared: A target representing the selected shared ABI library.
# - libcxx-abi-static: A target representing the selected static ABI library.
-#
-# Furthermore, some ABI libraries also define the following target:
-# - libcxx-abi-shared-objects: An object library representing a set of object files
-# constituting the ABI library, suitable for bundling
-# into a shared library.
-# - libcxx-abi-static-objects: An object library representing a set of object files
-# constituting the ABI library, suitable for bundling
-# into a static library.
#===============================================================================
include(GNUInstallDirs)
@@ -119,13 +111,15 @@
add_library(libcxx-abi-static ALIAS cxxabi_static)
endif()
- if (TARGET cxxabi_shared_objects)
- add_library(libcxx-abi-shared-objects ALIAS cxxabi_shared_objects)
- endif()
+# Link against the in-tree libc++abi objects, i.e. include libc++abi's object files directly
+# into the library that links against it.
+elseif ("${LIBCXX_CXX_ABI}" STREQUAL "libcxxabi-objects")
+ add_library(libcxx-abi-headers INTERFACE)
+ target_link_libraries(libcxx-abi-headers INTERFACE cxxabi-headers)
+ target_compile_definitions(libcxx-abi-headers INTERFACE "-DLIBCXX_BUILDING_LIBCXXABI")
- if (TARGET cxxabi_static_objects)
- add_library(libcxx-abi-static-objects ALIAS cxxabi_static_objects)
- endif()
+ add_library(libcxx-abi-shared ALIAS cxxabi_shared_objects)
+ add_library(libcxx-abi-static ALIAS cxxabi_static_objects)
# Link against a system-provided libc++abi
elseif ("${LIBCXX_CXX_ABI}" STREQUAL "system-libcxxabi")
Index: libcxx/CMakeLists.txt
===================================================================
--- libcxx/CMakeLists.txt
+++ libcxx/CMakeLists.txt
@@ -219,7 +219,7 @@
set(LIBCXX_DEFAULT_ABI_LIBRARY "libcxxabi")
endif()
-set(LIBCXX_SUPPORTED_ABI_LIBRARIES none libcxxabi system-libcxxabi libcxxrt libstdc++ libsupc++ vcruntime)
+set(LIBCXX_SUPPORTED_ABI_LIBRARIES none libcxxabi libcxxabi-objects system-libcxxabi libcxxrt libstdc++ libsupc++ vcruntime)
set(LIBCXX_CXX_ABI "${LIBCXX_DEFAULT_ABI_LIBRARY}" CACHE STRING "Specify C++ ABI library to use. Supported values are ${LIBCXX_SUPPORTED_ABI_LIBRARIES}.")
# Temporary to still accept existing CMake caches that contain "default" as the value
@@ -231,6 +231,7 @@
message(FATAL_ERROR "Unsupported C++ ABI library: '${LIBCXX_CXX_ABI}'. Supported values are ${LIBCXX_SUPPORTED_ABI_LIBRARIES}.")
endif()
+# TODO: Remove these options once we ship LLVM 15.
option(LIBCXX_ENABLE_STATIC_ABI_LIBRARY
"Use a static copy of the ABI library when linking libc++.
This option cannot be used with LIBCXX_ENABLE_ABI_LINKER_SCRIPT." OFF)
@@ -243,13 +244,21 @@
"Statically link the ABI library to shared library" ON
"LIBCXX_ENABLE_STATIC_ABI_LIBRARY;LIBCXX_ENABLE_SHARED" OFF)
+if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY OR LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY OR LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY)
+ message(WARNING "The LIBCXX_ENABLE_STATIC_ABI_LIBRARY, LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY and "
+ "LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY options have been deprecated in favor of "
+ "using LIBCXX_CXX_ABI=libcxxabi-objects. This will become an error in LLVM 16.")
+ set(LIBCXX_CXX_ABI "libcxxabi-objects")
+endif()
+
# Generate and install a linker script inplace of libc++.so. The linker script
# will link libc++ to the correct ABI library. This option is on by default
-# on UNIX platforms other than Apple unless 'LIBCXX_ENABLE_STATIC_ABI_LIBRARY'
-# is on. This option is also disabled when the ABI library is not specified
-# or is specified to be "none".
+# on UNIX platforms other than Apple unless we are linking the ABI library as
+# an object library. This option is also disabled when the ABI library is not
+# specified or is specified to be "none".
set(ENABLE_LINKER_SCRIPT_DEFAULT_VALUE OFF)
-if (LLVM_HAVE_LINK_VERSION_SCRIPT AND NOT LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY
+if (LLVM_HAVE_LINK_VERSION_SCRIPT
+ AND NOT LIBCXX_CXX_ABI STREQUAL "libcxxabi-objects"
AND NOT LIBCXX_CXX_ABI STREQUAL "none"
AND Python3_EXECUTABLE
AND LIBCXX_ENABLE_SHARED)
@@ -381,14 +390,6 @@
message(FATAL_ERROR "LLVM_USE_SANITIZER cannot be used with LIBCXX_GENERATE_COVERAGE")
endif()
-# Warn users that LIBCXX_ENABLE_STATIC_ABI_LIBRARY is an experimental option.
-if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
- message(WARNING "LIBCXX_ENABLE_STATIC_ABI_LIBRARY is an experimental option")
- if (LIBCXX_ENABLE_STATIC AND NOT Python3_EXECUTABLE)
- message(FATAL_ERROR "LIBCXX_ENABLE_STATIC_ABI_LIBRARY requires python but it was not found.")
- endif()
-endif()
-
if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
if (APPLE)
message(FATAL_ERROR "LIBCXX_ENABLE_ABI_LINKER_SCRIPT cannot be used on APPLE targets")
@@ -398,10 +399,9 @@
endif()
endif()
-if (LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
+if (LIBCXX_CXX_ABI STREQUAL "libcxxabi-objects" AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
message(FATAL_ERROR "Conflicting options given.
- LIBCXX_ENABLE_STATIC_ABI_LIBRARY cannot be specified with
- LIBCXX_ENABLE_ABI_LINKER_SCRIPT")
+ LIBCXX_CXX_ABI=libcxxabi-objects cannot be specified with LIBCXX_ENABLE_ABI_LINKER_SCRIPT")
endif()
if (LIBCXX_ABI_FORCE_ITANIUM AND LIBCXX_ABI_FORCE_MICROSOFT)
@@ -900,7 +900,7 @@
config_define(ON _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
endif()
-if (WIN32 AND LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
+if (WIN32 AND LIBCXX_CXX_ABI STREQUAL "libcxxabi-objects")
# If linking libcxxabi statically into libcxx, skip the dllimport attributes
# on symbols we refer to from libcxxabi.
add_definitions(-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS)
Index: compiler-rt/cmake/Modules/AddCompilerRT.cmake
===================================================================
--- compiler-rt/cmake/Modules/AddCompilerRT.cmake
+++ compiler-rt/cmake/Modules/AddCompilerRT.cmake
@@ -691,7 +691,6 @@
-DLIBCXX_HERMETIC_STATIC_LIBRARY=ON
-DLIBCXX_INCLUDE_BENCHMARKS=OFF
-DLIBCXX_INCLUDE_TESTS=OFF
- -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON
${LIBCXX_CMAKE_ARGS}
INSTALL_COMMAND ""
STEP_TARGETS configure build
Index: clang/cmake/caches/Fuchsia.cmake
===================================================================
--- clang/cmake/caches/Fuchsia.cmake
+++ clang/cmake/caches/Fuchsia.cmake
@@ -68,7 +68,6 @@
set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
set(LIBCXX_ABI_VERSION 2 CACHE STRING "")
set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
- set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
endif()
@@ -95,7 +94,6 @@
set(RUNTIMES_${target}_LIBCXXABI_INSTALL_LIBRARY OFF CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
- set(RUNTIMES_${target}_LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXX_ABI_VERSION 2 CACHE STRING "")
set(RUNTIMES_${target}_LLVM_ENABLE_ASSERTIONS OFF CACHE BOOL "")
set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
Index: clang/cmake/caches/Fuchsia-stage2.cmake
===================================================================
--- clang/cmake/caches/Fuchsia-stage2.cmake
+++ clang/cmake/caches/Fuchsia-stage2.cmake
@@ -63,7 +63,6 @@
set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
- set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
set(LIBCXX_ABI_VERSION 2 CACHE STRING "")
endif()
@@ -121,7 +120,6 @@
set(RUNTIMES_${target}_LIBCXXABI_INSTALL_LIBRARY OFF CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
- set(RUNTIMES_${target}_LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXX_ABI_VERSION 2 CACHE STRING "")
set(RUNTIMES_${target}_LLVM_ENABLE_ASSERTIONS OFF CACHE BOOL "")
set(RUNTIMES_${target}_SANITIZER_CXX_ABI "libc++" CACHE STRING "")
@@ -188,9 +186,7 @@
set(RUNTIMES_${target}_LIBCXXABI_INSTALL_STATIC_LIBRARY OFF CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY OFF CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
- set(RUNTIMES_${target}_LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXX_HERMETIC_STATIC_LIBRARY ON CACHE BOOL "")
- set(RUNTIMES_${target}_LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY OFF CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXX_ABI_VERSION 2 CACHE STRING "")
set(RUNTIMES_${target}_LLVM_ENABLE_ASSERTIONS OFF CACHE BOOL "")
set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
Index: clang/cmake/caches/Android.cmake
===================================================================
--- clang/cmake/caches/Android.cmake
+++ clang/cmake/caches/Android.cmake
@@ -22,10 +22,6 @@
list(APPEND EXTRA_ARGS -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=${LIBCXX_ENABLE_ABI_LINKER_SCRIPT})
endif()
-if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
- list(APPEND EXTRA_ARGS -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=${LIBCXX_ENABLE_STATIC_ABI_LIBRARY})
-endif()
-
if (LLVM_BUILD_EXTERNAL_COMPILER_RT)
set(APPEND EXTRA_ARGS -DLLVM_BUILD_EXTERNAL_COMPILER_RT=${LLVM_BUILD_EXTERNAL_COMPILER_RT})
endif()
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits