[compiler-rt] r207408 - Fix building Asan and common sanitizers tests on FreeBSD 9.2

Viktor Kutuzov vkutuzov at accesssoftek.com
Mon Apr 28 03:33:02 PDT 2014


Author: vkutuzov
Date: Mon Apr 28 05:33:01 2014
New Revision: 207408

URL: http://llvm.org/viewvc/llvm-project?rev=207408&view=rev
Log:
Fix building Asan and common sanitizers tests on FreeBSD 9.2

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

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=207408&r1=207407&r2=207408&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/asan/tests/CMakeLists.txt Mon Apr 28 05:33:01 2014
@@ -50,6 +50,11 @@ set(ASAN_UNITTEST_INSTRUMENTED_CFLAGS
 
 # Unit tests require libstdc++.
 set(ASAN_UNITTEST_COMMON_LINKFLAGS -lstdc++)
+# x86_64 FreeBSD 9.2 additionally requires libc++ to build the tests.
+if(CMAKE_SYSTEM MATCHES "FreeBSD-9.2-RELEASE")
+  list(APPEND ASAN_UNITTEST_COMMON_LINKFLAGS "-lc++")
+endif()
+
 # Unit tests on Mac depend on Foundation.
 if(APPLE)
   list(APPEND ASAN_UNITTEST_COMMON_LINKFLAGS -framework Foundation)

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=207408&r1=207407&r2=207408&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt Mon Apr 28 05:33:01 2014
@@ -45,6 +45,10 @@ set(SANITIZER_TEST_LINK_FLAGS_COMMON
   -lstdc++)
 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.
+if(CMAKE_SYSTEM MATCHES "FreeBSD-9.2-RELEASE")
+  list(APPEND SANITIZER_TEST_LINK_FLAGS_COMMON "-lc++")
+endif()
 
 include_directories(..)
 include_directories(../..)





More information about the llvm-commits mailing list