aboutsummaryrefslogtreecommitdiff
path: root/lib/tsan/rtl/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tsan/rtl/CMakeLists.txt')
-rw-r--r--lib/tsan/rtl/CMakeLists.txt29
1 files changed, 11 insertions, 18 deletions
diff --git a/lib/tsan/rtl/CMakeLists.txt b/lib/tsan/rtl/CMakeLists.txt
index d91e2e43ca4c..f1a8ff4d6558 100644
--- a/lib/tsan/rtl/CMakeLists.txt
+++ b/lib/tsan/rtl/CMakeLists.txt
@@ -37,22 +37,15 @@ if(CAN_TARGET_x86_64 AND UNIX AND NOT APPLE)
set(TSAN_ASM_SOURCES tsan_rtl_amd64.S)
# Pass ASM file directly to the C++ compiler.
set_source_files_properties(${TSAN_ASM_SOURCES} PROPERTIES
- LANGUAGE C
- )
- add_library(clang_rt.tsan-x86_64 STATIC
- ${TSAN_SOURCES}
- ${TSAN_ASM_SOURCES}
- $<TARGET_OBJECTS:RTInterception.x86_64>
- $<TARGET_OBJECTS:RTSanitizerCommon.x86_64>
- )
- set_target_compile_flags(clang_rt.tsan-x86_64
- ${TSAN_CFLAGS} ${TARGET_x86_64_CFLAGS}
- )
- list(APPEND TSAN_RUNTIME_LIBRARIES clang_rt.tsan-x86_64)
-endif()
-
-if(TSAN_RUNTIME_LIBRARIES)
- set_property(TARGET ${TSAN_RUNTIME_LIBRARIES} APPEND PROPERTY
- COMPILE_DEFINITIONS ${TSAN_COMMON_DEFINITIONS})
- add_clang_compiler_rt_libraries(${TSAN_RUNTIME_LIBRARIES})
+ 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}
+ SYMS tsan.syms)
+ list(APPEND TSAN_RUNTIME_LIBRARIES clang_rt.tsan-${arch})
endif()