[libcxxabi][CMake] Set --unwindlib=none when using LLVM libunwind

We already link libunwind explicitly so avoid trying to link toolchain's
default libunwind which may be missing. This matches what we already do
for libcxx.

Differential Revision: https://reviews.llvm.org/D129469
This commit is contained in:
Petr Hosek 2022-07-11 07:53:47 +00:00
parent af58684f27
commit 1f3f4833ea
1 changed files with 7 additions and 0 deletions

View File

@ -99,6 +99,13 @@ else()
add_link_flags_if_supported(-nodefaultlibs)
endif()
if (CXX_SUPPORTS_UNWINDLIB_EQ_NONE_FLAG AND LIBCXXABI_USE_LLVM_UNWINDER)
# If we're linking directly against the libunwind that we're building
# in the same invocation, don't try to link in the toolchain's
# default libunwind (which may be missing still).
add_link_flags_if_supported(--unwindlib=none)
endif()
if ( APPLE )
if (LLVM_USE_SANITIZER)
if (("${LLVM_USE_SANITIZER}" STREQUAL "Address") OR