-
Notifications
You must be signed in to change notification settings - Fork 13.4k
compiler: Use -T instead of --script for linker scripts #142445
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
base: master
Are you sure you want to change the base?
compiler: Use -T instead of --script for linker scripts #142445
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait, then why is it broken for them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Note that our run-make test suite uses
-T
and not--script
, interestingly enough:Fixes #127183