
I recently came across LIBCXXABI_USE_LLVM_UNWINDER and was surprised to notice it was disabled by default. Since we build libunwind by default and ship it in the LLVM toolchain, it would seem to make sense that libc++ and libc++abi rely on libunwind for unwinding instead of using the system-provided unwinding library (if any). Most importantly, using the system unwinder implies that libc++abi is ABI compatible with that system unwinder, which is not necessarily the case. Hence, it makes a lot more sense to instead default to using the known-to-be-compatible LLVM unwinder, and let vendors manually select a different unwinder if desired. As a follow-up change, we should probably apply the same default to compiler-rt. Differential Revision: https://reviews.llvm.org/D150897 Fixes #77662 rdar://120801778
12 lines
522 B
CMake
12 lines
522 B
CMake
# Build a libc++ shared library, but merge libc++abi and libunwind into it.
|
|
set(LIBCXX_ENABLE_SHARED ON CACHE BOOL "")
|
|
set(LIBCXX_ENABLE_ABI_LINKER_SCRIPT OFF CACHE BOOL "")
|
|
set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
|
|
set(LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY ON CACHE BOOL "")
|
|
|
|
set(LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
|
|
set(LIBCXXABI_ENABLE_STATIC_UNWINDER ON CACHE BOOL "")
|
|
set(LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY ON CACHE BOOL "")
|
|
|
|
set(LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
|