[compiler-rt] e78208f - [compiler-rt][lit] initialize LIT LLVMConfig instance

Yuanfang Chen via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 22 16:36:51 PDT 2022


Author: Yuanfang Chen
Date: 2022-08-22T16:36:39-07:00
New Revision: e78208f082f0a0be19d343295c055a1924aede55

URL: https://github.com/llvm/llvm-project/commit/e78208f082f0a0be19d343295c055a1924aede55
DIFF: https://github.com/llvm/llvm-project/commit/e78208f082f0a0be19d343295c055a1924aede55.diff

LOG: [compiler-rt][lit] initialize LIT LLVMConfig instance

to handle lit tools searching. Otherwise
compiler-rt depends on system environment variable PATH for lit tools
which diverge from the other LLVM projects. This reverts D83486 which
really should be implemented in LIT itself when the PATH is constructed.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D122837

Added: 
    

Modified: 
    compiler-rt/test/lit.common.cfg.py
    compiler-rt/test/lit.common.configured.in

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/lit.common.cfg.py b/compiler-rt/test/lit.common.cfg.py
index d8c739f7cf056..21eba8c73eeb1 100644
--- a/compiler-rt/test/lit.common.cfg.py
+++ b/compiler-rt/test/lit.common.cfg.py
@@ -172,8 +172,6 @@ def get_path_from_clang(args, allow_failure):
 if config.memprof_shadow_scale != '':
   config.target_cflags += " -mllvm -memprof-mapping-scale=" + config.memprof_shadow_scale
 
-config.environment = dict(os.environ)
-
 # Clear some environment variables that might affect Clang.
 possibly_dangerous_env_vars = ['ASAN_OPTIONS', 'DFSAN_OPTIONS', 'HWASAN_OPTIONS',
                                'LSAN_OPTIONS', 'MSAN_OPTIONS', 'UBSAN_OPTIONS',

diff  --git a/compiler-rt/test/lit.common.configured.in b/compiler-rt/test/lit.common.configured.in
index 5db6ef0121fbe..2546798033f0f 100644
--- a/compiler-rt/test/lit.common.configured.in
+++ b/compiler-rt/test/lit.common.configured.in
@@ -18,6 +18,7 @@ set_default("compiler_rt_src_root", "@COMPILER_RT_SOURCE_DIR@")
 set_default("compiler_rt_obj_root", "@COMPILER_RT_BINARY_DIR@")
 set_default("enable_per_target_runtime_dir", @LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_PYBOOL@)
 set_default("llvm_tools_dir", "@LLVM_TOOLS_DIR@")
+set_default("lit_tools_dir", "@LLVM_LIT_TOOLS_DIR@")
 set_default("llvm_shlib_dir", "@LLVM_LIBRARY_OUTPUT_INTDIR@")
 set_default("gnu_ld_executable", "@GNU_LD_EXECUTABLE@")
 set_default("gold_executable", "@GOLD_EXECUTABLE@")
@@ -76,5 +77,8 @@ config.compiler_rt_libdir = lit_config.substitute(config.compiler_rt_libdir)
 if not os.path.exists(config.clang):
   lit_config.fatal("Can't find compiler on path %r" % config.clang)
 
+import lit.llvm
+lit.llvm.initialize(lit_config, config)
+
 # Setup attributes common for all compiler-rt projects.
 lit_config.load_config(config, "@COMPILER_RT_SOURCE_DIR@/test/lit.common.cfg.py")


        


More information about the llvm-commits mailing list