diff --git a/bolt/test/lit.cfg.py b/bolt/test/lit.cfg.py --- a/bolt/test/lit.cfg.py +++ b/bolt/test/lit.cfg.py @@ -55,8 +55,10 @@ llvm_config.use_default_substitutions() -llvm_config.use_clang(additional_tool_dirs=[os.path.dirname(config.bolt_clang)]) -llvm_config.use_lld(additional_tool_dirs=[os.path.dirname(config.bolt_lld)]) +llvm_config.config.environment['BOLT_CLANG_EXE'] = config.bolt_clang +llvm_config.config.environment['BOLT_LLD_EXE'] = config.bolt_lld +llvm_config.use_clang(search_env='BOLT_CLANG_EXE') +llvm_config.use_llvm_tool('lld', required=True, search_env='BOLT_LLD_EXE') config.substitutions.append(('%cflags', '-no-pie')) config.substitutions.append(('%cxxflags', '-no-pie')) diff --git a/llvm/utils/lit/lit/llvm/config.py b/llvm/utils/lit/lit/llvm/config.py --- a/llvm/utils/lit/lit/llvm/config.py +++ b/llvm/utils/lit/lit/llvm/config.py @@ -437,7 +437,7 @@ return tool def use_clang(self, additional_tool_dirs=[], additional_flags=[], - required=True, use_installed=False): + required=True, use_installed=False, search_env='CLANG'): """Configure the test suite to be able to invoke clang. Sets up some environment variables important to clang, locates a @@ -505,7 +505,7 @@ # Discover the 'clang' and 'clangcc' to use. self.config.clang = self.use_llvm_tool( - 'clang', search_env='CLANG', required=required, + 'clang', search_env=search_env, required=required, search_paths=paths, use_installed=use_installed) if self.config.clang: self.config.available_features.add('clang')