Skip to content

Commit

Permalink
make link_args use spaces as separators
Browse files Browse the repository at this point in the history
Lots of linking arguments need to be passed as -Wl,--foo so giving the
comma meaning at the rustc layer makes those flags impossible to pass.

Multiple arguments can now be passed from a shell by quoting the
argument: --link-args='-lfoo -Wl,--as-needed'.
  • Loading branch information
thestinger committed May 2, 2013
1 parent 89377ea commit 7aa10e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/librustc/driver/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ pub fn build_session_options(binary: @~str,

let linker_args = getopts::opt_strs(matches, ~"link-args").flat_map( |a| {
let mut args = ~[];
for str::each_split_char(*a, ',') |arg| {
for str::each_split_char(*a, ' ') |arg| {
args.push(str::from_slice(arg));
}
args
Expand Down Expand Up @@ -760,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("", "link-args", "FLAGS is a comma-separated list of flags
optmulti("", "link-args", "FLAGS is a space-separated list of flags
passed to the linker", "FLAGS"),
optflag("", "ls", "List the symbols defined by a library crate"),
optflag("", "no-trans",
Expand Down

5 comments on commit 7aa10e6

@bors
Copy link
Contributor

@bors bors commented on 7aa10e6 May 2, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 7aa10e6 May 2, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging thestinger/rust/link_args = 7aa10e6 into auto

@bors
Copy link
Contributor

@bors bors commented on 7aa10e6 May 2, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thestinger/rust/link_args = 7aa10e6 merged ok, testing candidate = 79a2b2e

@bors
Copy link
Contributor

@bors bors commented on 7aa10e6 May 3, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 7aa10e6 May 3, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding incoming to auto = 79a2b2e

Please sign in to comment.