Skip to content

Commit eb4a510

Browse files
authored
[compiler-rt] Avoid assertions when using LLVM_ENABLE_PER_TARGET_RUNTIME_DIR (llvm#90127)
Previously, the memprof and ctx_profile lit.site.cfg would assert if the enable_per_target_runtime_dir was set and the config.target_arch != config.host_arch. However, config.host_arch would never be set, meaning this would always fail in a when using LLVM_ENABLE_PER_TARGET_RUNTIME_DIR. This patch follows the example in the ASAN lit.site.cfg.py that updates the compiler_rt_libdir appropriately.
1 parent 6473fbf commit eb4a510

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

compiler-rt/test/ctx_profile/Unit/lit.site.cfg.py.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ config.test_source_root = config.test_exec_root
2323
# host triple as the trailing path component. The value is incorrect for i386
2424
# tests on x86_64 hosts and vice versa. But, since only x86_64 is enabled as
2525
# target, and we don't support different environments for building and,
26-
# respectivelly, running tests, we shouldn't see this case.
27-
assert not config.enable_per_target_runtime_dir or config.target_arch == config.host_arch
26+
# respectively, running tests, we we only need to fix up the x86_64 case.
27+
if config.enable_per_target_runtime_dir and config.target_arch != config.host_arch:
28+
config.compiler_rt_libdir = re.sub(r'/i386(?=-[^/]+$)', '/x86_64', config.compiler_rt_libdir)

compiler-rt/test/memprof/Unit/lit.site.cfg.py.in

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ config.test_source_root = config.test_exec_root
2121
# When LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=on, the initial value of
2222
# config.compiler_rt_libdir (COMPILER_RT_RESOLVED_LIBRARY_OUTPUT_DIR) has the
2323
# host triple as the trailing path component. The value is incorrect for i386
24-
# tests on x86_64 hosts and vice versa. But, since only x86_64 is enabled as
24+
# tests on x86_64 hosts and vice versa. But, since only x86_64 is enabled as
2525
# target, and we don't support different environments for building and,
26-
# respectivelly, running tests, we shouldn't see this case.
27-
assert not config.enable_per_target_runtime_dir or config.target_arch == config.host_arch
26+
# respectively, running tests, we we only need to fix up the x86_64 case.
27+
if config.enable_per_target_runtime_dir and config.target_arch != config.host_arch:
28+
config.compiler_rt_libdir = re.sub(r'/i386(?=-[^/]+$)', '/x86_64', config.compiler_rt_libdir)
2829

2930
if not config.parallelism_group:
30-
config.parallelism_group = 'shadow-memory'
31+
config.parallelism_group = 'shadow-memory'

0 commit comments

Comments
 (0)