[compiler-rt] c467e60 - Check if LLD is built when checking if lto_supported (#92752)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 7 09:29:35 PDT 2024
Author: Jan Voung
Date: 2024-06-07T09:29:31-07:00
New Revision: c467e6097e7332b65f9390e7088cb7ae0116a8bb
URL: https://github.com/llvm/llvm-project/commit/c467e6097e7332b65f9390e7088cb7ae0116a8bb
DIFF: https://github.com/llvm/llvm-project/commit/c467e6097e7332b65f9390e7088cb7ae0116a8bb.diff
LOG: Check if LLD is built when checking if lto_supported (#92752)
Otherwise, older copies of LLD may not understand the latest bitcode
versions (for example, if we increase
`ModuleSummaryIndex::BitCodeSummaryVersion`)
Related to
https://github.com/llvm/llvm-project/pull/90692#issuecomment-2113250317
Added:
Modified:
compiler-rt/test/lit.common.cfg.py
Removed:
################################################################################
diff --git a/compiler-rt/test/lit.common.cfg.py b/compiler-rt/test/lit.common.cfg.py
index fae1d1686e569..64b9a9d025e7b 100644
--- a/compiler-rt/test/lit.common.cfg.py
+++ b/compiler-rt/test/lit.common.cfg.py
@@ -744,6 +744,13 @@ def is_binutils_lto_supported():
return True
+def is_lld_lto_supported():
+ # LLD does support LTO, but we require it to be built with the latest
+ # changes to claim support. Otherwise older copies of LLD may not
+ # understand new bitcode versions.
+ return os.path.exists(os.path.join(config.llvm_tools_dir, "lld"))
+
+
def is_windows_lto_supported():
if not target_is_msvc:
return True
@@ -755,7 +762,7 @@ def is_windows_lto_supported():
config.lto_flags = ["-Wl,-lto_library," + liblto_path()]
elif config.host_os in ["Linux", "FreeBSD", "NetBSD"]:
config.lto_supported = False
- if config.use_lld:
+ if config.use_lld and is_lld_lto_supported():
config.lto_supported = True
if is_binutils_lto_supported():
config.available_features.add("binutils_lto")
More information about the llvm-commits
mailing list