sess: -Zbranch-protection is a target modifier#152909
sess: -Zbranch-protection is a target modifier#152909davidtwco wants to merge 1 commit intorust-lang:mainfrom
-Zbranch-protection is a target modifier#152909Conversation
`-Zbranch-protection` only makes sense if the entire crate graph has the option set, otherwise the security properties that branch protection provides won't be effective. This flag is unstable so I don't think this warrants an MCP.
|
r? @jackh726 rustbot has assigned @jackh726. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
I don't see a reason why we shouldn't compile the standard library with branch protection enabled to give users the ability to enable branch protection for their own executable without recompiling the standard library. There is no ABI constraint that prevents mixing. In fact hardware cfi extensions tend to use reuse instructions that were nops when cfi is disabled. An option would be to deny depending on libraries compiled without branch protection from a crate with it enabled, but not the other way around. Just like we do for mixing panic=abort and panic=unwind. |
-Zbranch-protectiononly makes sense if the entire crate graph has the option set, otherwise the security properties that branch protection provides won't be effective - hence a target modifier. This flag is unstable so I don't think this warrants an MCP.