Move relro_level from CodegenOptions to DebuggingOptions
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
This commit is contained in:
parent
ecf3f6d4de
commit
6a8328cfa3
@ -881,8 +881,6 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options,
|
||||
"disable the use of the redzone"),
|
||||
relocation_model: Option<String> = (None, parse_opt_string, [TRACKED],
|
||||
"choose the relocation model to use (rustc --print relocation-models for details)"),
|
||||
relro_level: Option<RelroLevel> = (None, parse_relro_level, [TRACKED],
|
||||
"choose which RELRO level to use"),
|
||||
code_model: Option<String> = (None, parse_opt_string, [TRACKED],
|
||||
"choose the code model to use (rustc --print code-models for details)"),
|
||||
metadata: Vec<String> = (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<RelroLevel> = (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());
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user