Index: compiler-rt/test/lit.common.cfg.py =================================================================== --- compiler-rt/test/lit.common.cfg.py +++ compiler-rt/test/lit.common.cfg.py @@ -520,8 +520,11 @@ config.available_features.add("has_sancovcc") config.substitutions.append( ("%sancovcc ", sancovcc_path) ) +def liblto_path(): + return os.path.join(config.llvm_shlib_dir, 'libLTO.dylib') + def is_darwin_lto_supported(): - return os.path.exists(os.path.join(config.llvm_shlib_dir, 'libLTO.dylib')) + return os.path.exists(liblto_path()) def is_binutils_lto_supported(): if not os.path.exists(os.path.join(config.llvm_shlib_dir, 'LLVMgold.so')): @@ -543,8 +546,7 @@ if config.host_os == 'Darwin' and is_darwin_lto_supported(): config.lto_supported = True - config.lto_launch = ["env", "DYLD_LIBRARY_PATH=" + config.llvm_shlib_dir] - config.lto_flags = [] + config.lto_flags = [ '-Wl,-lto_library,' + liblto_path() ] elif config.host_os in ['Linux', 'FreeBSD', 'NetBSD']: config.lto_supported = False if config.use_lld: @@ -554,14 +556,12 @@ config.lto_supported = True if config.lto_supported: - config.lto_launch = [] if config.use_lld: config.lto_flags = ["-fuse-ld=lld"] else: config.lto_flags = ["-fuse-ld=gold"] elif config.host_os == 'Windows' and is_windows_lto_supported(): config.lto_supported = True - config.lto_launch = [] config.lto_flags = ["-fuse-ld=lld"] else: config.lto_supported = False @@ -692,7 +692,6 @@ extra_cflags = [] if config.use_lto and config.lto_supported: - run_wrapper += config.lto_launch extra_cflags += config.lto_flags elif config.use_lto and (not config.lto_supported): config.unsupported = True Index: compiler-rt/test/profile/lit.cfg.py =================================================================== --- compiler-rt/test/profile/lit.cfg.py +++ compiler-rt/test/profile/lit.cfg.py @@ -44,11 +44,9 @@ def build_invocation(compile_flags, with_lto = False): lto_flags = [] - lto_prefix = [] if with_lto and config.lto_supported: lto_flags += config.lto_flags - lto_prefix += config.lto_launch - return " " + " ".join(lto_prefix + [config.clang] + lto_flags + compile_flags) + " " + return " " + " ".join([config.clang] + lto_flags + compile_flags) + " " def exclude_unsupported_files_for_aix(dirname): for filename in os.listdir(dirname): Index: compiler-rt/test/safestack/lit.cfg.py =================================================================== --- compiler-rt/test/safestack/lit.cfg.py +++ compiler-rt/test/safestack/lit.cfg.py @@ -16,7 +16,7 @@ config.substitutions.append( ("%clang_safestack ", config.clang + " -O0 -fsanitize=safe-stack ") ) if config.lto_supported: - config.substitutions.append((r"%clang_lto_safestack ", ' '.join(config.lto_launch + [config.clang] + config.lto_flags + ['-fsanitize=safe-stack ']))) + config.substitutions.append((r"%clang_lto_safestack ", ' '.join([config.clang] + config.lto_flags + ['-fsanitize=safe-stack ']))) if config.host_os not in ['Linux', 'FreeBSD', 'NetBSD']: config.unsupported = True