File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -1964,10 +1964,14 @@ impl<'a> Builder<'a> {
1964
1964
rustflags. arg ( "-Ccontrol-flow-guard" ) ;
1965
1965
}
1966
1966
1967
- // Same for EHCont Guard (this is not combined with the previous if-statement to make
1968
- // merges with upstream easier).
1967
+ // If EHCont Guard is enabled, pass the `-Zehcont-guard` flag to rustc when compiling the
1968
+ // standard library, since this might be linked into the final outputs produced by rustc.
1969
+ // Since this mitigation is only available on Windows, only enable it for the standard
1970
+ // library in case the compiler is run on a non-Windows platform.
1971
+ // This is not needed for stage 0 artifacts because these will only be used for building
1972
+ // the stage 1 compiler.
1969
1973
if cfg ! ( windows) && mode == Mode :: Std && self . config . ehcont_guard && compiler. stage >= 1 {
1970
- rustflags. arg ( "-Cehcont -guard" ) ;
1974
+ rustflags. arg ( "-Zehcont -guard" ) ;
1971
1975
}
1972
1976
1973
1977
// For `cargo doc` invocations, make rustdoc print the Rust version into the docs
You can’t perform that action at this time.
0 commit comments