Skip to content

Commit 6a8328c

Browse files
committed
Move relro_level from CodegenOptions to DebuggingOptions
Signed-off-by: Johannes Löthberg <[email protected]>
1 parent ecf3f6d commit 6a8328c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/librustc/session/config.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -881,8 +881,6 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options,
881881
"disable the use of the redzone"),
882882
relocation_model: Option<String> = (None, parse_opt_string, [TRACKED],
883883
"choose the relocation model to use (rustc --print relocation-models for details)"),
884-
relro_level: Option<RelroLevel> = (None, parse_relro_level, [TRACKED],
885-
"choose which RELRO level to use"),
886884
code_model: Option<String> = (None, parse_opt_string, [TRACKED],
887885
"choose the code model to use (rustc --print code-models for details)"),
888886
metadata: Vec<String> = (Vec::new(), parse_list, [TRACKED],
@@ -1057,6 +1055,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
10571055
"extra arguments to prepend to the linker invocation (space separated)"),
10581056
profile: bool = (false, parse_bool, [TRACKED],
10591057
"insert profiling code"),
1058+
relro_level: Option<RelroLevel> = (None, parse_relro_level, [TRACKED],
1059+
"choose which RELRO level to use"),
10601060
}
10611061

10621062
pub fn default_lib_output() -> CrateType {
@@ -2450,10 +2450,6 @@ mod tests {
24502450
opts.cg.relocation_model = Some(String::from("relocation model"));
24512451
assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());
24522452

2453-
opts = reference.clone();
2454-
opts.cg.relro_level = Some(RelroLevel::Full);
2455-
assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());
2456-
24572453
opts = reference.clone();
24582454
opts.cg.code_model = Some(String::from("code model"));
24592455
assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());
@@ -2602,5 +2598,9 @@ mod tests {
26022598
opts = reference.clone();
26032599
opts.debugging_opts.mir_opt_level = 3;
26042600
assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());
2601+
2602+
opts = reference.clone();
2603+
opts.debugging_opts.relro_level = Some(RelroLevel::Full);
2604+
assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());
26052605
}
26062606
}

src/librustc_trans/back/link.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,7 @@ fn link_args(cmd: &mut Linker,
10291029
}
10301030
}
10311031

1032-
let relro_level = match sess.opts.cg.relro_level {
1032+
let relro_level = match sess.opts.debugging_opts.relro_level {
10331033
Some(level) => level,
10341034
None => t.options.relro_level,
10351035
};

0 commit comments

Comments
 (0)