Skip to content

poor diagnostic for unsupported -fuse-ld=lld flag #140964

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

Open
Mark-Simulacrum opened this issue May 13, 2025 · 3 comments
Open

poor diagnostic for unsupported -fuse-ld=lld flag #140964

Mark-Simulacrum opened this issue May 13, 2025 · 3 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-linkers Area: linkers... you gotta love linkers

Comments

@Mark-Simulacrum
Copy link
Member

Mark-Simulacrum commented May 13, 2025

On older platforms (e.g., Amazon Linux 2 is where I encountered this), the current implementation of LLD-by-default in rustc leads to a tracing::warn! log line: https://github.com/rust-lang/rust/blob/dcecb99176edf2eec51613730937d21cdd5c8f6e/compiler/rustc_codegen_ssa/src/back/link.rs#L771C24-L771C54

The linker driver does not support `-fuse-ld=lld`. Retrying without it

This is at minimum a diagnostics bug, but I'm not sure the warning makes sense -- if we're not able to use LLD and have a well-supported fallback path, as long as the user isn't explicitly requesting LLD it seems plausible that a silent fallback is better than complaining noisily (and still falling back)?

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 13, 2025
@Mark-Simulacrum
Copy link
Member Author

cc @Kobzol (per offline discussion of this) -- my sense is this is probably not blocking for #140525 but would be worth considering whether we can silence / change the diagnostic away from tracing (so it at least doesn't show up from dependency links...).

@Kobzol Kobzol added A-diagnostics Area: Messages for errors, warnings, and lints A-linkers Area: linkers... you gotta love linkers labels May 13, 2025
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 13, 2025
@Kobzol Kobzol removed T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels May 13, 2025
@Kobzol
Copy link
Contributor

Kobzol commented May 13, 2025

Since we do support a range of Linux distributions, based on the minimal supported glibc version, I agree that LLD should work out of the box (without any weird warnings) on all of these distribution. And since some of these indeed seem to use too old GCC, we should IMO get rid of the error, at least in the case where we do use the default option. CC @lqd (happy to work on implementing this)

@lqd
Copy link
Member

lqd commented May 13, 2025

I don't know why these are warn!s instead of debug logs per se (maybe to nudge people into trying to update their gcc/linker?) but they are very old. Some of them are from 2017.

We can remove the warning from the -fuse-ld=lld case if you'd like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-linkers Area: linkers... you gotta love linkers
Projects
None yet
Development

No branches or pull requests

4 participants