Control Flow Guard (CFG) on Windows stops working with -Copt-level=3
and without -Coverflow-checks=on
#135963
Labels
C-discussion
Category: Discussion or questions that doesn't represent real issues.
O-windows
Operating system: Windows
Expected behavior: Control Flow Guard (CFG) works regardless of whether
-Copt-level=3
and/or-Coverflow-checks=on
are presentActual behavior: CFG stops working with
-Copt-level=3
and without-Coverflow-checks=on
- see step 3 belowRepro steps:
Setup: get a Windows machine + install Rust via
rustup
Check compiler version:
Prepare the following source code that should trigger a Control Flow Guard:
Contents of `cfgtest.rs`
Compile without using
-Coverflow-checks=on
, but with-Copt-level=3
.eprintln!("failed");
Compile again, this time adding
-Coverflow-checks=on
.eprintln!("failed");
/cc @ajpaverd who has kindly worked on enabling CFG in #68793
PS. FWIW I've discovered this unexpected behavior when trying to remove
-Coverflow-checks=on
from Chromium build configuration in https://crrev.com/c/6176309. Removing this led to failures in Chromium's CFG tests: see https://ci.chromium.org/ui/p/chromium/bisection/test-analysis/b/4790699691081728 and https://ci.chromium.org/ui/p/chromium/builders/ci/win-rel-cft/7593/overview.The text was updated successfully, but these errors were encountered: