Skip to content

Commit 7aa10e6

Browse files
committed
make link_args use spaces as separators
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'.
1 parent 89377ea commit 7aa10e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc/driver/driver.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ pub fn build_session_options(binary: @~str,
653653
654654
let linker_args = getopts::opt_strs(matches, ~"link-args").flat_map( |a| {
655655
let mut args = ~[];
656-
for str::each_split_char(*a, ',') |arg| {
656+
for str::each_split_char(*a, ' ') |arg| {
657657
args.push(str::from_slice(arg));
658658
}
659659
args
@@ -760,7 +760,7 @@ pub fn optgroups() -> ~[getopts::groups::OptGroup] {
760760
optmulti("L", "", "Add a directory to the library search path",
761761
"PATH"),
762762
optflag("", "lib", "Compile a library crate"),
763-
optmulti("", "link-args", "FLAGS is a comma-separated list of flags
763+
optmulti("", "link-args", "FLAGS is a space-separated list of flags
764764
passed to the linker", "FLAGS"),
765765
optflag("", "ls", "List the symbols defined by a library crate"),
766766
optflag("", "no-trans",

0 commit comments

Comments
 (0)