You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a bit of a longshot, and I'm not sure if it makes sense. When compiling with -C control-flow-guard=yes, it'd be really cool if C code build with cc-rs was automatically built with the equivalent flag (e.g. /guard:cf). This would allow projects to get an almost complete protection just by setting a variable in their .cargo/config file, instead of having to manually set the appropriate environment variable (which requires some kind of build orchestration tool on top of cargo to automatically set the variable, as I don't think cargo has any way to set environment variables on its own for the whole build?).
I'm not sure if this can be achieved in a practical way though. For one, I'm not entirely sure if build scripts have a reliable way of getting the target RUSTFLAGS, or otherwise knowing whether control-flow-guard is enabled.
The text was updated successfully, but these errors were encountered:
Sounds reasonable to me! I'd be happy to take a PR for this.
Perhaps the easiest way for us to detect this is if rustc set a #[cfg] when CFG is enabled, that way we could look for CARGO_CFG_* and see if it's enabled or not.
This is a bit of a longshot, and I'm not sure if it makes sense. When compiling with
-C control-flow-guard=yes
, it'd be really cool if C code build withcc-rs
was automatically built with the equivalent flag (e.g./guard:cf
). This would allow projects to get an almost complete protection just by setting a variable in their.cargo/config
file, instead of having to manually set the appropriate environment variable (which requires some kind of build orchestration tool on top of cargo to automatically set the variable, as I don't think cargo has any way to set environment variables on its own for the whole build?).I'm not sure if this can be achieved in a practical way though. For one, I'm not entirely sure if build scripts have a reliable way of getting the target RUSTFLAGS, or otherwise knowing whether control-flow-guard is enabled.
The text was updated successfully, but these errors were encountered: