Skip to content

Commit 3ac75ee

Browse files
authored
Revert "[runtimes] Allow building against an installed LLVM tree" (#113920)
Reverts #86209 This patch breaks running tests locally, which is extremely disruptive to libc++ development.
1 parent c9f01f6 commit 3ac75ee

File tree

4 files changed

+10
-30
lines changed

4 files changed

+10
-30
lines changed

compiler-rt/cmake/Modules/AddCompilerRT.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,6 @@ function(configure_compiler_rt_lit_site_cfg input output)
773773

774774
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} COMPILER_RT_RESOLVED_TEST_COMPILER ${COMPILER_RT_TEST_COMPILER})
775775
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} COMPILER_RT_RESOLVED_OUTPUT_DIR ${COMPILER_RT_OUTPUT_DIR})
776-
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} COMPILER_RT_RESOLVED_EXEC_OUTPUT_DIR ${COMPILER_RT_EXEC_OUTPUT_DIR})
777776
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} COMPILER_RT_RESOLVED_LIBRARY_OUTPUT_DIR ${output_dir})
778777

779778
configure_lit_site_cfg(${input} ${output})

compiler-rt/test/hwasan/lit.cfg.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
import os
44

5-
from lit.llvm import llvm_config
6-
from lit.llvm.subst import ToolSubst, FindTool
7-
85
# Setup config name.
96
config.name = "HWAddressSanitizer" + getattr(config, "name_suffix", "default")
107

@@ -77,12 +74,6 @@ def build_invocation(compile_flags):
7774
("%env_hwasan_opts=", "env HWASAN_OPTIONS=" + default_hwasan_opts_str)
7875
)
7976

80-
# Ensure that we can use hwasan_symbolize from the expected location
81-
llvm_config.add_tool_substitutions(
82-
[ToolSubst("hwasan_symbolize", unresolved="fatal")],
83-
search_dirs=[config.compiler_rt_bindir],
84-
)
85-
8677
# Default test suffixes.
8778
config.suffixes = [".c", ".cpp"]
8879

compiler-rt/test/lit.common.configured.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ set_default("python_executable", "@Python3_EXECUTABLE@")
2828
set_default("compiler_rt_debug", @COMPILER_RT_DEBUG_PYBOOL@)
2929
set_default("compiler_rt_intercept_libdispatch", @COMPILER_RT_INTERCEPT_LIBDISPATCH_PYBOOL@)
3030
set_default("compiler_rt_output_dir", "@COMPILER_RT_RESOLVED_OUTPUT_DIR@")
31-
set_default("compiler_rt_bindir", "@COMPILER_RT_RESOLVED_EXEC_OUTPUT_DIR@")
3231
set_default("compiler_rt_libdir", "@COMPILER_RT_RESOLVED_LIBRARY_OUTPUT_DIR@")
3332
set_default("emulator", "@COMPILER_RT_EMULATOR@")
3433
set_default("asan_shadow_scale", "@COMPILER_RT_ASAN_SHADOW_SCALE@")

runtimes/CMakeLists.txt

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -239,23 +239,6 @@ foreach(entry ${runtimes})
239239
endforeach()
240240

241241
if(LLVM_INCLUDE_TESTS)
242-
# If built with the runtimes build (rooted at runtimes/CMakeLists.txt), we
243-
# won't have llvm-lit. If built with the bootstrapping build (rooted at
244-
# llvm/CMakeLists.txt), the top-level llvm CMake invocation already generated
245-
# the llvm-lit script.
246-
if (NOT HAVE_LLVM_LIT)
247-
# Add lit before adding any runtimes since their CMake tests configuration
248-
# might depend on lit being present.
249-
set(LLVM_LIT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin)
250-
add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/llvm-lit
251-
${CMAKE_CURRENT_BINARY_DIR}/llvm-lit)
252-
# Ensure that the testsuites use the local lit rather than
253-
# ${LLVM_INSTALL_DIR}/bin/llvm-lit (which may not exist if LLVM_BINARY_DIR
254-
# points at an installed LLVM tree rather than a build tree).
255-
get_llvm_lit_path(_base_dir _file_name)
256-
set(LLVM_EXTERNAL_LIT "${_base_dir}/${_file_name}" CACHE STRING "Command used to spawn lit" FORCE)
257-
endif()
258-
259242
set(LIT_ARGS_DEFAULT "-sv --show-xfail --show-unsupported")
260243
if (MSVC OR XCODE)
261244
set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
@@ -289,6 +272,14 @@ if(LLVM_INCLUDE_TESTS)
289272
# and we know the total set of lit testsuites.
290273
umbrella_lit_testsuite_end(check-runtimes)
291274

275+
if (NOT HAVE_LLVM_LIT)
276+
# If built by manually invoking cmake on this directory, we don't have
277+
# llvm-lit. If invoked via llvm/runtimes, the toplevel llvm cmake
278+
# invocation already generated the llvm-lit script.
279+
add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/llvm-lit
280+
${CMAKE_CURRENT_BINARY_DIR}/llvm-lit)
281+
endif()
282+
292283
get_property(LLVM_RUNTIMES_LIT_TESTSUITES GLOBAL PROPERTY LLVM_RUNTIMES_LIT_TESTSUITES)
293284
string(REPLACE ";" "\n" LLVM_RUNTIMES_LIT_TESTSUITES "${LLVM_RUNTIMES_LIT_TESTSUITES}")
294285
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/lit.tests ${LLVM_RUNTIMES_LIT_TESTSUITES})
@@ -318,10 +309,10 @@ if(SUB_COMPONENTS)
318309
if(LLVM_RUNTIMES_TARGET)
319310
configure_file(
320311
${CMAKE_CURRENT_SOURCE_DIR}/Components.cmake.in
321-
${CMAKE_CURRENT_BINARY_DIR}/runtimes/${LLVM_RUNTIMES_TARGET}/Components.cmake)
312+
${LLVM_BINARY_DIR}/runtimes/${LLVM_RUNTIMES_TARGET}/Components.cmake)
322313
else()
323314
configure_file(
324315
${CMAKE_CURRENT_SOURCE_DIR}/Components.cmake.in
325-
${CMAKE_CURRENT_BINARY_DIR}/runtimes/Components.cmake)
316+
${LLVM_BINARY_DIR}/runtimes/Components.cmake)
326317
endif()
327318
endif()

0 commit comments

Comments
 (0)