mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-25 10:48:14 +00:00
tsan: replace deadlock detector custom build script with cmake file
llvm-svn: 202708
This commit is contained in:
parent
1d191909a8
commit
530fb9414b
@ -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)
|
||||
|
37
compiler-rt/lib/tsan/dd/CMakeLists.txt
Normal file
37
compiler-rt/lib/tsan/dd/CMakeLists.txt
Normal file
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user