[compiler-rt] [compiler-rt] Avoid assertions when using LLVM_ENABLE_PER_TARGET_RUNTIME_DIR (PR #90127)

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 25 14:40:39 PDT 2024


================
@@ -21,7 +21,11 @@ config.test_source_root = config.test_exec_root
 # When LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=on, the initial value of
 # config.compiler_rt_libdir (COMPILER_RT_RESOLVED_LIBRARY_OUTPUT_DIR) has the
 # host triple as the trailing path component. The value is incorrect for i386
-# tests on x86_64 hosts and vice versa. But, since only x86_64 is enabled as
-# target, and we don't support different environments for building and,
-# respectivelly, running tests, we shouldn't see this case.
-assert not config.enable_per_target_runtime_dir or config.target_arch == config.host_arch
+# tests on x86_64 hosts and vice versa. Adjust config.compiler_rt_libdir
+# accordingly.
+if config.enable_per_target_runtime_dir and config.target_arch != config.host_arch:
----------------
mtrofin wrote:

I would prefer not having the general handling of asan, because we don't mean to be here for 32 bit anyway. so if `config.host_arch` is not set in your case, what's the rest - I assume config.target_arch is exactly x86_64 and then we could assert that and do the behavior on line 30?

https://github.com/llvm/llvm-project/pull/90127


More information about the llvm-commits mailing list