Add -Zstack-protector-guard target modifier - #159165
Conversation
|
Thanks for the pull request, and welcome! The Rust Project is excited to review your changes, and you should hear from @chenyukang (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
55ce98f to
f9353d7
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Equivalent to Clang's `-mstack-protector-guard=*`. Allows configuring how the stack canary is accessed (global, TLS, or system register), which must be consistent across the crate graph.
f9353d7 to
d9c1148
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@rustbot reroll |
|
☔ The latest upstream changes (presumably #160284) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
Add a new unstable
-Z stack-protector-guardtarget modifier toconfigure how the stack canary is accessed, equivalent to Clang's
-mstack-protector-guard=*options.Usage:
-Z stack-protector-guard=<mode>[,offset=N][,reg=R][,symbol=S]This is needed by Rust-for-Linux to support per-task stack canary
(
CONFIG_STACKPROTECTOR_PER_TASK), where the canary is stored in aper-task location rather than a global
__stack_chk_guardvariable.MCP: rust-lang/compiler-team#1013
Zulip: https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/-Z.20stack-protector-guard.20flags