[compiler-rt] r202708 - tsan: replace deadlock detector custom build script with cmake file

Dmitry Vyukov dvyukov at google.com
Mon Mar 3 05:15:12 PST 2014


Author: dvyukov
Date: Mon Mar  3 07:15:12 2014
New Revision: 202708

URL: http://llvm.org/viewvc/llvm-project?rev=202708&view=rev
Log:
tsan: replace deadlock detector custom build script with cmake file


Added:
    compiler-rt/trunk/lib/tsan/dd/CMakeLists.txt
Removed:
    compiler-rt/trunk/lib/tsan/dd/build.sh
Modified:
    compiler-rt/trunk/lib/CMakeLists.txt

Modified: compiler-rt/trunk/lib/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/CMakeLists.txt?rev=202708&r1=202707&r2=202708&view=diff
==============================================================================
--- compiler-rt/trunk/lib/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/CMakeLists.txt Mon Mar  3 07:15:12 2014
@@ -29,6 +29,7 @@ if(NOT LLVM_USE_SANITIZER)
   if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT ANDROID)
     # ThreadSanitizer and MemorySanitizer are supported on Linux only.
     add_subdirectory(tsan)
+    add_subdirectory(tsan/dd)
     add_subdirectory(msan)
     add_subdirectory(msandr)
     add_subdirectory(dfsan)

Added: compiler-rt/trunk/lib/tsan/dd/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/dd/CMakeLists.txt?rev=202708&view=auto
==============================================================================
--- compiler-rt/trunk/lib/tsan/dd/CMakeLists.txt (added)
+++ compiler-rt/trunk/lib/tsan/dd/CMakeLists.txt Mon Mar  3 07:15:12 2014
@@ -0,0 +1,37 @@
+# Build for the experimental deadlock detector runtime library.
+
+include_directories(../..)
+
+set(DD_CFLAGS ${SANITIZER_COMMON_CFLAGS})
+append_no_rtti_flag(DD_CFLAGS)
+
+if("${CMAKE_BUILD_TYPE}" EQUAL "Release")
+  set(DD_COMMON_DEFINITIONS DEBUG=0)
+else()
+  set(DD_COMMON_DEFINITIONS DEBUG=1)
+endif()
+
+set(DD_SOURCES
+  dd_rtl.cc
+  dd_interceptors.cc
+)
+
+set(DD_HEADERS
+  dd_rtl.h
+)
+
+add_custom_target(dd)
+# Deadlock detector is currently supported on 64-bit Linux only.
+if(CAN_TARGET_x86_64 AND UNIX AND NOT APPLE)
+  set(arch "x86_64")
+  add_compiler_rt_static_runtime(clang_rt.dd-${arch} ${arch}
+    SOURCES ${DD_SOURCES}
+            $<TARGET_OBJECTS:RTInterception.${arch}>
+            $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
+            $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
+    CFLAGS ${DD_CFLAGS}
+    DEFS ${DD_COMMON_DEFINITIONS})
+endif()
+
+add_dependencies(compiler-rt dd)
+

Removed: compiler-rt/trunk/lib/tsan/dd/build.sh
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/dd/build.sh?rev=202707&view=auto
==============================================================================
--- compiler-rt/trunk/lib/tsan/dd/build.sh (original)
+++ compiler-rt/trunk/lib/tsan/dd/build.sh (removed)
@@ -1,45 +0,0 @@
-#!/bin/bash
-set -e
-
-SRCS="
-	dd_rtl.cc
-	dd_interceptors.cc
-	../../sanitizer_common/sanitizer_allocator.cc
-	../../sanitizer_common/sanitizer_common.cc
-	../../sanitizer_common/sanitizer_deadlock_detector1.cc
-	../../sanitizer_common/sanitizer_flags.cc
-	../../sanitizer_common/sanitizer_libc.cc
-	../../sanitizer_common/sanitizer_printf.cc
-	../../sanitizer_common/sanitizer_suppressions.cc
-	../../sanitizer_common/sanitizer_thread_registry.cc
-	../../sanitizer_common/sanitizer_posix.cc
-	../../sanitizer_common/sanitizer_posix_libcdep.cc
-	../../sanitizer_common/sanitizer_procmaps_linux.cc
-	../../sanitizer_common/sanitizer_linux.cc
-	../../sanitizer_common/sanitizer_linux_libcdep.cc
-	../../sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
-	../../sanitizer_common/sanitizer_stackdepot.cc
-	../../sanitizer_common/sanitizer_stacktrace.cc
-	../../sanitizer_common/sanitizer_stacktrace_libcdep.cc
-	../../sanitizer_common/sanitizer_symbolizer.cc
-	../../sanitizer_common/sanitizer_symbolizer_libcdep.cc
-	../../sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc
-	../../sanitizer_common/sanitizer_symbolizer_libbacktrace.cc
-	../../interception/interception_linux.cc
-"
-
-FLAGS=" -I../.. -I../../sanitizer_common -I../../interception -Wall -fno-exceptions -fno-rtti -DSANITIZER_USE_MALLOC"
-if [ "$DEBUG" == "" ]; then
-	FLAGS+=" -DDEBUG=0 -O3 -fomit-frame-pointer"
-else
-	FLAGS+=" -DDEBUG=1 -g"
-fi
-
-rm -f dd.cc
-for F in $SRCS; do
-	g++ $F -c -o dd.o $FLAGS
-	cat $F >> dd.cc
-done
-
-g++ dd.cc -c -o dd.o $FLAGS
-





More information about the llvm-commits mailing list