]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #36574 - japaric:link-arg, r=alexcrichton
authorJonathan Turner <jonathandturner@users.noreply.github.com>
Tue, 27 Sep 2016 00:29:47 +0000 (17:29 -0700)
committerGitHub <noreply@github.com>
Tue, 27 Sep 2016 00:29:47 +0000 (17:29 -0700)
rustc: implement -C link-arg

this flag lets you pass a _single_ argument to the linker but can be
used _repeatedly_. For example, instead of using:

```
rustc -C link-args='-l bar' (..)
```

you could write

```
rustc -C link-arg='-l' -C link-arg='bar' (..)
```

This new flag can be used with RUSTFLAGS where `-C link-args` has
problems with "nested" spaces:

```
RUSTFLAGS='-C link-args="-Tlayout.ld -nostartfiles"'
```

This passes three arguments to rustc: `-C` `link-args="-Tlayout.ld` and
`-nostartfiles"` to `rustc`. That's not what we meant. But this does
what we want:

```
RUSTFLAGS='-C link-arg=-Tlayout.ld -C link-arg=-nostartfiles`
```

cc rust-lang/rfcs#1509

r? @alexcrichton
cc @Zoxc

This needs a test. Any suggestion?

1  2 
src/librustc/session/config.rs
src/librustc_trans/back/link.rs

Simple merge
Simple merge