[compiler-rt] 559ca30 - Revert "[CMake] Use libcxx targets for in-tree sanitizer C++ ABI"

Petr Hosek via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 29 22:53:15 PDT 2022


Author: Petr Hosek
Date: 2022-09-30T05:52:49Z
New Revision: 559ca30936779673da1793e9d11c3f1045e07b99

URL: https://github.com/llvm/llvm-project/commit/559ca30936779673da1793e9d11c3f1045e07b99
DIFF: https://github.com/llvm/llvm-project/commit/559ca30936779673da1793e9d11c3f1045e07b99.diff

LOG: Revert "[CMake] Use libcxx targets for in-tree sanitizer C++ ABI"

This reverts commit 7dbdffefb768062f28599c256b5e013ee26ff04e since
it appears to have broken several ASan tests.

Added: 
    

Modified: 
    compiler-rt/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt
index 9c43b67b63427..689ce1a8ee6ea 100644
--- a/compiler-rt/CMakeLists.txt
+++ b/compiler-rt/CMakeLists.txt
@@ -579,10 +579,17 @@ if (SANITIZER_CXX_ABI_LIBNAME STREQUAL "libc++")
     # because we added -nodefaultlibs there earlier, and adding would result in
     # a warning, but if we switch to -nostdlib++, we would need to add it here.
     # append_list_if(CXX_SUPPORTS_UNWINDLIB_NONE_FLAG --unwindlib=none SANITIZER_COMMON_LINK_FLAGS)
-    if(SANITIZER_USE_STATIC_CXX_ABI)
-      set(SANITIZER_CXX_ABI_LIBRARIES "$<TARGET_LINKER_FILE:cxx_static>")
-    else()
-      set(SANITIZER_CXX_ABI_LIBRARIES "$<TARGET_LINKER_FILE:$<IF:$<TARGET_EXISTS:cxx_shared>,cxx_shared,cxx_static>>")
+
+    if (SANITIZER_USE_STATIC_LLVM_UNWINDER AND (TARGET unwind_static OR HAVE_LIBUNWIND))
+      list(APPEND SANITIZER_CXX_ABI_LIBRARIES unwind_static)
+    elseif (TARGET unwind_shared OR HAVE_LIBUNWIND)
+      list(APPEND SANITIZER_CXX_ABI_LIBRARIES unwind_shared)
+    endif()
+
+    if (SANITIZER_USE_STATIC_CXX_ABI AND (TARGET cxxabi_static OR HAVE_LIBCXXABI))
+      list(APPEND SANITIZER_CXX_ABI_LIBRARIES cxxabi_static)
+    elseif (TARGET cxxabi_shared OR HAVE_LIBCXXABI)
+      list(APPEND SANITIZER_CXX_ABI_LIBRARIES cxxabi_shared)
     endif()
   else()
     append_list_if(COMPILER_RT_HAS_LIBCXX c++ SANITIZER_CXX_ABI_LIBRARIES)


        


More information about the llvm-commits mailing list