diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake index ea89a997ca20..9902b44f1e30 100644 --- a/compiler-rt/cmake/config-ix.cmake +++ b/compiler-rt/cmake/config-ix.cmake @@ -45,7 +45,6 @@ check_cxx_compiler_flag(/wd4722 COMPILER_RT_HAS_WD4722_FLAG) check_symbol_exists(__func__ "" COMPILER_RT_HAS_FUNC_SYMBOL) # Libraries. -check_library_exists(stdc++ __cxa_pure_virtual "" COMPILER_RT_HAS_LIBSTDCXX) check_library_exists(m pow "" COMPILER_RT_HAS_LIBM) check_library_exists(dl dlopen "" COMPILER_RT_HAS_LIBDL) check_library_exists(pthread pthread_create "" COMPILER_RT_HAS_LIBPTHREAD) diff --git a/compiler-rt/lib/asan/tests/CMakeLists.txt b/compiler-rt/lib/asan/tests/CMakeLists.txt index 2e4caa4b8e85..331f38fed35c 100644 --- a/compiler-rt/lib/asan/tests/CMakeLists.txt +++ b/compiler-rt/lib/asan/tests/CMakeLists.txt @@ -62,9 +62,6 @@ set(ASAN_UNITTEST_INSTRUMENTED_CFLAGS "-fsanitize-blacklist=${ASAN_BLACKLIST_FILE}" ) -# Unit tests require libstdc++ on POSIX. -append_if(COMPILER_RT_HAS_LIBSTDCXX -lstdc++ ASAN_UNITTEST_COMMON_LINKFLAGS) - if(NOT MSVC) list(APPEND ASAN_UNITTEST_COMMON_LINKFLAGS --driver-mode=g++) endif() diff --git a/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt b/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt index 0293197898e0..331117b248c3 100644 --- a/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt +++ b/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt @@ -65,7 +65,10 @@ if(MSVC) -Wno-undefined-inline) endif() -append_if(COMPILER_RT_HAS_LIBSTDCXX -lstdc++ SANITIZER_TEST_LINK_FLAGS_COMMON) +if(NOT MSVC) + list(APPEND SANITIZER_TEST_LINK_FLAGS_COMMON --driver-mode=g++) +endif() + append_if(COMPILER_RT_HAS_LIBDL -ldl SANITIZER_TEST_LINK_FLAGS_COMMON) append_if(COMPILER_RT_HAS_LIBPTHREAD -lpthread SANITIZER_TEST_LINK_FLAGS_COMMON) # x86_64 FreeBSD 9.2 additionally requires libc++ to build the tests.