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

Timur Iskhodzhanov timurrrr at google.com
Fri May 16 05:26:50 PDT 2014


Hi samsonov,

http://reviews.llvm.org/D3796

Files:
  cmake/config-ix.cmake
  lib/asan/tests/CMakeLists.txt
  lib/sanitizer_common/tests/CMakeLists.txt

Index: lib/sanitizer_common/tests/CMakeLists.txt
===================================================================
--- lib/sanitizer_common/tests/CMakeLists.txt
+++ lib/sanitizer_common/tests/CMakeLists.txt
@@ -65,7 +65,10 @@
        -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.
Index: lib/asan/tests/CMakeLists.txt
===================================================================
--- lib/asan/tests/CMakeLists.txt
+++ lib/asan/tests/CMakeLists.txt
@@ -62,9 +62,6 @@
   "-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()
Index: cmake/config-ix.cmake
===================================================================
--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -45,7 +45,6 @@
 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)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3796.9469.patch
Type: text/x-patch
Size: 1632 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140516/57d15672/attachment.bin>


More information about the llvm-commits mailing list