mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 00:46:05 +00:00

When LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=on Asan-i386-calls-Dynamic-Test and Asan-i386-inline-Dynamic-Test fail to run on a x86_64 host. This is because asan's unit test lit files are configured once, rather than per target arch as with the non-unit tests. LD_LIBRARY_PATH ends up incorrect, and the tests try linking against the x86_64 runtime which fails. This changes the unit test CMake machinery to configure the default and dynamic unit tests once per target arch, similar to the other asan tests. Then the fix from https://reviews.llvm.org/D108859 is adapted to the unit test Lit files with some modifications. Fixes PR52158. Differential Revision: https://reviews.llvm.org/D111756
30 lines
1.3 KiB
Plaintext
30 lines
1.3 KiB
Plaintext
@LIT_SITE_CFG_IN_HEADER@
|
|
|
|
# Generic config options for all compiler-rt unit tests.
|
|
config.target_triple = "@TARGET_TRIPLE@"
|
|
config.llvm_src_root = "@LLVM_MAIN_SRC_DIR@"
|
|
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
|
|
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
|
|
config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
|
|
config.compiler_rt_libdir = "@COMPILER_RT_RESOLVED_LIBRARY_OUTPUT_DIR@"
|
|
config.enable_per_target_runtime_dir = @LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_PYBOOL@
|
|
config.llvm_build_mode = "@LLVM_BUILD_MODE@"
|
|
config.host_arch = "@HOST_ARCH@"
|
|
config.host_os = "@HOST_OS@"
|
|
config.llvm_lib_dir = "@LLVM_LIBRARY_DIR@"
|
|
config.gwp_asan = @COMPILER_RT_HAS_GWP_ASAN_PYBOOL@
|
|
config.emulator = "@COMPILER_RT_EMULATOR@"
|
|
|
|
# LLVM tools dir and build mode can be passed in lit parameters,
|
|
# so try to apply substitution.
|
|
try:
|
|
config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params
|
|
config.compiler_rt_libdir = config.compiler_rt_libdir % lit_config.params
|
|
config.llvm_build_mode = config.llvm_build_mode % lit_config.params
|
|
except KeyError as e:
|
|
key, = e.args
|
|
lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key))
|
|
|
|
# Setup attributes common for all compiler-rt unit tests.
|
|
lit_config.load_config(config, "@COMPILER_RT_SOURCE_DIR@/unittests/lit.common.unit.cfg.py")
|