diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs index 83734c926ee..a5fa6c845bb 100644 --- a/src/librustc/session/config.rs +++ b/src/librustc/session/config.rs @@ -881,8 +881,6 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options, "disable the use of the redzone"), relocation_model: Option = (None, parse_opt_string, [TRACKED], "choose the relocation model to use (rustc --print relocation-models for details)"), - relro_level: Option = (None, parse_relro_level, [TRACKED], - "choose which RELRO level to use"), code_model: Option = (None, parse_opt_string, [TRACKED], "choose the code model to use (rustc --print code-models for details)"), metadata: Vec = (Vec::new(), parse_list, [TRACKED], @@ -1057,6 +1055,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options, "extra arguments to prepend to the linker invocation (space separated)"), profile: bool = (false, parse_bool, [TRACKED], "insert profiling code"), + relro_level: Option = (None, parse_relro_level, [TRACKED], + "choose which RELRO level to use"), } pub fn default_lib_output() -> CrateType { @@ -2450,10 +2450,6 @@ mod tests { opts.cg.relocation_model = Some(String::from("relocation model")); assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash()); - opts = reference.clone(); - opts.cg.relro_level = Some(RelroLevel::Full); - assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash()); - opts = reference.clone(); opts.cg.code_model = Some(String::from("code model")); assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash()); @@ -2602,5 +2598,9 @@ mod tests { opts = reference.clone(); opts.debugging_opts.mir_opt_level = 3; assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash()); + + opts = reference.clone(); + opts.debugging_opts.relro_level = Some(RelroLevel::Full); + assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash()); } } diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs index e4ef0c73c53..40f3e010928 100644 --- a/src/librustc_trans/back/link.rs +++ b/src/librustc_trans/back/link.rs @@ -1029,7 +1029,7 @@ fn link_args(cmd: &mut Linker, } } - let relro_level = match sess.opts.cg.relro_level { + let relro_level = match sess.opts.debugging_opts.relro_level { Some(level) => level, None => t.options.relro_level, };