Change flags to -Z print-link-args and --link-args

This commit is contained in:
James Miller 2013-04-30 20:05:16 +12:00
parent e75203ce82
commit 2deefbe847
2 changed files with 5 additions and 16 deletions
src/librustc/driver

@ -308,7 +308,7 @@ pub fn compile_rest(sess: Session,
};
if (sess.opts.output_info & session::out_link_args) > 0 {
if (sess.opts.debugging_opts & session::print_link_args) != 0 {
io::println(str::connect(link::link_args(sess,
&outputs.obj_filename, &outputs.out_filename, link_meta), " "));
}
@ -651,7 +651,7 @@ pub fn build_session_options(binary: @~str,
let addl_lib_search_paths = getopts::opt_strs(matches, ~"L").map(|s| Path(*s));
let linker_args = getopts::opt_strs(matches, ~"linker").flat_map( |a| {
let linker_args = getopts::opt_strs(matches, ~"link-args").flat_map( |a| {
let mut args = ~[];
for str::each_split_char(*a, ',') |arg| {
args.push(str::from_slice(arg));
@ -664,11 +664,6 @@ pub fn build_session_options(binary: @~str,
let android_cross_path = getopts::opt_maybe_str(
matches, ~"android-cross-path");
let mut output_info = 0;
if opt_present(matches, "print-link-args") {
output_info |= session::out_link_args;
}
let sopts = @session::options {
crate_type: crate_type,
is_static: static,
@ -691,7 +686,6 @@ pub fn build_session_options(binary: @~str,
parse_only: parse_only,
no_trans: no_trans,
debugging_opts: debugging_opts,
output_info: output_info,
android_cross_path: android_cross_path
};
return sopts;
@ -766,7 +760,7 @@ pub fn optgroups() -> ~[getopts::groups::OptGroup] {
optmulti("L", "", "Add a directory to the library search path",
"PATH"),
optflag("", "lib", "Compile a library crate"),
optmulti("", "linker", "FLAGS is a comma-separated list of flags
optmulti("", "link-args", "FLAGS is a comma-separated list of flags
passed to the linker", "FLAGS"),
optflag("", "ls", "List the symbols defined by a library crate"),
optflag("", "no-trans",
@ -787,8 +781,6 @@ pub fn optgroups() -> ~[getopts::groups::OptGroup] {
typed (crates expanded, with type annotations),
or identified (fully parenthesized,
AST nodes and blocks with IDs)", "TYPE"),
optflag("", "print-link-args", "Prints all the arguments that would be
passed to the linker."),
optflag("S", "", "Compile only; do not assemble or link"),
optflag("", "save-temps",
"Write intermediate files (.bc, .opt.bc, .o)

@ -63,6 +63,7 @@ pub static jit: uint = 1 << 19;
pub static debug_info: uint = 1 << 20;
pub static extra_debug_info: uint = 1 << 21;
pub static static: uint = 1 << 22;
pub static print_link_args: uint = 1 << 23;
pub fn debugging_opts_map() -> ~[(~str, ~str, uint)] {
~[(~"verbose", ~"in general, enable more debug printouts", verbose),
@ -90,6 +91,7 @@ pub fn debugging_opts_map() -> ~[(~str, ~str, uint)] {
(~"no-opt", ~"do not optimize, even if -O is passed", no_opt),
(~"no-monomorphic-collapse", ~"do not collapse template instantiations",
no_monomorphic_collapse),
(~"print-link-args", ~"Print the arguments passed to the linker", print_link_args),
(~"gc", ~"Garbage collect shared data (experimental)", gc),
(~"jit", ~"Execute using JIT (experimental)", jit),
(~"extra-debug-info", ~"Extra debugging info (experimental)",
@ -100,9 +102,6 @@ pub fn debugging_opts_map() -> ~[(~str, ~str, uint)] {
]
}
// Information output flags
pub static out_link_args : uint = 1 << 0;
#[deriving(Eq)]
pub enum OptLevel {
No, // -O0
@ -139,7 +138,6 @@ pub struct options {
parse_only: bool,
no_trans: bool,
debugging_opts: uint,
output_info: uint,
android_cross_path: Option<~str>
}
@ -314,7 +312,6 @@ pub fn basic_options() -> @options {
parse_only: false,
no_trans: false,
debugging_opts: 0u,
output_info: 0u,
android_cross_path: None
}
}