diff options
-rw-r--r-- | compiler-rt/lib/asan/tests/CMakeLists.txt | 5 | ||||
-rw-r--r-- | compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/compiler-rt/lib/asan/tests/CMakeLists.txt b/compiler-rt/lib/asan/tests/CMakeLists.txt index 8c763c5b2c3..27bed9b9688 100644 --- a/compiler-rt/lib/asan/tests/CMakeLists.txt +++ b/compiler-rt/lib/asan/tests/CMakeLists.txt @@ -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) diff --git a/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt b/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt index 6ffae7d491b..f6f435a89d7 100644 --- a/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt +++ b/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt @@ -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(../..) |