Skip to content

Commit

Permalink
Change flags to -Z print-link-args and --link-args
Browse files Browse the repository at this point in the history
  • Loading branch information
James Miller committed Apr 30, 2013
1 parent e75203c commit 2deefbe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
14 changes: 3 additions & 11 deletions src/librustc/driver/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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), " "));
}
Expand Down Expand Up @@ -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));
Expand All @@ -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,
Expand All @@ -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;
Expand Down Expand Up @@ -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",
Expand All @@ -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)
Expand Down
7 changes: 2 additions & 5 deletions src/librustc/driver/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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)",
Expand All @@ -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
Expand Down Expand Up @@ -139,7 +138,6 @@ pub struct options {
parse_only: bool,
no_trans: bool,
debugging_opts: uint,
output_info: uint,
android_cross_path: Option<~str>
}

Expand Down Expand Up @@ -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
}
}
Expand Down

0 comments on commit 2deefbe

Please sign in to comment.