[compiler-rt] fix build compiler-rt test with libc++ (PR #72111)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 13 04:23:41 PST 2023
https://github.com/PikachuHyA created https://github.com/llvm/llvm-project/pull/72111
fix https://github.com/llvm/llvm-project/issues/72108
>From dcafe24eca805582d66483d1a45465496eabc412 Mon Sep 17 00:00:00 2001
From: PikachuHy <pikachuhy at linux.alibaba.com>
Date: Mon, 13 Nov 2023 20:06:50 +0800
Subject: [PATCH] fix build compiler-rt test with libc++
---
compiler-rt/CMakeLists.txt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt
index 1a46f5b33480694..b2104bdf572c4fd 100644
--- a/compiler-rt/CMakeLists.txt
+++ b/compiler-rt/CMakeLists.txt
@@ -633,8 +633,10 @@ if (SANITIZER_TEST_CXX_LIBNAME STREQUAL "libc++")
list(APPEND SANITIZER_TEST_CXX_CFLAGS "$<$<TARGET_EXISTS:cxx-headers>:$<IF:$<BOOL:${MSVC}>,/imsvc,-isystem>$<JOIN:$<TARGET_PROPERTY:cxx-headers,INTERFACE_INCLUDE_DIRECTORIES>,$<SEMICOLON>$<IF:$<BOOL:${MSVC}>,/imsvc,-isystem>>>")
if (SANITIZER_USE_STATIC_TEST_CXX)
list(APPEND SANITIZER_TEST_CXX_LIBRARIES "$<TARGET_LINKER_FILE:cxx_static>")
+ list(APPEND SANITIZER_TEST_CXX_LIBRARIES "$<TARGET_LINKER_FILE:cxxabi_static>")
else()
list(APPEND SANITIZER_TEST_CXX_LIBRARIES "$<TARGET_LINKER_FILE:$<IF:$<TARGET_EXISTS:cxx_shared>,cxx_shared,cxx_static>>")
+ list(APPEND SANITIZER_TEST_CXX_LIBRARIES "-L $<TARGET_LINKER_FILE_DIR:cxxabi_shared>")
endif()
# We are using the in tree libc++ so avoid including the default one.
append_list_if(COMPILER_RT_HAS_NOSTDINCXX_FLAG -nostdinc++ COMPILER_RT_UNITTEST_CFLAGS)
More information about the llvm-commits
mailing list