diff options
author | Alexey Samsonov <samsonov@google.com> | 2013-08-29 11:53:11 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2013-08-29 11:53:11 +0000 |
commit | d9760ab05f99451ffe7528a3e03e98ab67e09383 (patch) | |
tree | 030360cf4f83d9fc8a7d0b4c1dbd96a97682c193 /lib/tsan/CMakeLists.txt | |
parent | 225c4cc03b77be2e1766289a84f563a0017b4e67 (diff) | |
download | compiler-rt-d9760ab05f99451ffe7528a3e03e98ab67e09383.tar.gz compiler-rt-d9760ab05f99451ffe7528a3e03e98ab67e09383.tar.bz2 compiler-rt-d9760ab05f99451ffe7528a3e03e98ab67e09383.tar.xz |
[TSan] Move build rules a bit to ensure correct dependencies of check-tsan command
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189579 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/tsan/CMakeLists.txt')
-rw-r--r-- | lib/tsan/CMakeLists.txt | 52 |
1 files changed, 51 insertions, 1 deletions
diff --git a/lib/tsan/CMakeLists.txt b/lib/tsan/CMakeLists.txt index 28288956..7638ec81 100644 --- a/lib/tsan/CMakeLists.txt +++ b/lib/tsan/CMakeLists.txt @@ -19,7 +19,57 @@ else() set(TSAN_COMMON_DEFINITIONS DEBUG=1) endif() -add_subdirectory(rtl) +set(TSAN_SOURCES + rtl/tsan_clock.cc + rtl/tsan_flags.cc + rtl/tsan_fd.cc + rtl/tsan_interceptors.cc + rtl/tsan_interface_ann.cc + rtl/tsan_interface_atomic.cc + rtl/tsan_interface.cc + rtl/tsan_interface_java.cc + rtl/tsan_md5.cc + rtl/tsan_mman.cc + rtl/tsan_mutex.cc + rtl/tsan_mutexset.cc + rtl/tsan_report.cc + rtl/tsan_rtl.cc + rtl/tsan_rtl_mutex.cc + rtl/tsan_rtl_report.cc + rtl/tsan_rtl_thread.cc + rtl/tsan_stat.cc + rtl/tsan_suppressions.cc + rtl/tsan_symbolize.cc + rtl/tsan_sync.cc) + +if(APPLE) + list(APPEND TSAN_SOURCES rtl/tsan_platform_mac.cc) +elseif(UNIX) + # Assume Linux + list(APPEND TSAN_SOURCES + rtl/tsan_platform_linux.cc + rtl/tsan_symbolize_addr2line_linux.cc) +endif() + +set(TSAN_RUNTIME_LIBRARIES) +# TSan is currently supported on 64-bit Linux only. +if(CAN_TARGET_x86_64 AND UNIX AND NOT APPLE) + set(TSAN_ASM_SOURCES rtl/tsan_rtl_amd64.S) + # Pass ASM file directly to the C++ compiler. + set_source_files_properties(${TSAN_ASM_SOURCES} PROPERTIES + LANGUAGE C) + set(arch "x86_64") + add_compiler_rt_static_runtime(clang_rt.tsan-${arch} ${arch} + SOURCES ${TSAN_SOURCES} ${TSAN_ASM_SOURCES} + $<TARGET_OBJECTS:RTInterception.${arch}> + $<TARGET_OBJECTS:RTSanitizerCommon.${arch}> + $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}> + CFLAGS ${TSAN_CFLAGS} + DEFS ${TSAN_COMMON_DEFINITIONS}) + add_sanitizer_rt_symbols(clang_rt.tsan-${arch} rtl/tsan.syms.extra) + list(APPEND TSAN_RUNTIME_LIBRARIES clang_rt.tsan-${arch} + clang_rt.tsan-${arch}-symbols) +endif() if(LLVM_INCLUDE_TESTS) add_subdirectory(tests) |