Skip to content

Commit

Permalink
[test] Don't check COMPILER_RT_STANDALONE_BUILD for deps (llvm#66259)
Browse files Browse the repository at this point in the history
COMPILER_RT_STANDALONE_BUILD is only needed to be
checked for dependencies outside of compiler-rt.
  • Loading branch information
vitalybuka authored Sep 15, 2023
1 parent 37402c3 commit 058e9b0
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 28 deletions.
4 changes: 1 addition & 3 deletions compiler-rt/lib/msan/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ macro(msan_link_shared so_list so_name arch kind)
cmake_parse_arguments(SOURCE "" "" "OBJECTS;LINK_FLAGS;DEPS" ${ARGN})
set(output_so "${CMAKE_CURRENT_BINARY_DIR}/${so_name}.${arch}${kind}.so")
get_target_flags_for_arch(${arch} TARGET_LINK_FLAGS)
if(NOT COMPILER_RT_STANDALONE_BUILD)
list(APPEND SOURCE_DEPS msan)
endif()
list(APPEND SOURCE_DEPS msan)
clang_link_shared(${output_so}
OBJECTS ${SOURCE_OBJECTS}
LINK_FLAGS ${COMPILER_RT_UNITTEST_LINK_FLAGS} ${TARGET_LINK_FLAGS} ${SOURCE_LINK_FLAGS}
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/test/asan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ macro(get_bits_for_arch arch bits)
endmacro()

set(ASAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
list(APPEND ASAN_TEST_DEPS asan)
if(NOT COMPILER_RT_STANDALONE_BUILD)
list(APPEND ASAN_TEST_DEPS asan)
if(NOT APPLE AND COMPILER_RT_HAS_LLD AND "lld" IN_LIST LLVM_ENABLE_PROJECTS)
list(APPEND ASAN_TEST_DEPS lld)
endif()
Expand Down
4 changes: 1 addition & 3 deletions compiler-rt/test/dfsan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ foreach(arch ${DFSAN_TEST_ARCH})
endforeach()

set(DFSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
if(NOT COMPILER_RT_STANDALONE_BUILD)
list(APPEND DFSAN_TEST_DEPS dfsan)
endif()
list(APPEND DFSAN_TEST_DEPS dfsan)

add_lit_testsuite(check-dfsan "Running the DataFlowSanitizer tests"
${DFSAN_TESTSUITES}
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/test/hwasan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ foreach(arch ${HWASAN_TEST_ARCH})
endforeach()

set(HWASAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
list(APPEND HWASAN_TEST_DEPS hwasan)
if(NOT COMPILER_RT_STANDALONE_BUILD)
list(APPEND HWASAN_TEST_DEPS hwasan)
if(COMPILER_RT_HAS_LLD AND "lld" IN_LIST LLVM_ENABLE_PROJECTS)
list(APPEND HWASAN_TEST_DEPS lld)
endif()
Expand Down
8 changes: 3 additions & 5 deletions compiler-rt/test/lsan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,9 @@ foreach(arch ${LSAN_TEST_ARCH})
endforeach()

set(LSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
if(NOT COMPILER_RT_STANDALONE_BUILD)
list(APPEND LSAN_TEST_DEPS lsan)
append_list_if(COMPILER_RT_HAS_ASAN asan LSAN_TEST_DEPS)
append_list_if(COMPILER_RT_HAS_HWASAN hwasan LSAN_TEST_DEPS)
endif()
list(APPEND LSAN_TEST_DEPS lsan)
append_list_if(COMPILER_RT_HAS_ASAN asan LSAN_TEST_DEPS)
append_list_if(COMPILER_RT_HAS_HWASAN hwasan LSAN_TEST_DEPS)
add_lit_testsuite(check-lsan "Running the LeakSanitizer tests"
${LSAN_TESTSUITES}
DEPENDS ${LSAN_TEST_DEPS})
Expand Down
4 changes: 1 addition & 3 deletions compiler-rt/test/metadata/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ if(CAN_TARGET_x86_64)
set(METADATA_LIT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})

set(METADATA_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
if (NOT COMPILER_RT_STANDALONE_BUILD)
list(APPEND METADATA_TEST_DEPS asan ubsan)
endif()
list(APPEND METADATA_TEST_DEPS asan ubsan)

set(SANITIZER_COMMON_TEST_TARGET_ARCH ${X86_64})
get_test_cc_for_arch(x86_64 METADATA_TEST_TARGET_CC METADATA_TEST_TARGET_CFLAGS)
Expand Down
3 changes: 2 additions & 1 deletion compiler-rt/test/profile/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ set(PROFILE_LIT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
set(PROFILE_TESTSUITES)
# Profile tests rely on the compiler-rt-headers being in the resource directory
set(PROFILE_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS} compiler-rt-headers)
list(APPEND PROFILE_TEST_DEPS profile)
if(NOT COMPILER_RT_STANDALONE_BUILD)
list(APPEND PROFILE_TEST_DEPS profile llvm-profdata llvm-cov)
list(APPEND PROFILE_TEST_DEPS llvm-profdata llvm-cov)
if(NOT APPLE AND COMPILER_RT_HAS_LLD AND "lld" IN_LIST LLVM_ENABLE_PROJECTS)
list(APPEND PROFILE_TEST_DEPS lld)
endif()
Expand Down
3 changes: 1 addition & 2 deletions compiler-rt/test/safestack/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ set(SAFESTACK_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(SAFESTACK_LIT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})

set(SAFESTACK_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
list(APPEND SAFESTACK_TEST_DEPS safestack)
if(NOT COMPILER_RT_STANDALONE_BUILD)
list(APPEND SAFESTACK_TEST_DEPS safestack)

# Some tests require LTO, so add a dependency on the relevant LTO plugin.
if(LLVM_ENABLE_PIC)
if(LLVM_BINUTILS_INCDIR)
Expand Down
4 changes: 1 addition & 3 deletions compiler-rt/test/tsan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ set(TSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
if(${COMPILER_RT_DEFAULT_TARGET_ARCH} MATCHES "(x86_64|s390x)")
list(APPEND TSAN_TEST_DEPS GotsanRuntimeCheck)
endif()
if(NOT COMPILER_RT_STANDALONE_BUILD)
list(APPEND TSAN_TEST_DEPS tsan)
endif()
list(APPEND TSAN_TEST_DEPS tsan)
if(COMPILER_RT_LIBCXX_PATH AND
COMPILER_RT_LIBCXXABI_PATH AND
COMPILER_RT_TEST_COMPILER_ID STREQUAL "Clang"
Expand Down
4 changes: 1 addition & 3 deletions compiler-rt/test/ubsan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ macro(add_ubsan_device_testsuite test_mode sanitizer platform arch)
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py)
#list(APPEND UBSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
if(NOT COMPILER_RT_STANDALONE_BUILD)
list(APPEND UBSAN_TEST_DEPS ${sanitizer})
endif()
list(APPEND UBSAN_TEST_DEPS ${sanitizer})
add_lit_testsuite(check-ubsan-${test_mode}-${platform}-${arch}
"UBSan ${CONFIG_NAME} tests"
${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/
Expand Down
4 changes: 1 addition & 3 deletions compiler-rt/test/ubsan_minimal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ endif()

set(UBSAN_TESTSUITES)
set(UBSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
if(NOT COMPILER_RT_STANDALONE_BUILD)
list(APPEND UBSAN_TEST_DEPS ubsan-minimal)
endif()
list(APPEND UBSAN_TEST_DEPS ubsan-minimal)

foreach(arch ${UBSAN_TEST_ARCH})
get_test_cc_for_arch(${arch} UBSAN_TEST_TARGET_CC UBSAN_TEST_TARGET_CFLAGS)
Expand Down

0 comments on commit 058e9b0

Please sign in to comment.