convert ehcont-guard to an unstable option

This commit is contained in:
Arlie Davis 2023-11-21 14:24:23 -08:00
parent d582f1092b
commit 9429d68842
4 changed files with 6 additions and 5 deletions

View File

@ -350,8 +350,9 @@ pub unsafe fn create_module<'ll>(
1,
);
}
// Set module flag to enable Windows EHCont Guard (/guard:ehcont).
if sess.opts.cg.ehcont_guard {
if sess.opts.unstable_opts.ehcont_guard {
llvm::LLVMRustAddModuleFlag(
llmod,
llvm::LLVMModFlagBehavior::Warning,

View File

@ -2379,7 +2379,7 @@ fn add_order_independent_options(
}
// OBJECT-FILES-NO, AUDIT-ORDER
if sess.opts.cg.ehcont_guard {
if sess.opts.unstable_opts.ehcont_guard {
cmd.ehcont_guard();
}

View File

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

View File

@ -1,4 +1,4 @@
// compile-flags: -C ehcont_guard
// compile-flags: -Z ehcont-guard
#![crate_type = "lib"]