Skip to content

Commit f52a294

Browse files
committed
[compiler-rt] Don't check COMPILER_RT_STANDALONE_BUILD for test deps
With llvm#83088, we now need the runtimes to be built before running test if COMPILER_RT_TEST_STANDALONE_BUILD_LIBS is true, since otherwise we get failures running `ninja check-all` such as the following: ``` /usr/bin/ld: cannot find .../compiler-rt/cmake-build-all-sanitizers/lib/linux/libclang_rt.fuzzer-x86_64.a: No such file or directory /usr/bin/ld: cannot find .../compiler-rt/cmake-build-all-sanitizers/lib/linux/libclang_rt.xray-x86_64.a: No such file or directory /usr/bin/ld: cannot find .../compiler-rt/cmake-build-all-sanitizers/lib/linux/libclang_rt.xray-basic-x86_64.a: No such file or directory /usr/bin/ld: cannot find .../compiler-rt/cmake-build-all-sanitizers/lib/linux/libclang_rt.xray-fdr-x86_64.a: No such file or directory ``` This is a follow-up to 058e9b0 which started removing these checks and it should make it easier to stop forcing COMPILER_RT_STANDALONE_BUILD for runtimes builds in the future. Pull Request: llvm#83651
1 parent 213c78c commit f52a294

File tree

8 files changed

+24
-33
lines changed

8 files changed

+24
-33
lines changed

compiler-rt/cmake/Modules/CompilerRTCompile.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ function(clang_compile object_file source)
6565
cmake_parse_arguments(SOURCE "" "" "CFLAGS;DEPS" ${ARGN})
6666
get_filename_component(source_rpath ${source} REALPATH)
6767
if(NOT COMPILER_RT_STANDALONE_BUILD)
68-
list(APPEND SOURCE_DEPS clang compiler-rt-headers)
68+
list(APPEND SOURCE_DEPS clang)
6969
endif()
70+
list(APPEND SOURCE_DEPS compiler-rt-headers)
7071
if (TARGET CompilerRTUnitTestCheckCxx)
7172
list(APPEND SOURCE_DEPS CompilerRTUnitTestCheckCxx)
7273
endif()

compiler-rt/lib/msan/tests/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,7 @@ macro(add_msan_tests_for_arch arch kind cflags)
120120
set(MSAN_TEST_DEPS ${MSAN_TEST_OBJECTS} libcxx_msan_${arch}-build
121121
${MSAN_LOADABLE_SO}
122122
"${MSAN_LIBCXX_DIR}/libc++.a" "${MSAN_LIBCXX_DIR}/libc++abi.a")
123-
if(NOT COMPILER_RT_STANDALONE_BUILD)
124-
list(APPEND MSAN_TEST_DEPS msan)
125-
endif()
123+
list(APPEND MSAN_TEST_DEPS msan)
126124
get_target_flags_for_arch(${arch} TARGET_LINK_FLAGS)
127125
add_compiler_rt_test(MsanUnitTests "Msan-${arch}${kind}-Test" ${arch}
128126
OBJECTS ${MSAN_TEST_OBJECTS} "${MSAN_LIBCXX_DIR}/libc++.a" "${MSAN_LIBCXX_DIR}/libc++abi.a"

compiler-rt/test/asan_abi/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ macro(get_bits_for_arch arch bits)
99
endif()
1010
endmacro()
1111

12-
set(ASAN_ABI_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
13-
if(NOT COMPILER_RT_STANDALONE_BUILD)
14-
list(APPEND ASAN_ABI_TEST_DEPS asan_abi)
15-
endif()
12+
set(ASAN_ABI_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS} asan_abi)
1613

1714
set(ASAN_ABI_TEST_ARCH ${ASAN_ABI_SUPPORTED_ARCH})
1815
if(APPLE)

compiler-rt/test/fuzzer/CMakeLists.txt

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
set(LIBFUZZER_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
1+
set(LIBFUZZER_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS} fuzzer)
2+
if (COMPILER_RT_HAS_UBSAN)
3+
list(APPEND LIBFUZZER_TEST_DEPS ubsan)
4+
endif()
5+
if (COMPILER_RT_HAS_ASAN)
6+
list(APPEND LIBFUZZER_TEST_DEPS asan)
7+
endif()
8+
if (COMPILER_RT_HAS_MSAN)
9+
list(APPEND LIBFUZZER_TEST_DEPS msan)
10+
endif()
11+
if (COMPILER_RT_HAS_DFSAN)
12+
list(APPEND LIBFUZZER_TEST_DEPS dfsan)
13+
endif()
214
if (NOT COMPILER_RT_STANDALONE_BUILD)
3-
list(APPEND LIBFUZZER_TEST_DEPS fuzzer asan ubsan)
4-
if (COMPILER_RT_HAS_MSAN)
5-
list(APPEND LIBFUZZER_TEST_DEPS msan)
6-
endif()
7-
if (COMPILER_RT_HAS_DFSAN)
8-
list(APPEND LIBFUZZER_TEST_DEPS dfsan)
9-
endif()
1015
if(NOT APPLE AND COMPILER_RT_HAS_LLD AND "lld" IN_LIST LLVM_ENABLE_PROJECTS)
1116
list(APPEND LIBFUZZER_TEST_DEPS lld)
1217
endif()

compiler-rt/test/memprof/CMakeLists.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,9 @@ macro(get_bits_for_arch arch bits)
1111
endif()
1212
endmacro()
1313

14-
set(MEMPROF_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
15-
if(NOT COMPILER_RT_STANDALONE_BUILD)
16-
list(APPEND MEMPROF_TEST_DEPS memprof)
17-
if(COMPILER_RT_HAS_LLD AND TARGET lld)
18-
list(APPEND MEMPROF_TEST_DEPS lld)
19-
endif()
14+
set(MEMPROF_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS} memprof)
15+
if(NOT COMPILER_RT_STANDALONE_BUILD AND COMPILER_RT_HAS_LLD AND TARGET lld)
16+
list(APPEND MEMPROF_TEST_DEPS lld)
2017
endif()
2118
set(MEMPROF_DYNAMIC_TEST_DEPS ${MEMPROF_TEST_DEPS})
2219

compiler-rt/test/msan/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
set(MSAN_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
22

33
set(MSAN_TESTSUITES)
4-
set(MSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
4+
set(MSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS} msan)
55

66
set(MSAN_TEST_ARCH ${MSAN_SUPPORTED_ARCH})
77
if(APPLE)
@@ -41,10 +41,6 @@ foreach(arch ${MSAN_TEST_ARCH})
4141
endif()
4242
endforeach()
4343

44-
if(NOT COMPILER_RT_STANDALONE_BUILD)
45-
list(APPEND MSAN_TEST_DEPS msan)
46-
endif()
47-
4844
if(COMPILER_RT_INCLUDE_TESTS AND
4945
COMPILER_RT_LIBCXX_PATH AND
5046
COMPILER_RT_LIBCXXABI_PATH)

compiler-rt/test/ubsan/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ macro(add_ubsan_testsuite test_mode sanitizer arch lld thinlto)
2323
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
2424
${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py)
2525
list(APPEND UBSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
26-
if(NOT COMPILER_RT_STANDALONE_BUILD)
27-
list(APPEND UBSAN_TEST_DEPS ${sanitizer})
28-
endif()
26+
list(APPEND UBSAN_TEST_DEPS ${sanitizer})
2927
endmacro()
3028

3129
macro(add_ubsan_testsuites test_mode sanitizer arch)

compiler-rt/test/xray/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ set(XRAY_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
33
set(XRAY_TESTSUITES)
44
set(XRAY_FDR_TESTSUITES)
55

6-
set(XRAY_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
7-
set(XRAY_FDR_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
6+
set(XRAY_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS} xray)
87

98
if(NOT COMPILER_RT_STANDALONE_BUILD AND COMPILER_RT_BUILD_XRAY AND
109
COMPILER_RT_HAS_XRAY)
11-
list(APPEND XRAY_TEST_DEPS xray llvm-xray)
10+
list(APPEND XRAY_TEST_DEPS llvm-xray)
1211
endif()
1312

1413
set(XRAY_TEST_ARCH ${XRAY_SUPPORTED_ARCH})

0 commit comments

Comments
 (0)