Index: lib/CMakeLists.txt =================================================================== --- lib/CMakeLists.txt +++ lib/CMakeLists.txt @@ -46,6 +46,7 @@ endif() compiler_rt_build_sanitizer(asan) + compiler_rt_build_sanitizer(common) compiler_rt_build_sanitizer(dfsan) compiler_rt_build_sanitizer(msan) compiler_rt_build_sanitizer(tsan tsan/dd) Index: lib/asan/CMakeLists.txt =================================================================== --- lib/asan/CMakeLists.txt +++ lib/asan/CMakeLists.txt @@ -134,7 +134,9 @@ ARCHS ${ASAN_SUPPORTED_ARCH} OBJECT_LIBS RTAsan_preinit RTAsan - ${ASAN_COMMON_RUNTIME_OBJECT_LIBS} + RTInterception + RTLSanCommon + RTUbsan CFLAGS ${ASAN_CFLAGS} DEFS ${ASAN_COMMON_DEFINITIONS} PARENT_TARGET asan) Index: lib/cfi/CMakeLists.txt =================================================================== --- lib/cfi/CMakeLists.txt +++ lib/cfi/CMakeLists.txt @@ -18,8 +18,6 @@ ARCHS ${arch} SOURCES ${CFI_SOURCES} OBJECT_LIBS RTInterception - RTSanitizerCommon - RTSanitizerCommonLibc CFLAGS ${CFI_CFLAGS} PARENT_TARGET cfi) add_compiler_rt_runtime(clang_rt.cfi_diag @@ -27,9 +25,7 @@ ARCHS ${arch} SOURCES ${CFI_SOURCES} OBJECT_LIBS RTInterception - RTSanitizerCommon - RTSanitizerCommonLibc - RTUbsan + RTUbsan CFLAGS ${CFI_CFLAGS} ${CFI_DIAG_CFLAGS} PARENT_TARGET cfi) endforeach() Index: lib/dfsan/CMakeLists.txt =================================================================== --- lib/dfsan/CMakeLists.txt +++ lib/dfsan/CMakeLists.txt @@ -21,8 +21,6 @@ ARCHS ${arch} SOURCES ${DFSAN_RTL_SOURCES} $ - $ - $ CFLAGS ${DFSAN_CFLAGS} PARENT_TARGET dfsan) add_sanitizer_rt_symbols(clang_rt.dfsan Index: lib/esan/CMakeLists.txt =================================================================== --- lib/esan/CMakeLists.txt +++ lib/esan/CMakeLists.txt @@ -24,8 +24,6 @@ ARCHS ${arch} SOURCES ${ESAN_SOURCES} $ - $ - $ CFLAGS ${ESAN_RTL_CFLAGS}) add_sanitizer_rt_symbols(clang_rt.esan ARCHS ${arch} Index: lib/lsan/CMakeLists.txt =================================================================== --- lib/lsan/CMakeLists.txt +++ lib/lsan/CMakeLists.txt @@ -31,8 +31,6 @@ ARCHS ${arch} SOURCES ${LSAN_SOURCES} $ - $ - $ $ CFLAGS ${LSAN_CFLAGS} PARENT_TARGET lsan) Index: lib/msan/CMakeLists.txt =================================================================== --- lib/msan/CMakeLists.txt +++ lib/msan/CMakeLists.txt @@ -33,8 +33,6 @@ ARCHS ${arch} SOURCES ${MSAN_RTL_SOURCES} $ - $ - $ $ CFLAGS ${MSAN_RTL_CFLAGS} PARENT_TARGET msan) Index: lib/sanitizer_common/CMakeLists.txt =================================================================== --- lib/sanitizer_common/CMakeLists.txt +++ lib/sanitizer_common/CMakeLists.txt @@ -183,6 +183,14 @@ CFLAGS ${SANITIZER_CFLAGS} DEFS ${SANITIZER_COMMON_DEFINITIONS}) +add_compiler_rt_runtime(clang_rt.san_common + STATIC + ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH} + OBJECT_LIBS RTSanitizerCommon + RTSanitizerCommonLibc + CFLAGS ${SANITIZER_COMMON_CFLAGS} + PARENT_TARGET common) + # Unit tests for common sanitizer runtime. if(COMPILER_RT_INCLUDE_TESTS) add_subdirectory(tests) Index: lib/stats/CMakeLists.txt =================================================================== --- lib/stats/CMakeLists.txt +++ lib/stats/CMakeLists.txt @@ -4,21 +4,25 @@ set_target_properties(stats PROPERTIES FOLDER "Compiler-RT Misc") if(APPLE) - set(STATS_LIB_FLAVOR SHARED) + add_compiler_rt_runtime(clang_rt.stats + SHARED + ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH} + OS ${SANITIZER_COMMON_SUPPORTED_OS} + SOURCES stats.cc + OBJECT_LIBS RTSanitizerCommon + RTSanitizerCommonLibc + CFLAGS ${SANITIZER_COMMON_CFLAGS} + PARENT_TARGET stats) else() - set(STATS_LIB_FLAVOR STATIC) + add_compiler_rt_runtime(clang_rt.stats + STATIC + ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH} + OS ${SANITIZER_COMMON_SUPPORTED_OS} + SOURCES stats.cc + CFLAGS ${SANITIZER_COMMON_CFLAGS} + PARENT_TARGET stats) endif() -add_compiler_rt_runtime(clang_rt.stats - ${STATS_LIB_FLAVOR} - ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH} - OS ${SANITIZER_COMMON_SUPPORTED_OS} - SOURCES stats.cc - OBJECT_LIBS RTSanitizerCommon - RTSanitizerCommonLibc - CFLAGS ${SANITIZER_COMMON_CFLAGS} - PARENT_TARGET stats) - add_compiler_rt_runtime(clang_rt.stats_client STATIC ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH} Index: lib/tsan/CMakeLists.txt =================================================================== --- lib/tsan/CMakeLists.txt +++ lib/tsan/CMakeLists.txt @@ -172,8 +172,6 @@ ARCHS ${arch} SOURCES ${TSAN_SOURCES} ${TSAN_ASM_SOURCES} $ - $ - $ $ CFLAGS ${TSAN_RTL_CFLAGS}) add_compiler_rt_runtime(clang_rt.tsan_cxx Index: lib/ubsan/CMakeLists.txt =================================================================== --- lib/ubsan/CMakeLists.txt +++ lib/ubsan/CMakeLists.txt @@ -96,10 +96,8 @@ add_compiler_rt_runtime(clang_rt.ubsan_standalone STATIC ARCHS ${UBSAN_SUPPORTED_ARCH} - OBJECT_LIBS RTSanitizerCommon - RTSanitizerCommonLibc - RTUbsan - RTUbsan_standalone + OBJECT_LIBS RTUbsan + RTUbsan_standalone CFLAGS ${UBSAN_CFLAGS} PARENT_TARGET ubsan) Index: lib/xray/CMakeLists.txt =================================================================== --- lib/xray/CMakeLists.txt +++ lib/xray/CMakeLists.txt @@ -49,10 +49,6 @@ add_compiler_rt_component(xray) add_compiler_rt_component(xray-fdr) -set(XRAY_COMMON_RUNTIME_OBJECT_LIBS - RTSanitizerCommon - RTSanitizerCommonLibc) - foreach(arch ${XRAY_SUPPORTED_ARCH}) if(CAN_TARGET_${arch}) add_compiler_rt_runtime(clang_rt.xray @@ -61,7 +57,6 @@ SOURCES ${${arch}_SOURCES} CFLAGS ${XRAY_CFLAGS} DEFS ${XRAY_COMMON_DEFINITIONS} - OBJECT_LIBS ${XRAY_COMMON_RUNTIME_OBJECT_LIBS} PARENT_TARGET xray) add_compiler_rt_runtime(clang_rt.xray-fdr STATIC @@ -69,7 +64,6 @@ SOURCES ${XRAY_FDR_SOURCES} CFLAGS ${XRAY_CFLAGS} DEFS ${XRAY_COMMON_DEFINITIONS} - OBJECT_LIBS ${XRAY_COMMON_RUNTIME_OBJECT_LIBS} PARENT_TARGET xray-fdr) endif() endforeach()