linker: Report linker flavors incompatible with the current target by petrochenkov · Pull Request #110807 · rust-lang/rust (original) (raw)
That seems fine under "common usage" and targets, right (even in cross- compilation cases) ?
Yes, the only cases of breakage I can imagine are 1) wrong -Clinker-flavor
is added accidentally and never used because no linking happens and 2) compile-fail tests in our own test suite.
Maybe we can do a perf run just to exercize the PR with a few real world crates with build scripts and proc-macros, in case rustc-perf has more coverage there than our tests in practice. (I wouldn’t really expect issues to be found per se)
I wouldn't expect any effect on performance, this is a cheap check that is performed once during compilation.
Did we ever consider the bpf/ptx linker flavors stable ?
I guess no?
But technically they could be specified with a stable compiler and non tier-3 targets in cases when no linking actually happens (e.g. producing a rlib).
But I wouldn't expect it to ever happen in practice, these are the only working linker flavors for bpf/ptx targets respectively, you never need to specify them explicitly.