diff --git a/compiler-rt/lib/asan/CMakeLists.txt b/compiler-rt/lib/asan/CMakeLists.txt --- a/compiler-rt/lib/asan/CMakeLists.txt +++ b/compiler-rt/lib/asan/CMakeLists.txt @@ -193,6 +193,7 @@ RTSanitizerCommonLibc RTSanitizerCommonCoverage RTSanitizerCommonSymbolizer + RTSanitizerTLSGetAddr RTLSanCommon RTUbsan CFLAGS ${ASAN_DYNAMIC_CFLAGS} @@ -216,6 +217,7 @@ RTSanitizerCommonLibc RTSanitizerCommonCoverage RTSanitizerCommonSymbolizer + RTSanitizerTLSGetAddr RTLSanCommon RTUbsan) diff --git a/compiler-rt/lib/asan/tests/CMakeLists.txt b/compiler-rt/lib/asan/tests/CMakeLists.txt --- a/compiler-rt/lib/asan/tests/CMakeLists.txt +++ b/compiler-rt/lib/asan/tests/CMakeLists.txt @@ -261,6 +261,7 @@ $ $ $ + $ $ $) else() @@ -273,6 +274,7 @@ $ $ $ + $ $ $ $) @@ -299,6 +301,7 @@ $ $ $ + $ $ $ $ diff --git a/compiler-rt/lib/dfsan/CMakeLists.txt b/compiler-rt/lib/dfsan/CMakeLists.txt --- a/compiler-rt/lib/dfsan/CMakeLists.txt +++ b/compiler-rt/lib/dfsan/CMakeLists.txt @@ -43,6 +43,7 @@ $ $ $ + $ ADDITIONAL_HEADERS ${DFSAN_RTL_HEADERS} CFLAGS ${DFSAN_CFLAGS} PARENT_TARGET dfsan) diff --git a/compiler-rt/lib/hwasan/CMakeLists.txt b/compiler-rt/lib/hwasan/CMakeLists.txt --- a/compiler-rt/lib/hwasan/CMakeLists.txt +++ b/compiler-rt/lib/hwasan/CMakeLists.txt @@ -164,6 +164,7 @@ RTSanitizerCommonLibc RTSanitizerCommonCoverage RTSanitizerCommonSymbolizer + RTSanitizerTLSGetAddr RTLSanCommon RTUbsan CFLAGS ${hwasan_rtl_flags} @@ -202,6 +203,7 @@ RTSanitizerCommonCoverage RTSanitizerCommonSymbolizer RTLSanCommon + RTSanitizerTLSGetAddr RTUbsan RTUbsan_cxx # The only purpose of RTHWAsan_dynamic_version_script_dummy is to diff --git a/compiler-rt/lib/lsan/CMakeLists.txt b/compiler-rt/lib/lsan/CMakeLists.txt --- a/compiler-rt/lib/lsan/CMakeLists.txt +++ b/compiler-rt/lib/lsan/CMakeLists.txt @@ -63,6 +63,7 @@ RTSanitizerCommonLibc RTSanitizerCommonCoverage RTSanitizerCommonSymbolizer + RTSanitizerTLSGetAddr CFLAGS ${LSAN_CFLAGS} LINK_FLAGS ${SANITIZER_COMMON_LINK_FLAGS} ${WEAK_SYMBOL_LINK_FLAGS} LINK_LIBS ${LSAN_LINK_LIBS} @@ -78,6 +79,7 @@ $ $ $ + $ $ ADDITIONAL_HEADERS ${LSAN_HEADERS} CFLAGS ${LSAN_CFLAGS} diff --git a/compiler-rt/lib/memprof/CMakeLists.txt b/compiler-rt/lib/memprof/CMakeLists.txt --- a/compiler-rt/lib/memprof/CMakeLists.txt +++ b/compiler-rt/lib/memprof/CMakeLists.txt @@ -127,7 +127,8 @@ RTSanitizerCommon RTSanitizerCommonLibc RTSanitizerCommonCoverage - RTSanitizerCommonSymbolizer) + RTSanitizerCommonSymbolizer + RTSanitizerTLSGetAddr) add_compiler_rt_runtime(clang_rt.memprof STATIC diff --git a/compiler-rt/lib/msan/CMakeLists.txt b/compiler-rt/lib/msan/CMakeLists.txt --- a/compiler-rt/lib/msan/CMakeLists.txt +++ b/compiler-rt/lib/msan/CMakeLists.txt @@ -55,6 +55,7 @@ $ $ $ + $ $ ADDITIONAL_HEADERS ${MSAN_RTL_HEADERS} CFLAGS ${MSAN_RTL_CFLAGS} diff --git a/compiler-rt/lib/sanitizer_common/CMakeLists.txt b/compiler-rt/lib/sanitizer_common/CMakeLists.txt --- a/compiler-rt/lib/sanitizer_common/CMakeLists.txt +++ b/compiler-rt/lib/sanitizer_common/CMakeLists.txt @@ -36,7 +36,6 @@ sanitizer_stoptheworld_mac.cpp sanitizer_stoptheworld_win.cpp sanitizer_suppressions.cpp - sanitizer_tls_get_addr.cpp sanitizer_thread_registry.cpp sanitizer_type_traits.cpp sanitizer_win.cpp @@ -92,6 +91,10 @@ sanitizer_unwind_win.cpp ) +set(SANITIZER_TLS_GET_ADDR_SOURCES + sanitizer_tls_get_addr.cpp + ) + # Explicitly list all sanitizer_common headers. Not all of these are # included in sanitizer_common source files, but we need to depend on # headers when building our custom unit tests. @@ -265,6 +268,13 @@ ADDITIONAL_HEADERS ${SANITIZER_IMPL_HEADERS} CFLAGS ${SANITIZER_CFLAGS} DEFS ${SANITIZER_COMMON_DEFINITIONS}) +add_compiler_rt_object_libraries(RTSanitizerTLSGetAddr + ${OS_OPTION} + ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH} + SOURCES ${SANITIZER_TLS_GET_ADDR_SOURCES} + ADDITIONAL_HEADERS ${SANITIZER_IMPL_HEADERS} + CFLAGS ${SANITIZER_CFLAGS} + DEFS ${SANITIZER_COMMON_DEFINITIONS}) set(SANITIZER_NO_WEAK_HOOKS_CFLAGS ${SANITIZER_CFLAGS}) list(APPEND SANITIZER_NO_WEAK_HOOKS_CFLAGS "-DSANITIZER_SUPPORTS_WEAK_HOOKS=0") diff --git a/compiler-rt/lib/tsan/rtl/CMakeLists.txt b/compiler-rt/lib/tsan/rtl/CMakeLists.txt --- a/compiler-rt/lib/tsan/rtl/CMakeLists.txt +++ b/compiler-rt/lib/tsan/rtl/CMakeLists.txt @@ -144,6 +144,7 @@ RTSanitizerCommonLibc RTSanitizerCommonCoverage RTSanitizerCommonSymbolizer + RTSanitizerTLSGetAddr RTUbsan CFLAGS ${TSAN_RTL_CFLAGS} LINK_FLAGS ${SANITIZER_COMMON_LINK_FLAGS} ${WEAK_SYMBOL_LINK_FLAGS} @@ -245,6 +246,7 @@ $ $ $ + $ $ ADDITIONAL_HEADERS ${TSAN_HEADERS} CFLAGS ${TSAN_RTL_CFLAGS} @@ -268,6 +270,7 @@ $ $ $ + $ $ ADDITIONAL_HEADERS ${TSAN_HEADERS} CFLAGS ${TSAN_RTL_DYNAMIC_CFLAGS} diff --git a/compiler-rt/lib/tsan/tests/CMakeLists.txt b/compiler-rt/lib/tsan/tests/CMakeLists.txt --- a/compiler-rt/lib/tsan/tests/CMakeLists.txt +++ b/compiler-rt/lib/tsan/tests/CMakeLists.txt @@ -40,6 +40,7 @@ $ $ $ + $ $) set(TSAN_TEST_RUNTIME RTTsanTest) add_library(${TSAN_TEST_RUNTIME} STATIC ${TSAN_TEST_RUNTIME_OBJECTS})