]> git.lizzy.rs Git - rust.git/commit
rustc: implement -C link-arg
authorJorge Aparicio <japaricious@gmail.com>
Mon, 19 Sep 2016 07:32:28 +0000 (02:32 -0500)
committerJorge Aparicio <japaricious@gmail.com>
Mon, 19 Sep 2016 07:48:08 +0000 (02:48 -0500)
commit9631e9f9b3ffcf98b2654eeee8c4dd5f3a2ca50c
treed3440baac928b78cc6251a064cbd1b5748d2644d
parentfb62f4d544c954d355716dca8beb55726036721e
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
src/librustc/session/config.rs
src/librustc_trans/back/link.rs