CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
45 lines
1.6 KiB
CMake
45 lines
1.6 KiB
CMake
# Build for the ThreadSanitizer runtime support library.
|
|
|
|
set(TSAN_CFLAGS ${SANITIZER_COMMON_CFLAGS})
|
|
# SANITIZER_COMMON_CFLAGS contains -fPIC, but it's performance-critical for
|
|
# TSan runtime to be built with -fPIE to reduce the number of register spills.
|
|
# On FreeBSD however it provokes linkage issue thus we disable it.
|
|
if(NOT CMAKE_SYSTEM MATCHES "FreeBSD")
|
|
append_list_if(COMPILER_RT_HAS_FPIE_FLAG -fPIE TSAN_CFLAGS)
|
|
endif()
|
|
append_rtti_flag(OFF TSAN_CFLAGS)
|
|
|
|
if(COMPILER_RT_TSAN_DEBUG_OUTPUT)
|
|
# Add extra debug information to TSan runtime. This configuration is rarely
|
|
# used, but we need to support it so that debug output will not bitrot.
|
|
list(APPEND TSAN_CFLAGS -DTSAN_DEBUG_OUTPUT=2)
|
|
endif()
|
|
|
|
# Add the actual runtime library.
|
|
add_subdirectory(rtl)
|
|
|
|
# Build libcxx instrumented with TSan.
|
|
if(COMPILER_RT_LIBCXX_PATH AND
|
|
COMPILER_RT_LIBCXXABI_PATH AND
|
|
COMPILER_RT_TEST_COMPILER_ID STREQUAL "Clang" AND
|
|
NOT ANDROID)
|
|
set(libcxx_tsan_deps)
|
|
foreach(arch ${TSAN_SUPPORTED_ARCH})
|
|
get_target_flags_for_arch(${arch} TARGET_CFLAGS)
|
|
set(LIBCXX_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libcxx_tsan_${arch})
|
|
add_custom_libcxx(libcxx_tsan_${arch} ${LIBCXX_PREFIX}
|
|
DEPS ${TSAN_RUNTIME_LIBRARIES}
|
|
CFLAGS ${TARGET_CFLAGS} -fsanitize=thread
|
|
CMAKE_ARGS -DRUNTIMES_EXECUTE_ONLY_CODE=${RUNTIMES_EXECUTE_ONLY_CODE}
|
|
USE_TOOLCHAIN)
|
|
list(APPEND libcxx_tsan_deps libcxx_tsan_${arch}-install-cmake326-workaround)
|
|
endforeach()
|
|
|
|
add_custom_target(libcxx_tsan DEPENDS ${libcxx_tsan_deps})
|
|
set_target_properties(libcxx_tsan PROPERTIES FOLDER "Compiler-RT/Metatargets")
|
|
endif()
|
|
|
|
if(COMPILER_RT_INCLUDE_TESTS)
|
|
add_subdirectory(tests)
|
|
endif()
|