@@ -218,15 +218,22 @@ coverage measurement. Its use is not recommended.
218
218
219
219
## link-self-contained
220
220
221
- On ` windows-gnu ` , ` linux-musl ` , and ` wasi ` targets, this flag controls whether the
222
- linker will use libraries and objects shipped with Rust instead of those in the system.
223
- It takes one of the following values:
221
+ This flag controls whether the linker will use libraries and objects shipped with Rust instead
222
+ of those in the system. This allows overriding cases when detection fails or user wants to use shipped
223
+ libraries.
224
+
225
+ You can enable or disable the usage of any self-contained objects using one of the following values:
224
226
225
227
* no value: rustc will use heuristic to disable self-contained mode if system has necessary tools.
226
228
* ` y ` , ` yes ` , ` on ` , ` true ` : use only libraries/objects shipped with Rust.
227
229
* ` n ` , ` no ` , ` off ` or ` false ` : rely on the user or the linker to provide non-Rust libraries/objects.
228
230
229
- This allows overriding cases when detection fails or user wants to use shipped libraries.
231
+ It is also possible to enable or disable specific self-contained objects in a more granular way.
232
+ You can pass a comma-separated list of self-contained objects, individually enabled (` +object ` ) or
233
+ disabled (` -object ` ).
234
+
235
+ Currently, only the ` linker ` granular option is stabilized:
236
+ - ` linker ` : toggle the usage of self-contained linker objects (linker, dlltool, and their necessary libraries)
230
237
231
238
## linker
232
239
@@ -235,6 +242,20 @@ path to the linker executable. If this flag is not specified, the linker will
235
242
be inferred based on the target. See also the [ linker-flavor] ( #linker-flavor )
236
243
flag for another way to specify the linker.
237
244
245
+ ## linker-features
246
+
247
+ This flag allows enabling or disabling specific features used during linking.
248
+
249
+ The flag accepts a comma-separated list of features, individually enabled (` +feature ` ) or disabled
250
+ (` -feature ` ).
251
+
252
+ Currently, only one such feature is stable:
253
+ - ` lld ` : toggles the usage of the lld linker, either the system-installed binary, or the self-contained
254
+ ` rust-lld ` linker.
255
+
256
+ If you want to opt out of the usage of the ` lld ` linker (for targets where it is configured as the default linker),
257
+ use ` -Clinker-features=-lld ` .
258
+
238
259
## linker-flavor
239
260
240
261
This flag controls the linker flavor used by ` rustc ` . If a linker is given with
0 commit comments