]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #41971 - japaric:pre-link-args, r=alexcrichton
authorMark Simulacrum <mark.simulacrum@gmail.com>
Fri, 19 May 2017 20:16:14 +0000 (14:16 -0600)
committerGitHub <noreply@github.com>
Fri, 19 May 2017 20:16:14 +0000 (14:16 -0600)
commit8292136fb0fd77aab00f28df7f6b1ae06c5167e9
treee503370eab830229d113e79fcfa219bb8215fd6f
parent04b07798fcc4344e19a5f88d9345c35091557405
parent94d2c43300148d5c0ea8c93cedb94151953dcf83
Rollup merge of #41971 - japaric:pre-link-args, r=alexcrichton

add -Z pre-link-arg{,s} to rustc

This PR adds two unstable flags to `rustc`: `-Z pre-link-arg` and `-Z
pre-link-args`. These are the counterpart of the existing `-C link-arg{,s}`
flags and can be used to pass extra arguments at the *beginning* of the linker
invocation, before the Rust object files are passed.

I have [started] a discussion on the rust-embedded RFCs repo about settling on a
convention for passing extra arguments to the linker and there are two options
on discussion: `.cargo/config`'s `target.$T.rustflags` and custom target
specification files (`{pre,,post}-link-args` fields). However, to compare these
two options on equal footing this `-Z pre-link-arg` feature is required.

[started]: https://github.com/rust-embedded/rfcs/pull/24

Therefore I'm requesting landing this `-Z pre-link-arg` flag as an experimental
feature to evaluate these two options.

cc @brson
r? @alexcrichton
src/librustc/session/config.rs
src/librustc_trans/back/link.rs