@@ -137,11 +137,13 @@ Cargo _or_ Rust features can be used.
137
137
* Tracking Issue: [ #9426 ] ( https://github.com/rust-lang/cargo/issues/9426 )
138
138
* Original Pull Request: [ #7811 ] ( https://github.com/rust-lang/cargo/pull/7811 )
139
139
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
141
141
in build scripts:
142
142
143
143
* [ ` cargo:rustc-link-arg-bins=FLAG ` ] ( #rustc-link-arg-bins ) – Passes custom
144
144
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 ` .
145
147
* [ ` cargo:rustc-link-arg=FLAG ` ] ( #rustc-link-arg ) – Passes custom flags to a
146
148
linker for benchmarks, binaries, ` cdylib ` crates, examples, and tests.
147
149
@@ -155,6 +157,16 @@ to set a linker script or other linker options.
155
157
156
158
[ link-arg ] : ../../rustc/codegen-options/index.md#link-arg
157
159
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
+
158
170
<a id =" rustc-link-arg " ></a >
159
171
#### ` cargo:rustc-link-arg=FLAG `
160
172
0 commit comments