diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt @@ -227,7 +227,7 @@ set_property(CACHE SANITIZER_TEST_CXX PROPERTY STRINGS ;${CXXLIBS}) handle_default_cxx_lib(SANITIZER_TEST_CXX) -option(COMPILER_RT_USE_LLVM_UNWINDER "Use the LLVM unwinder." OFF) +option(COMPILER_RT_USE_LLVM_UNWINDER "Use the LLVM unwinder." ON) cmake_dependent_option(COMPILER_RT_ENABLE_STATIC_UNWINDER "Statically link the LLVM unwinder." OFF "COMPILER_RT_USE_LLVM_UNWINDER" OFF) diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -269,7 +269,7 @@ libc++abi. Doing otherwise is an ODR violation." OFF) # Build libc++abi with libunwind. We need this option to determine whether to # link with libunwind or libgcc_s while running the test cases. -option(LIBCXXABI_USE_LLVM_UNWINDER "Build and use the LLVM unwinder." OFF) +option(LIBCXXABI_USE_LLVM_UNWINDER "Build and use the LLVM unwinder." ON) # Target options -------------------------------------------------------------- option(LIBCXX_BUILD_32_BITS "Build 32 bit multilib libc++. This option is not supported anymore when building the runtimes. Please specify a full triple instead." ${LLVM_BUILD_32_BITS}) diff --git a/libcxx/cmake/caches/AArch64.cmake b/libcxx/cmake/caches/AArch64.cmake --- a/libcxx/cmake/caches/AArch64.cmake +++ b/libcxx/cmake/caches/AArch64.cmake @@ -1,2 +1 @@ -set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "") set(CMAKE_CXX_COMPILER_TARGET "aarch64-linux-gnu" CACHE STRING "") diff --git a/libcxx/cmake/caches/AIX.cmake b/libcxx/cmake/caches/AIX.cmake --- a/libcxx/cmake/caches/AIX.cmake +++ b/libcxx/cmake/caches/AIX.cmake @@ -13,6 +13,5 @@ set(LIBCXXABI_ENABLE_SHARED ON CACHE BOOL "") set(LIBCXXABI_ENABLE_STATIC OFF CACHE BOOL "") set(LIBCXX_CXX_ABI libcxxabi CACHE STRING "") -set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "") set(LIBUNWIND_ENABLE_SHARED ON CACHE BOOL "") set(LIBUNWIND_ENABLE_STATIC OFF CACHE BOOL "") diff --git a/libcxx/cmake/caches/Apple.cmake b/libcxx/cmake/caches/Apple.cmake --- a/libcxx/cmake/caches/Apple.cmake +++ b/libcxx/cmake/caches/Apple.cmake @@ -14,6 +14,7 @@ set(LIBCXXABI_ENABLE_ASSERTIONS OFF CACHE BOOL "") set(LIBCXXABI_ENABLE_FORGIVING_DYNAMIC_CAST ON CACHE BOOL "") +set(LIBCXXABI_USE_LLVM_UNWINDER OFF CACHE BOOL "") # libunwind is built separately set(LIBCXX_TEST_CONFIG "apple-libc++-shared.cfg.in" CACHE STRING "") set(LIBCXXABI_TEST_CONFIG "apple-libc++abi-shared.cfg.in" CACHE STRING "") diff --git a/libcxx/cmake/caches/Armv7Arm.cmake b/libcxx/cmake/caches/Armv7Arm.cmake --- a/libcxx/cmake/caches/Armv7Arm.cmake +++ b/libcxx/cmake/caches/Armv7Arm.cmake @@ -1,4 +1,3 @@ -set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "") set(CMAKE_CXX_COMPILER_TARGET "armv7l-linux-gnueabihf" CACHE STRING "") set(CMAKE_CXX_FLAGS "-marm" CACHE STRING "") set(CMAKE_C_FLAGS "-marm" CACHE STRING "") diff --git a/libcxx/cmake/caches/Armv7Thumb-no-exceptions.cmake b/libcxx/cmake/caches/Armv7Thumb-no-exceptions.cmake --- a/libcxx/cmake/caches/Armv7Thumb-no-exceptions.cmake +++ b/libcxx/cmake/caches/Armv7Thumb-no-exceptions.cmake @@ -1,4 +1,3 @@ -set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "") set(CMAKE_CXX_COMPILER_TARGET "armv7l-linux-gnueabihf" CACHE STRING "") set(CMAKE_CXX_FLAGS "-mthumb" CACHE STRING "") set(CMAKE_C_FLAGS "-mthumb" CACHE STRING "") diff --git a/libcxx/cmake/caches/Armv8Arm.cmake b/libcxx/cmake/caches/Armv8Arm.cmake --- a/libcxx/cmake/caches/Armv8Arm.cmake +++ b/libcxx/cmake/caches/Armv8Arm.cmake @@ -1,4 +1,3 @@ -set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "") set(CMAKE_CXX_COMPILER_TARGET "armv8l-linux-gnueabihf" CACHE STRING "") set(CMAKE_CXX_FLAGS "-marm" CACHE STRING "") set(CMAKE_C_FLAGS "-marm" CACHE STRING "") diff --git a/libcxx/cmake/caches/Armv8Thumb-no-exceptions.cmake b/libcxx/cmake/caches/Armv8Thumb-no-exceptions.cmake --- a/libcxx/cmake/caches/Armv8Thumb-no-exceptions.cmake +++ b/libcxx/cmake/caches/Armv8Thumb-no-exceptions.cmake @@ -1,4 +1,3 @@ -set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "") set(CMAKE_CXX_COMPILER_TARGET "armv8l-linux-gnueabihf" CACHE STRING "") set(CMAKE_CXX_FLAGS "-mthumb" CACHE STRING "") set(CMAKE_C_FLAGS "-mthumb" CACHE STRING "") diff --git a/libcxx/cmake/caches/Generic-merged.cmake b/libcxx/cmake/caches/Generic-merged.cmake --- a/libcxx/cmake/caches/Generic-merged.cmake +++ b/libcxx/cmake/caches/Generic-merged.cmake @@ -5,7 +5,6 @@ set(LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY ON CACHE BOOL "") set(LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "") -set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "") set(LIBCXXABI_ENABLE_STATIC_UNWINDER ON CACHE BOOL "") set(LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY ON CACHE BOOL "") diff --git a/libcxx/cmake/caches/Generic-msan.cmake b/libcxx/cmake/caches/Generic-msan.cmake --- a/libcxx/cmake/caches/Generic-msan.cmake +++ b/libcxx/cmake/caches/Generic-msan.cmake @@ -1 +1,2 @@ set(LLVM_USE_SANITIZER "MemoryWithOrigins" CACHE STRING "") +set(LIBCXXABI_USE_LLVM_UNWINDER OFF CACHE BOOL "") # MSAN is compiled against the system unwinder, which leads to false positives diff --git a/libcxx/cmake/caches/Generic-tsan.cmake b/libcxx/cmake/caches/Generic-tsan.cmake --- a/libcxx/cmake/caches/Generic-tsan.cmake +++ b/libcxx/cmake/caches/Generic-tsan.cmake @@ -1 +1,2 @@ set(LLVM_USE_SANITIZER "Thread" CACHE STRING "") +set(LIBCXXABI_USE_LLVM_UNWINDER OFF CACHE BOOL "") # TSAN is compiled against the system unwinder, which leads to false positives diff --git a/libcxx/cmake/caches/MinGW.cmake b/libcxx/cmake/caches/MinGW.cmake --- a/libcxx/cmake/caches/MinGW.cmake +++ b/libcxx/cmake/caches/MinGW.cmake @@ -1,5 +1,4 @@ set(LIBCXX_CXX_ABI libcxxabi 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 "") diff --git a/libcxx/docs/BuildingLibcxx.rst b/libcxx/docs/BuildingLibcxx.rst --- a/libcxx/docs/BuildingLibcxx.rst +++ b/libcxx/docs/BuildingLibcxx.rst @@ -346,7 +346,7 @@ .. option:: LIBCXXABI_USE_LLVM_UNWINDER:BOOL - **Default**: ``OFF`` + **Default**: ``ON`` Build and use the LLVM unwinder. Note: This option can only be used when libc++abi is the C++ ABI library used. diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst --- a/libcxx/docs/ReleaseNotes/18.rst +++ b/libcxx/docs/ReleaseNotes/18.rst @@ -134,3 +134,10 @@ Build System Changes -------------------- + +- ``LIBCXXABI_USE_LLVM_UNWINDER`` and ``COMPILER_RT_USE_LLVM_UNWINDER`` switched defaults from ``OFF`` to ``ON``. + This means that by default, libc++abi and compiler-rt will link against the LLVM provided ``libunwind`` library + instead of the system-provided unwinding library. If you are building the LLVM runtimes with the goal of shipping + them so that they can interoperate with other system-provided libraries that might be using a different unwinding + library (such as ``libgcc_s``), you should pass ``LIBCXXABI_USE_LLVM_UNWINDER=OFF`` and ``COMPILER_RT_USE_LLVM_UNWINDER=OFF`` + to make sure the system-provided unwinding library is used by the LLVM runtimes. diff --git a/libcxx/utils/ci/buildkite-pipeline.yml b/libcxx/utils/ci/buildkite-pipeline.yml --- a/libcxx/utils/ci/buildkite-pipeline.yml +++ b/libcxx/utils/ci/buildkite-pipeline.yml @@ -538,24 +538,6 @@ limit: 2 timeout_in_minutes: 120 - - label: "With LLVM's libunwind" - command: "libcxx/utils/ci/run-buildbot generic-with_llvm_unwinder" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" - ENABLE_CLANG_TIDY: "On" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - label: "Modular build with Local Submodule Visibility" command: "libcxx/utils/ci/run-buildbot generic-modules-lsv" artifact_paths: diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot --- a/libcxx/utils/ci/run-buildbot +++ b/libcxx/utils/ci/run-buildbot @@ -412,11 +412,6 @@ check-runtimes check-abi-list ;; -generic-with_llvm_unwinder) - clean - generate-cmake -DLIBCXXABI_USE_LLVM_UNWINDER=ON - check-runtimes -;; # # Module builds # diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt --- a/libcxxabi/CMakeLists.txt +++ b/libcxxabi/CMakeLists.txt @@ -46,7 +46,7 @@ option(LIBCXXABI_ENABLE_ASSERTIONS "Enable assertions independent of build mode." ON) option(LIBCXXABI_ENABLE_PEDANTIC "Compile with pedantic enabled." OFF) option(LIBCXXABI_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF) -option(LIBCXXABI_USE_LLVM_UNWINDER "Build and use the LLVM unwinder." OFF) +option(LIBCXXABI_USE_LLVM_UNWINDER "Build and use the LLVM unwinder." ON) option(LIBCXXABI_ENABLE_STATIC_UNWINDER "Statically link the LLVM unwinder." OFF) option(LIBCXXABI_USE_COMPILER_RT "Use compiler-rt instead of libgcc" OFF) option(LIBCXXABI_ENABLE_THREADS "Build with threads enabled" ON)