Skip to content

Commit 9429d68

Browse files
committed
convert ehcont-guard to an unstable option
1 parent d582f10 commit 9429d68

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

compiler/rustc_codegen_llvm/src/context.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,9 @@ pub unsafe fn create_module<'ll>(
350350
1,
351351
);
352352
}
353+
353354
// Set module flag to enable Windows EHCont Guard (/guard:ehcont).
354-
if sess.opts.cg.ehcont_guard {
355+
if sess.opts.unstable_opts.ehcont_guard {
355356
llvm::LLVMRustAddModuleFlag(
356357
llmod,
357358
llvm::LLVMModFlagBehavior::Warning,

compiler/rustc_codegen_ssa/src/back/link.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2379,7 +2379,7 @@ fn add_order_independent_options(
23792379
}
23802380

23812381
// OBJECT-FILES-NO, AUDIT-ORDER
2382-
if sess.opts.cg.ehcont_guard {
2382+
if sess.opts.unstable_opts.ehcont_guard {
23832383
cmd.ehcont_guard();
23842384
}
23852385

compiler/rustc_session/src/options.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1387,8 +1387,6 @@ options! {
13871387
"allow the linker to link its default libraries (default: no)"),
13881388
dlltool: Option<PathBuf> = (None, parse_opt_pathbuf, [UNTRACKED],
13891389
"import library generation tool (ignored except when targeting windows-gnu)"),
1390-
ehcont_guard: bool = (false, parse_bool, [TRACKED],
1391-
"generate Windows EHCont Guard tables"),
13921390
embed_bitcode: bool = (true, parse_bool, [TRACKED],
13931391
"emit bitcode in rlibs (default: yes)"),
13941392
extra_filename: String = (String::new(), parse_string, [UNTRACKED],
@@ -1584,6 +1582,8 @@ options! {
15841582
"version of DWARF debug information to emit (default: 2 or 4, depending on platform)"),
15851583
dylib_lto: bool = (false, parse_bool, [UNTRACKED],
15861584
"enables LTO for dylib crate type"),
1585+
ehcont_guard: bool = (false, parse_bool, [TRACKED],
1586+
"generate Windows EHCont Guard tables"),
15871587
emit_stack_sizes: bool = (false, parse_bool, [UNTRACKED],
15881588
"emit a section containing stack size metadata (default: no)"),
15891589
emit_thin_lto: bool = (true, parse_bool, [TRACKED],

tests/codegen/ehcontguard_enabled.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: -C ehcont_guard
1+
// compile-flags: -Z ehcont-guard
22

33
#![crate_type = "lib"]
44

0 commit comments

Comments
 (0)