forked from OSchip/llvm-project
[CMake] Remove cxx-headers from runtime deps
Part of D88922
This commit is contained in:
parent
ed4fbe6d9c
commit
6db314e86b
|
@ -111,10 +111,6 @@ append_list_if(COMPILER_RT_HAS_LIBPTHREAD pthread ASAN_DYNAMIC_LIBS)
|
|||
append_list_if(COMPILER_RT_HAS_LIBLOG log ASAN_DYNAMIC_LIBS)
|
||||
append_list_if(MINGW "${MINGW_LIBRARIES}" ASAN_DYNAMIC_LIBS)
|
||||
|
||||
if (TARGET cxx-headers OR HAVE_LIBCXX)
|
||||
set(ASAN_DEPS cxx-headers)
|
||||
endif()
|
||||
|
||||
# Compile ASan sources into an object library.
|
||||
|
||||
add_compiler_rt_object_libraries(RTAsan_dynamic
|
||||
|
@ -123,8 +119,7 @@ add_compiler_rt_object_libraries(RTAsan_dynamic
|
|||
SOURCES ${ASAN_SOURCES} ${ASAN_CXX_SOURCES}
|
||||
ADDITIONAL_HEADERS ${ASAN_HEADERS}
|
||||
CFLAGS ${ASAN_DYNAMIC_CFLAGS}
|
||||
DEFS ${ASAN_DYNAMIC_DEFINITIONS}
|
||||
DEPS ${ASAN_DEPS})
|
||||
DEFS ${ASAN_DYNAMIC_DEFINITIONS})
|
||||
|
||||
if(NOT APPLE)
|
||||
add_compiler_rt_object_libraries(RTAsan
|
||||
|
@ -132,30 +127,26 @@ if(NOT APPLE)
|
|||
SOURCES ${ASAN_SOURCES}
|
||||
ADDITIONAL_HEADERS ${ASAN_HEADERS}
|
||||
CFLAGS ${ASAN_CFLAGS}
|
||||
DEFS ${ASAN_COMMON_DEFINITIONS}
|
||||
DEPS ${ASAN_DEPS})
|
||||
DEFS ${ASAN_COMMON_DEFINITIONS})
|
||||
add_compiler_rt_object_libraries(RTAsan_cxx
|
||||
ARCHS ${ASAN_SUPPORTED_ARCH}
|
||||
SOURCES ${ASAN_CXX_SOURCES}
|
||||
ADDITIONAL_HEADERS ${ASAN_HEADERS}
|
||||
CFLAGS ${ASAN_CFLAGS}
|
||||
DEFS ${ASAN_COMMON_DEFINITIONS}
|
||||
DEPS ${ASAN_DEPS})
|
||||
DEFS ${ASAN_COMMON_DEFINITIONS})
|
||||
add_compiler_rt_object_libraries(RTAsan_preinit
|
||||
ARCHS ${ASAN_SUPPORTED_ARCH}
|
||||
SOURCES ${ASAN_PREINIT_SOURCES}
|
||||
ADDITIONAL_HEADERS ${ASAN_HEADERS}
|
||||
CFLAGS ${ASAN_CFLAGS}
|
||||
DEFS ${ASAN_COMMON_DEFINITIONS}
|
||||
DEPS ${ASAN_DEPS})
|
||||
DEFS ${ASAN_COMMON_DEFINITIONS})
|
||||
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp "")
|
||||
add_compiler_rt_object_libraries(RTAsan_dynamic_version_script_dummy
|
||||
ARCHS ${ASAN_SUPPORTED_ARCH}
|
||||
SOURCES ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp
|
||||
CFLAGS ${ASAN_DYNAMIC_CFLAGS}
|
||||
DEFS ${ASAN_DYNAMIC_DEFINITIONS}
|
||||
DEPS ${ASAN_DEPS})
|
||||
DEFS ${ASAN_DYNAMIC_DEFINITIONS})
|
||||
endif()
|
||||
|
||||
# Build ASan runtimes shipped with Clang.
|
||||
|
@ -250,8 +241,7 @@ else()
|
|||
ARCHS ${arch}
|
||||
SOURCES asan_win_weak_interception.cpp
|
||||
CFLAGS ${ASAN_CFLAGS} -DSANITIZER_DYNAMIC
|
||||
DEFS ${ASAN_COMMON_DEFINITIONS}
|
||||
DEPS ${ASAN_DEPS})
|
||||
DEFS ${ASAN_COMMON_DEFINITIONS})
|
||||
set(ASAN_DYNAMIC_WEAK_INTERCEPTION
|
||||
AsanWeakInterception
|
||||
UbsanWeakInterception
|
||||
|
@ -296,8 +286,7 @@ else()
|
|||
SOURCES asan_globals_win.cpp
|
||||
asan_win_dll_thunk.cpp
|
||||
CFLAGS ${ASAN_CFLAGS} -DSANITIZER_DLL_THUNK
|
||||
DEFS ${ASAN_COMMON_DEFINITIONS}
|
||||
DEPS ${ASAN_DEPS})
|
||||
DEFS ${ASAN_COMMON_DEFINITIONS})
|
||||
|
||||
add_compiler_rt_runtime(clang_rt.asan_dll_thunk
|
||||
STATIC
|
||||
|
@ -322,8 +311,7 @@ else()
|
|||
SOURCES asan_globals_win.cpp
|
||||
asan_win_dynamic_runtime_thunk.cpp
|
||||
CFLAGS ${ASAN_CFLAGS} ${DYNAMIC_RUNTIME_THUNK_CFLAGS}
|
||||
DEFS ${ASAN_COMMON_DEFINITIONS}
|
||||
DEPS ${ASAN_DEPS})
|
||||
DEFS ${ASAN_COMMON_DEFINITIONS})
|
||||
|
||||
add_compiler_rt_runtime(clang_rt.asan_dynamic_runtime_thunk
|
||||
STATIC
|
||||
|
|
|
@ -71,10 +71,6 @@ append_list_if(COMPILER_RT_HAS_LIBRT rt HWASAN_DYNAMIC_LIBS)
|
|||
append_list_if(COMPILER_RT_HAS_LIBM m HWASAN_DYNAMIC_LIBS)
|
||||
append_list_if(COMPILER_RT_HAS_LIBPTHREAD pthread HWASAN_DYNAMIC_LIBS)
|
||||
|
||||
if (TARGET cxx-headers OR HAVE_LIBCXX)
|
||||
set(HWASAN_DEPS cxx-headers)
|
||||
endif()
|
||||
|
||||
# Static runtime library.
|
||||
add_compiler_rt_component(hwasan)
|
||||
|
||||
|
@ -83,30 +79,26 @@ add_compiler_rt_object_libraries(RTHwasan
|
|||
SOURCES ${HWASAN_RTL_SOURCES}
|
||||
ADDITIONAL_HEADERS ${HWASAN_RTL_HEADERS}
|
||||
CFLAGS ${HWASAN_RTL_CFLAGS}
|
||||
DEFS ${HWASAN_DEFINITIONS}
|
||||
DEPS ${HWASAN_DEPS})
|
||||
DEFS ${HWASAN_DEFINITIONS})
|
||||
add_compiler_rt_object_libraries(RTHwasan_cxx
|
||||
ARCHS ${HWASAN_SUPPORTED_ARCH}
|
||||
SOURCES ${HWASAN_RTL_CXX_SOURCES}
|
||||
ADDITIONAL_HEADERS ${HWASAN_RTL_HEADERS}
|
||||
CFLAGS ${HWASAN_RTL_CFLAGS}
|
||||
DEFS ${HWASAN_DEFINITIONS}
|
||||
DEPS ${HWASAN_DEPS})
|
||||
DEFS ${HWASAN_DEFINITIONS})
|
||||
add_compiler_rt_object_libraries(RTHwasan_dynamic
|
||||
ARCHS ${HWASAN_SUPPORTED_ARCH}
|
||||
SOURCES ${HWASAN_RTL_SOURCES} ${HWASAN_RTL_CXX_SOURCES}
|
||||
ADDITIONAL_HEADERS ${HWASAN_RTL_HEADERS}
|
||||
CFLAGS ${HWASAN_DYNAMIC_CFLAGS}
|
||||
DEFS ${HWASAN_DEFINITIONS}
|
||||
DEPS ${HWASAN_DEPS})
|
||||
DEFS ${HWASAN_DEFINITIONS})
|
||||
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp "")
|
||||
add_compiler_rt_object_libraries(RTHwasan_dynamic_version_script_dummy
|
||||
ARCHS ${HWASAN_SUPPORTED_ARCH}
|
||||
SOURCES ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp
|
||||
CFLAGS ${HWASAN_DYNAMIC_CFLAGS}
|
||||
DEFS ${HWASAN_DEFINITIONS}
|
||||
DEPS ${HWASAN_DEPS})
|
||||
DEFS ${HWASAN_DEFINITIONS})
|
||||
|
||||
foreach(arch ${HWASAN_SUPPORTED_ARCH})
|
||||
add_compiler_rt_runtime(clang_rt.hwasan
|
||||
|
|
|
@ -64,10 +64,6 @@ append_list_if(COMPILER_RT_HAS_LIBM m MEMPROF_DYNAMIC_LIBS)
|
|||
append_list_if(COMPILER_RT_HAS_LIBPTHREAD pthread MEMPROF_DYNAMIC_LIBS)
|
||||
append_list_if(COMPILER_RT_HAS_LIBLOG log MEMPROF_DYNAMIC_LIBS)
|
||||
|
||||
if (TARGET cxx-headers OR HAVE_LIBCXX)
|
||||
set(MEMPROF_DEPS cxx-headers)
|
||||
endif()
|
||||
|
||||
# Compile MemProf sources into an object library.
|
||||
|
||||
add_compiler_rt_object_libraries(RTMemprof_dynamic
|
||||
|
|
|
@ -25,10 +25,6 @@ append_list_if(SANITIZER_LIMIT_FRAME_SIZE -Wframe-larger-than=530
|
|||
append_list_if(COMPILER_RT_HAS_WGLOBAL_CONSTRUCTORS_FLAG -Wglobal-constructors
|
||||
TSAN_RTL_CFLAGS)
|
||||
|
||||
if (TARGET cxx-headers OR HAVE_LIBCXX)
|
||||
set(TSAN_DEPS cxx-headers)
|
||||
endif()
|
||||
|
||||
set(TSAN_SOURCES
|
||||
rtl/tsan_clock.cpp
|
||||
rtl/tsan_debugging.cpp
|
||||
|
@ -146,7 +142,6 @@ if(APPLE)
|
|||
RTSanitizerCommonSymbolizer
|
||||
RTUbsan
|
||||
CFLAGS ${TSAN_RTL_CFLAGS}
|
||||
DEPS ${TSAN_DEPS}
|
||||
LINK_FLAGS ${SANITIZER_COMMON_LINK_FLAGS} ${WEAK_SYMBOL_LINK_FLAGS}
|
||||
LINK_LIBS ${TSAN_LINK_LIBS} objc
|
||||
PARENT_TARGET tsan)
|
||||
|
@ -155,8 +150,7 @@ if(APPLE)
|
|||
ARCHS ${TSAN_SUPPORTED_ARCH}
|
||||
SOURCES ${TSAN_SOURCES} ${TSAN_CXX_SOURCES} ${TSAN_ASM_SOURCES}
|
||||
ADDITIONAL_HEADERS ${TSAN_HEADERS}
|
||||
CFLAGS ${TSAN_RTL_CFLAGS}
|
||||
DEPS ${TSAN_DEPS})
|
||||
CFLAGS ${TSAN_RTL_CFLAGS})
|
||||
|
||||
# Build and check Go runtime.
|
||||
set(BUILDGO_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/go/buildgo.sh)
|
||||
|
@ -220,7 +214,6 @@ else()
|
|||
$<TARGET_OBJECTS:RTUbsan.${arch}>
|
||||
ADDITIONAL_HEADERS ${TSAN_HEADERS}
|
||||
CFLAGS ${TSAN_RTL_CFLAGS}
|
||||
DEPS ${TSAN_DEPS}
|
||||
PARENT_TARGET tsan)
|
||||
add_compiler_rt_runtime(clang_rt.tsan_cxx
|
||||
STATIC
|
||||
|
@ -229,7 +222,6 @@ else()
|
|||
$<TARGET_OBJECTS:RTUbsan_cxx.${arch}>
|
||||
ADDITIONAL_HEADERS ${TSAN_HEADERS}
|
||||
CFLAGS ${TSAN_RTL_CFLAGS}
|
||||
DEPS ${TSAN_DEPS}
|
||||
PARENT_TARGET tsan)
|
||||
list(APPEND TSAN_RUNTIME_LIBRARIES clang_rt.tsan-${arch}
|
||||
clang_rt.tsan_cxx-${arch})
|
||||
|
|
|
@ -53,6 +53,12 @@ foreach (header ${TSAN_HEADERS})
|
|||
list(APPEND TSAN_RTL_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../${header})
|
||||
endforeach()
|
||||
|
||||
set(TSAN_DEPS gtest tsan)
|
||||
# TSan uses C++ standard library headers.
|
||||
if (TARGET cxx-headers OR HAVE_LIBCXX)
|
||||
set(TSAN_DEPS cxx-headers)
|
||||
endif()
|
||||
|
||||
# add_tsan_unittest(<name>
|
||||
# SOURCES <sources list>
|
||||
# HEADERS <extra headers list>)
|
||||
|
@ -66,7 +72,7 @@ macro(add_tsan_unittest testname)
|
|||
SOURCES ${TEST_SOURCES} ${COMPILER_RT_GTEST_SOURCE}
|
||||
RUNTIME ${TSAN_TEST_RUNTIME}
|
||||
COMPILE_DEPS ${TEST_HEADERS} ${TSAN_RTL_HEADERS}
|
||||
DEPS gtest tsan
|
||||
DEPS ${TSAN_DEPS}
|
||||
CFLAGS ${TSAN_UNITTEST_CFLAGS}
|
||||
LINK_FLAGS ${LINK_FLAGS})
|
||||
endforeach()
|
||||
|
|
Loading…
Reference in New Issue