-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Linker: use -z <params> instead of -z<params> #108307
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
Conversation
The GNU linker accepts -z<params>, but this is undocumented, and not supported by other linkers. In particular, `zig cc`, when used as the C compiler/linker (e.g. when using `cargo-zigbuild`), will not accept this undocumented syntax. In `linker.rs`, both syntaxes are also used inconsistently. The Go compiler used to have the same issue, but fixed it: golang/go@38607c5
r? @wesleywiser (rustbot has picked a reviewer for you, use r? to override) |
Thanks @jedisct1! I can't think of any reason we wouldn't want to use the documented syntax in this case, even if the current version works for ld/lld. Marking this as rollup=never to make it easier to bisect if there is fallout. |
@bors r+ rollup=never |
☀️ Test successful - checks-actions |
Finished benchmarking commit (246eae2): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
|
The GNU linker accepts -z, but this is undocumented, and not supported by other linkers.
In particular,
zig cc
, when used as the C compiler/linker (e.g. when usingcargo-zigbuild
), will not accept this undocumented syntax.In
linker.rs
, both syntaxes are also used inconsistently.The Go compiler used to have the same issue, but fixed it:
golang/go@38607c5