Skip to content

Commit

Permalink
[compiler-rt] Don't check COMPILER_RT_STANDALONE_BUILD for test deps
Browse files Browse the repository at this point in the history
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.

Reviewed By: vitalybuka

Pull Request: llvm#83651
  • Loading branch information
arichardson authored Mar 18, 2024
1 parent f4e90e3 commit ba2dc29
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 33 deletions.
3 changes: 2 additions & 1 deletion compiler-rt/cmake/Modules/CompilerRTCompile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ function(clang_compile object_file source)
cmake_parse_arguments(SOURCE "" "" "CFLAGS;DEPS" ${ARGN})
get_filename_component(source_rpath ${source} REALPATH)
if(NOT COMPILER_RT_STANDALONE_BUILD)
list(APPEND SOURCE_DEPS clang compiler-rt-headers)
list(APPEND SOURCE_DEPS clang)
endif()
list(APPEND SOURCE_DEPS compiler-rt-headers)
if (TARGET CompilerRTUnitTestCheckCxx)
list(APPEND SOURCE_DEPS CompilerRTUnitTestCheckCxx)
endif()
Expand Down
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 @@ -120,9 +120,7 @@ macro(add_msan_tests_for_arch arch kind cflags)
set(MSAN_TEST_DEPS ${MSAN_TEST_OBJECTS} libcxx_msan_${arch}-build
${MSAN_LOADABLE_SO}
"${MSAN_LIBCXX_DIR}/libc++.a" "${MSAN_LIBCXX_DIR}/libc++abi.a")
if(NOT COMPILER_RT_STANDALONE_BUILD)
list(APPEND MSAN_TEST_DEPS msan)
endif()
list(APPEND MSAN_TEST_DEPS msan)
get_target_flags_for_arch(${arch} TARGET_LINK_FLAGS)
add_compiler_rt_test(MsanUnitTests "Msan-${arch}${kind}-Test" ${arch}
OBJECTS ${MSAN_TEST_OBJECTS} "${MSAN_LIBCXX_DIR}/libc++.a" "${MSAN_LIBCXX_DIR}/libc++abi.a"
Expand Down
5 changes: 1 addition & 4 deletions compiler-rt/test/asan_abi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ macro(get_bits_for_arch arch bits)
endif()
endmacro()

set(ASAN_ABI_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
if(NOT COMPILER_RT_STANDALONE_BUILD)
list(APPEND ASAN_ABI_TEST_DEPS asan_abi)
endif()
set(ASAN_ABI_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS} asan_abi)

set(ASAN_ABI_TEST_ARCH ${ASAN_ABI_SUPPORTED_ARCH})
if(APPLE)
Expand Down
21 changes: 13 additions & 8 deletions compiler-rt/test/fuzzer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
set(LIBFUZZER_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
set(LIBFUZZER_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS} fuzzer)
if (COMPILER_RT_HAS_UBSAN)
list(APPEND LIBFUZZER_TEST_DEPS ubsan)
endif()
if (COMPILER_RT_HAS_ASAN)
list(APPEND LIBFUZZER_TEST_DEPS asan)
endif()
if (COMPILER_RT_HAS_MSAN)
list(APPEND LIBFUZZER_TEST_DEPS msan)
endif()
if (COMPILER_RT_HAS_DFSAN)
list(APPEND LIBFUZZER_TEST_DEPS dfsan)
endif()
if (NOT COMPILER_RT_STANDALONE_BUILD)
list(APPEND LIBFUZZER_TEST_DEPS fuzzer asan ubsan)
if (COMPILER_RT_HAS_MSAN)
list(APPEND LIBFUZZER_TEST_DEPS msan)
endif()
if (COMPILER_RT_HAS_DFSAN)
list(APPEND LIBFUZZER_TEST_DEPS dfsan)
endif()
if(NOT APPLE AND COMPILER_RT_HAS_LLD AND "lld" IN_LIST LLVM_ENABLE_PROJECTS)
list(APPEND LIBFUZZER_TEST_DEPS lld)
endif()
Expand Down
9 changes: 3 additions & 6 deletions compiler-rt/test/memprof/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@ macro(get_bits_for_arch arch bits)
endif()
endmacro()

set(MEMPROF_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
if(NOT COMPILER_RT_STANDALONE_BUILD)
list(APPEND MEMPROF_TEST_DEPS memprof)
if(COMPILER_RT_HAS_LLD AND TARGET lld)
list(APPEND MEMPROF_TEST_DEPS lld)
endif()
set(MEMPROF_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS} memprof)
if(NOT COMPILER_RT_STANDALONE_BUILD AND COMPILER_RT_HAS_LLD AND TARGET lld)
list(APPEND MEMPROF_TEST_DEPS lld)
endif()
set(MEMPROF_DYNAMIC_TEST_DEPS ${MEMPROF_TEST_DEPS})

Expand Down
6 changes: 1 addition & 5 deletions compiler-rt/test/msan/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set(MSAN_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})

set(MSAN_TESTSUITES)
set(MSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
set(MSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS} msan)

set(MSAN_TEST_ARCH ${MSAN_SUPPORTED_ARCH})
if(APPLE)
Expand Down Expand Up @@ -41,10 +41,6 @@ foreach(arch ${MSAN_TEST_ARCH})
endif()
endforeach()

if(NOT COMPILER_RT_STANDALONE_BUILD)
list(APPEND MSAN_TEST_DEPS msan)
endif()

if(COMPILER_RT_INCLUDE_TESTS AND
COMPILER_RT_LIBCXX_PATH AND
COMPILER_RT_LIBCXXABI_PATH)
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 @@ -23,9 +23,7 @@ macro(add_ubsan_testsuite test_mode sanitizer arch lld thinlto)
${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})
endmacro()

macro(add_ubsan_testsuites test_mode sanitizer arch)
Expand Down
5 changes: 2 additions & 3 deletions compiler-rt/test/xray/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ set(XRAY_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(XRAY_TESTSUITES)
set(XRAY_FDR_TESTSUITES)

set(XRAY_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
set(XRAY_FDR_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
set(XRAY_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS} xray)

if(NOT COMPILER_RT_STANDALONE_BUILD AND COMPILER_RT_BUILD_XRAY AND
COMPILER_RT_HAS_XRAY)
list(APPEND XRAY_TEST_DEPS xray llvm-xray)
list(APPEND XRAY_TEST_DEPS llvm-xray)
endif()

set(XRAY_TEST_ARCH ${XRAY_SUPPORTED_ARCH})
Expand Down

0 comments on commit ba2dc29

Please sign in to comment.