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

Timur Iskhodzhanov timurrrr at google.com
Mon May 19 01:19:38 PDT 2014


Author: timurrrr
Date: Mon May 19 03:19:38 2014
New Revision: 209115

URL: http://llvm.org/viewvc/llvm-project?rev=209115&view=rev
Log:
[Sanitizer tests] Don't need to use -lstdc++ thanks to --driver-mode=g++

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

Modified:
    compiler-rt/trunk/cmake/config-ix.cmake
    compiler-rt/trunk/lib/asan/tests/CMakeLists.txt
    compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt

Modified: compiler-rt/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/config-ix.cmake?rev=209115&r1=209114&r2=209115&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/config-ix.cmake (original)
+++ compiler-rt/trunk/cmake/config-ix.cmake Mon May 19 03:19:38 2014
@@ -45,7 +45,6 @@ check_cxx_compiler_flag(/wd4722 COMPILER
 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)

Modified: compiler-rt/trunk/lib/asan/tests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/CMakeLists.txt?rev=209115&r1=209114&r2=209115&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/asan/tests/CMakeLists.txt Mon May 19 03:19:38 2014
@@ -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()

Modified: compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt?rev=209115&r1=209114&r2=209115&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt Mon May 19 03:19:38 2014
@@ -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.





More information about the llvm-commits mailing list