compiler: Use -T instead of --script for linker scripts#142445
compiler: Use -T instead of --script for linker scripts#142445workingjubilee wants to merge 1 commit intorust-lang:mainfrom
Conversation
|
rustbot has assigned @WaffleLapkin. Use |
|
Some changes occurred in compiler/rustc_codegen_ssa |
| cmd.link_arg("--script").link_arg(path); | ||
| // "--script" feels nice and explicit, but -T is supported by gcc **and clang**. | ||
| // Amusingly, lld supports --script just fine, it's only clang that doesn't. | ||
| cmd.link_arg("-T").link_arg(path); |
There was a problem hiding this comment.
link_arg("-T") will emit -Wl,-T on command line, so it will go directly to linker and clang won't see it, so the explanation doesn't seem right.
There was a problem hiding this comment.
wait, then why is it broken for them?
There was a problem hiding this comment.
It must be something about building specifically for a custom target. Thanks for catching this, I'll take a closer look. This patch's code change might still be correct but it might be for a weird reason.
There was a problem hiding this comment.
gcc does not support --script either. I suspect the people in #127183 configured their target incorrectly such that cc was invoked with ld-style arguments
|
r? @petrochenkov |
|
I'm ok with using As I understand, this change only "fixes" something when the linker flavor is somehow messed up and ld-style options are passed to cc (#142445 (comment)). r=me with the comment removed. |
Note that our run-make test suite uses
-Tand not--script, interestingly enough:Fixes #127183