Repository navigation
Fix LLD being mistaken for LD - #166273
LuigiPiucco wants to merge 1 commit into
Conversation
When the user sets just the linker to be used, we have to infer the LinkerFlavor from that. Because we do so from the result of .file_stem() on the linker path, if the file name is ld.lld, the .lld will be striped as if it were a file extension, and we get just ld being passed for inference. This fails to detect that the linker is LLD, causing certain conditionals that guard linker flags act wrongly (this was discovered while testing with AVR, which requires the emulation to be passed for GNU ld but breaks if passed for LLD).
|
r? @jackh726 rustbot has assigned @jackh726. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
This needs a test at minimum. But also generally this feels wrong to just silently change this. |
|
What I observed that made me write this PR is that, when the user requests a specific One additional thing I learned after opening the PR is that if Reproduction steps for "ld.lld" becoming just "ld"
println!("linker: {} != stem: {}", linker.display(), stem);
If there is further procedure I need to follow, more context I need to provide, or if there's a different course of action for this PR, I'm open to suggestions. |
When the user sets just the linker to be used, we have to infer the LinkerFlavor from that. Because we do so from the result of .file_stem() on the linker path, if the file name is ld.lld, the .lld will be striped as if it were a file extension, and we get just ld being passed for inference. This fails to detect that the linker is LLD, causing certain conditionals that guard linker flags act wrongly (this was discovered while testing with AVR, which requires the emulation to be passed for GNU LD but breaks if passed for LLD).