1 set(TSAN_SOURCES 2 tsan_clock.cc 3 tsan_flags.cc 4 tsan_fd.cc 5 tsan_interceptors.cc 6 tsan_interface_ann.cc 7 tsan_interface_atomic.cc 8 tsan_interface.cc 9 tsan_interface_java.cc 10 tsan_md5.cc 11 tsan_mman.cc 12 tsan_mutex.cc 13 tsan_mutexset.cc 14 tsan_report.cc 15 tsan_rtl.cc 16 tsan_rtl_mutex.cc 17 tsan_rtl_report.cc 18 tsan_rtl_thread.cc 19 tsan_stat.cc 20 tsan_suppressions.cc 21 tsan_symbolize.cc 22 tsan_sync.cc 23 ) 24 25 if(APPLE) 26 list(APPEND TSAN_SOURCES tsan_platform_mac.cc) 27 elseif(UNIX) 28 # Assume Linux 29 list(APPEND TSAN_SOURCES 30 tsan_platform_linux.cc 31 tsan_symbolize_addr2line_linux.cc) 32 endif() 33 34 set(TSAN_RUNTIME_LIBRARIES) 35 # TSan is currently supported on 64-bit Linux only. 36 if(CAN_TARGET_x86_64 AND UNIX AND NOT APPLE) 37 set(TSAN_ASM_SOURCES tsan_rtl_amd64.S) 38 # Pass ASM file directly to the C++ compiler. 39 set_source_files_properties(${TSAN_ASM_SOURCES} PROPERTIES 40 LANGUAGE C) 41 set(arch "x86_64") 42 add_compiler_rt_static_runtime(clang_rt.tsan-${arch} ${arch} 43 SOURCES ${TSAN_SOURCES} ${TSAN_ASM_SOURCES} 44 $<TARGET_OBJECTS:RTInterception.${arch}> 45 $<TARGET_OBJECTS:RTSanitizerCommon.${arch}> 46 CFLAGS ${TSAN_CFLAGS} 47 DEFS ${TSAN_COMMON_DEFINITIONS}) 48 list(APPEND TSAN_RUNTIME_LIBRARIES clang_rt.tsan-${arch}) 49 endif() 50