From abcaa923f16eb45c8a9a450d783c7bc01c36b267 Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Thu, 17 May 2018 23:50:35 +0000 Subject: [CMake] Reland "Make simple source used for CMake checks a C file" The source being compiled is plain C, but using .cc extension forces it to be compiled as C++ which requires a working C++ compiler including C++ library which may not be the case when we're building compiler-rt together with libcxx as part of runtimes build. Differential Revision: https://reviews.llvm.org/D47031 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@332679 91177308-0d34-0410-b5e6-96231b3b80d8 --- cmake/Modules/CompilerRTUtils.cmake | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cmake/Modules') diff --git a/cmake/Modules/CompilerRTUtils.cmake b/cmake/Modules/CompilerRTUtils.cmake index f567202fa..7ef1fc8d9 100644 --- a/cmake/Modules/CompilerRTUtils.cmake +++ b/cmake/Modules/CompilerRTUtils.cmake @@ -144,8 +144,12 @@ macro(test_target_arch arch def) endif() set(SAVED_CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS}) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${argstring}") + if(SANITIZER_CXX_ABI_SYSTEM) + set(FLAG_LINK_LIBRARIES ${SANITIZER_CXX_ABI_LIBRARY}) + endif() try_compile(CAN_TARGET_${arch} ${CMAKE_BINARY_DIR} ${SIMPLE_SOURCE} COMPILE_DEFINITIONS "${TARGET_${arch}_CFLAGS} ${FLAG_NO_EXCEPTIONS}" + LINK_LIBRARIES ${FLAG_LINK_LIBRARIES} OUTPUT_VARIABLE TARGET_${arch}_OUTPUT) set(CMAKE_EXE_LINKER_FLAGS ${SAVED_CMAKE_EXE_LINKER_FLAGS}) endif() -- cgit v1.2.3