[libcxx] Enable building and testing of libcxx with ThreadSanitizer on OS X
authorKuba Brecka <kuba.brecka@gmail.com>
Wed, 14 Sep 2016 14:12:50 +0000 (14:12 +0000)
committerKuba Brecka <kuba.brecka@gmail.com>
Wed, 14 Sep 2016 14:12:50 +0000 (14:12 +0000)
This patch enables building and testing libcxx under ThreadSanitizer on OS X. CMake builds that have -DLLVM_USE_SANITIZER=Thread will automatically build libcxx with -fsanitize=thread and testing via lit then runs under TSan.

Differential Revision: https://reviews.llvm.org/D24297

llvm-svn: 281475

libcxx/lib/CMakeLists.txt

index 8ebda513249615420ecbaa8ddf89f5d75ac6a80e..f01d94f32df6697f8e406ad97979bd5dd35880ee 100644 (file)
@@ -42,6 +42,8 @@ if (APPLE AND LLVM_USE_SANITIZER)
     set(LIBFILE "libclang_rt.asan_osx_dynamic.dylib")
   elseif("${LLVM_USE_SANITIZER}" STREQUAL "Undefined")
     set(LIBFILE "libclang_rt.ubsan_osx_dynamic.dylib")
+  elseif("${LLVM_USE_SANITIZER}" STREQUAL "Thread")
+    set(LIBFILE "libclang_rt.tsan_osx_dynamic.dylib")
   else()
     message(WARNING "LLVM_USE_SANITIZER=${LLVM_USE_SANITIZER} is not supported on OS X")
   endif()