Skip to content

Check if LLD is built when checking if lto_supported #92752

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion compiler-rt/test/lit.common.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
Expand Down
Loading