[Sanitizer tests] Don't need to use -lstdc++ thanks to --driver-mode=g++

Reviewed at http://reviews.llvm.org/D3796

llvm-svn: 209115
This commit is contained in:
Timur Iskhodzhanov 2014-05-19 08:19:38 +00:00
parent 7f0c517168
commit 930ffe94aa
3 changed files with 4 additions and 5 deletions

View File

@ -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)

View File

@ -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()

View File

@ -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.