Skip to content

Commit 2deefbe

Browse files
author
James Miller
committed
Change flags to -Z print-link-args and --link-args
1 parent e75203c commit 2deefbe

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

src/librustc/driver/driver.rs

+3-11
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ pub fn compile_rest(sess: Session,
308308

309309
};
310310

311-
if (sess.opts.output_info & session::out_link_args) > 0 {
311+
if (sess.opts.debugging_opts & session::print_link_args) != 0 {
312312
io::println(str::connect(link::link_args(sess,
313313
&outputs.obj_filename, &outputs.out_filename, link_meta), " "));
314314
}
@@ -651,7 +651,7 @@ pub fn build_session_options(binary: @~str,
651651
652652
let addl_lib_search_paths = getopts::opt_strs(matches, ~"L").map(|s| Path(*s));
653653
654-
let linker_args = getopts::opt_strs(matches, ~"linker").flat_map( |a| {
654+
let linker_args = getopts::opt_strs(matches, ~"link-args").flat_map( |a| {
655655
let mut args = ~[];
656656
for str::each_split_char(*a, ',') |arg| {
657657
args.push(str::from_slice(arg));
@@ -664,11 +664,6 @@ pub fn build_session_options(binary: @~str,
664664
let android_cross_path = getopts::opt_maybe_str(
665665
matches, ~"android-cross-path");
666666
667-
let mut output_info = 0;
668-
if opt_present(matches, "print-link-args") {
669-
output_info |= session::out_link_args;
670-
}
671-
672667
let sopts = @session::options {
673668
crate_type: crate_type,
674669
is_static: static,
@@ -691,7 +686,6 @@ pub fn build_session_options(binary: @~str,
691686
parse_only: parse_only,
692687
no_trans: no_trans,
693688
debugging_opts: debugging_opts,
694-
output_info: output_info,
695689
android_cross_path: android_cross_path
696690
};
697691
return sopts;
@@ -766,7 +760,7 @@ pub fn optgroups() -> ~[getopts::groups::OptGroup] {
766760
optmulti("L", "", "Add a directory to the library search path",
767761
"PATH"),
768762
optflag("", "lib", "Compile a library crate"),
769-
optmulti("", "linker", "FLAGS is a comma-separated list of flags
763+
optmulti("", "link-args", "FLAGS is a comma-separated list of flags
770764
passed to the linker", "FLAGS"),
771765
optflag("", "ls", "List the symbols defined by a library crate"),
772766
optflag("", "no-trans",
@@ -787,8 +781,6 @@ pub fn optgroups() -> ~[getopts::groups::OptGroup] {
787781
typed (crates expanded, with type annotations),
788782
or identified (fully parenthesized,
789783
AST nodes and blocks with IDs)", "TYPE"),
790-
optflag("", "print-link-args", "Prints all the arguments that would be
791-
passed to the linker."),
792784
optflag("S", "", "Compile only; do not assemble or link"),
793785
optflag("", "save-temps",
794786
"Write intermediate files (.bc, .opt.bc, .o)

src/librustc/driver/session.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ pub static jit: uint = 1 << 19;
6363
pub static debug_info: uint = 1 << 20;
6464
pub static extra_debug_info: uint = 1 << 21;
6565
pub static static: uint = 1 << 22;
66+
pub static print_link_args: uint = 1 << 23;
6667

6768
pub fn debugging_opts_map() -> ~[(~str, ~str, uint)] {
6869
~[(~"verbose", ~"in general, enable more debug printouts", verbose),
@@ -90,6 +91,7 @@ pub fn debugging_opts_map() -> ~[(~str, ~str, uint)] {
9091
(~"no-opt", ~"do not optimize, even if -O is passed", no_opt),
9192
(~"no-monomorphic-collapse", ~"do not collapse template instantiations",
9293
no_monomorphic_collapse),
94+
(~"print-link-args", ~"Print the arguments passed to the linker", print_link_args),
9395
(~"gc", ~"Garbage collect shared data (experimental)", gc),
9496
(~"jit", ~"Execute using JIT (experimental)", jit),
9597
(~"extra-debug-info", ~"Extra debugging info (experimental)",
@@ -100,9 +102,6 @@ pub fn debugging_opts_map() -> ~[(~str, ~str, uint)] {
100102
]
101103
}
102104

103-
// Information output flags
104-
pub static out_link_args : uint = 1 << 0;
105-
106105
#[deriving(Eq)]
107106
pub enum OptLevel {
108107
No, // -O0
@@ -139,7 +138,6 @@ pub struct options {
139138
parse_only: bool,
140139
no_trans: bool,
141140
debugging_opts: uint,
142-
output_info: uint,
143141
android_cross_path: Option<~str>
144142
}
145143

@@ -314,7 +312,6 @@ pub fn basic_options() -> @options {
314312
parse_only: false,
315313
no_trans: false,
316314
debugging_opts: 0u,
317-
output_info: 0u,
318315
android_cross_path: None
319316
}
320317
}

0 commit comments

Comments
 (0)