Skip to content

Commit

Permalink
Move relro-level flag from debugging to codegen
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
  • Loading branch information
kyrias committed Feb 21, 2018
1 parent 27a046e commit 336484d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,8 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options,
"`-C save-temps` might not produce all requested temporary products \
when incremental compilation is enabled.")],
"save all temporary output files during compilation"),
relro_level: Option<RelroLevel> = (None, parse_relro_level, [TRACKED],
"choose which RELRO level to use"),
rpath: bool = (false, parse_bool, [UNTRACKED],
"set rpath values in libs/exes"),
overflow_checks: Option<bool> = (None, parse_opt_bool, [TRACKED],
Expand Down Expand Up @@ -1281,8 +1283,6 @@ 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"),
nll: bool = (false, parse_bool, [UNTRACKED],
"run the non-lexical lifetimes MIR pass"),
nll_dump_cause: bool = (false, parse_bool, [UNTRACKED],
Expand Down Expand Up @@ -2928,7 +2928,7 @@ mod tests {
assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());

opts = reference.clone();
opts.debugging_opts.relro_level = Some(RelroLevel::Full);
opts.cg.relro_level = Some(RelroLevel::Full);
assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());
}
}
2 changes: 1 addition & 1 deletion src/librustc_trans/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ fn link_args(cmd: &mut Linker,
}
}

let relro_level = match sess.opts.debugging_opts.relro_level {
let relro_level = match sess.opts.cg.relro_level {
Some(level) => level,
None => t.options.relro_level,
};
Expand Down

0 comments on commit 336484d

Please sign in to comment.