Description
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.