Skip to content

Commit daffd0a

Browse files
committed
Add unstable docs for cargo:rustc-link-arg-bin=foo=--bar
1 parent 1607563 commit daffd0a

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/doc/src/reference/unstable.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,13 @@ Cargo _or_ Rust features can be used.
137137
* Tracking Issue: [#9426](https://github.com/rust-lang/cargo/issues/9426)
138138
* Original Pull Request: [#7811](https://github.com/rust-lang/cargo/pull/7811)
139139

140-
The `-Z extra-link-arg` flag makes the following two instructions available
140+
The `-Z extra-link-arg` flag makes the following instructions available
141141
in build scripts:
142142

143143
* [`cargo:rustc-link-arg-bins=FLAG`](#rustc-link-arg-bins) – Passes custom
144144
flags to a linker for binaries.
145+
* [`cargo:rustc-link-arg-bin=BIN=FLAG`](#rustc-link-arg-bin) – Passes custom
146+
flags to a linker for the binary `BIN`.
145147
* [`cargo:rustc-link-arg=FLAG`](#rustc-link-arg) – Passes custom flags to a
146148
linker for benchmarks, binaries, `cdylib` crates, examples, and tests.
147149

@@ -155,6 +157,16 @@ to set a linker script or other linker options.
155157

156158
[link-arg]: ../../rustc/codegen-options/index.md#link-arg
157159

160+
<a id="rustc-link-arg-bin"></a>
161+
#### `cargo:rustc-link-arg-bin=BIN=FLAG`
162+
163+
The `rustc-link-arg-bin` instruction tells Cargo to pass the [`-C
164+
link-arg=FLAG` option][link-arg] to the compiler, but only when building
165+
the binary target with name `BIN`. Its usage is highly platform specific. It is useful
166+
to set a linker script or other linker options.
167+
168+
[link-arg]: ../../rustc/codegen-options/index.md#link-arg
169+
158170
<a id="rustc-link-arg"></a>
159171
#### `cargo:rustc-link-arg=FLAG`
160172

0 commit comments

Comments
 (0)