@@ -9,10 +9,10 @@ This option is deprecated and does nothing.
9
9
10
10
## linker
11
11
12
- This flag lets you control which linker ` rustc ` invokes to link your code. It
13
- takes a path to the linker executable. If this flag is not specified, the
14
- linker will be inferred based on the target. See also the
15
- [ linker-flavor ] ( #linker-flavor ) flag for another way to specify the linker.
12
+ This flag controls which linker ` rustc ` invokes to link your code. It takes a
13
+ path to the linker executable. If this flag is not specified, the linker will
14
+ be inferred based on the target. See also the [ linker-flavor ] ( #linker-flavor )
15
+ flag for another way to specify the linker.
16
16
17
17
## link-arg
18
18
@@ -27,49 +27,52 @@ options should be separated by spaces.
27
27
28
28
## linker-flavor
29
29
30
- This flag lets you control the linker flavor used by ` rustc ` . If a linker is given with the
31
- [ ` -C linker ` flag] ( #linker ) , then the linker flavor is inferred from the value provided. If no
32
- linker is given then the linker flavor is used to determine the linker to use. Every ` rustc ` target
33
- defaults to some linker flavor. Valid options are:
34
-
35
- * ` em ` : Uses [ Emscripten ` emcc ` ] ( https://emscripten.org/docs/tools_reference/emcc.html ) .
36
- * ` gcc ` : Uses the ` cc ` executable, which is typically gcc or clang on many systems.
37
- * ` ld ` : Uses the ` ld ` executable.
38
- * ` msvc ` : Uses the ` link.exe ` executable from Microsoft Visual Studio MSVC.
39
- * ` ptx-linker ` : Uses
30
+ This flag controls the linker flavor used by ` rustc ` . If a linker is given with
31
+ the [ ` -C linker ` flag] ( #linker ) , then the linker flavor is inferred from the
32
+ value provided. If no linker is given then the linker flavor is used to
33
+ determine the linker to use. Every ` rustc ` target defaults to some linker
34
+ flavor. Valid options are:
35
+
36
+ * ` em ` : use [ Emscripten ` emcc ` ] ( https://emscripten.org/docs/tools_reference/emcc.html ) .
37
+ * ` gcc ` : use the ` cc ` executable, which is typically gcc or clang on many systems.
38
+ * ` ld ` : use the ` ld ` executable.
39
+ * ` msvc ` : use the ` link.exe ` executable from Microsoft Visual Studio MSVC.
40
+ * ` ptx-linker ` : use
40
41
[ ` rust-ptx-linker ` ] ( https://github.com/denzp/rust-ptx-linker ) for Nvidia
41
42
NVPTX GPGPU support.
42
- * ` wasm-ld ` : Uses the [ ` wasm-ld ` ] ( https://lld.llvm.org/WebAssembly.html )
43
+ * ` wasm-ld ` : use the [ ` wasm-ld ` ] ( https://lld.llvm.org/WebAssembly.html )
43
44
executable, a port of LLVM ` lld ` for WebAssembly.
44
- * ` ld64.lld ` : Uses the LLVM ` lld ` executable with the [ ` -flavor darwin `
45
+ * ` ld64.lld ` : use the LLVM ` lld ` executable with the [ ` -flavor darwin `
45
46
flag] [ lld-flavor ] for Apple's ` ld ` .
46
- * ` ld.lld ` : Uses the LLVM ` lld ` executable with the [ ` -flavor gnu `
47
+ * ` ld.lld ` : use the LLVM ` lld ` executable with the [ ` -flavor gnu `
47
48
flag] [ lld-flavor ] for GNU binutils' ` ld ` .
48
- * ` lld-link ` : Uses the LLVM ` lld ` executable with the [ ` -flavor link `
49
+ * ` lld-link ` : use the LLVM ` lld ` executable with the [ ` -flavor link `
49
50
flag] [ lld-flavor ] for Microsoft's ` link.exe ` .
50
51
51
52
[ lld-flavor ] : https://lld.llvm.org/Driver.html
52
53
53
54
## link-dead-code
54
55
55
- Normally, the linker will remove dead code. This flag disables this behavior.
56
+ This flag controls whether the linker will keep dead code. It takes one of
57
+ the following values:
58
+
59
+ * ` y ` , ` yes ` , ` on ` , or no value: keep dead code.
60
+ * ` n ` , ` no ` , or ` off ` : remove dead code (the default).
56
61
57
62
An example of when this flag might be useful is when trying to construct code coverage
58
63
metrics.
59
64
60
65
## lto
61
66
62
- This flag instructs LLVM to use [ link time
67
+ This flag controls whether LLVM uses [ link time
63
68
optimizations] ( https://llvm.org/docs/LinkTimeOptimization.html ) to produce
64
69
better optimized code, using whole-program analysis, at the cost of longer
65
- linking time.
66
-
67
- This flag may take one of the following values:
70
+ linking time. It takes one of the following values:
68
71
69
- * ` y ` , ` yes ` , ` on ` , ` fat ` , or no value: Performs "fat" LTO which attempts to
72
+ * ` y ` , ` yes ` , ` on ` , ` fat ` , or no value: perform "fat" LTO which attempts to
70
73
perform optimizations across all crates within the dependency graph.
71
- * ` n ` , ` no ` , ` off ` : Disables LTO.
72
- * ` thin ` : Performs [ "thin"
74
+ * ` n ` , ` no ` , ` off ` : disables LTO.
75
+ * ` thin ` : perform [ "thin"
73
76
LTO] ( http://blog.llvm.org/2016/06/thinlto-scalable-and-incremental-lto.html ) .
74
77
This is similar to "fat", but takes substantially less time to run while
75
78
still achieving performance gains similar to "fat".
@@ -81,22 +84,22 @@ disabled if codegen units is 1 or optimizations are disabled ([`-C
81
84
opt-level=0`] ( #opt-level ) ). That is:
82
85
83
86
* When ` -C lto ` is not specified:
84
- * ` codegen-units=1 ` : Disables LTO.
85
- * ` opt-level=0 ` : Disables LTO.
87
+ * ` codegen-units=1 ` : disable LTO.
88
+ * ` opt-level=0 ` : disable LTO.
86
89
* When ` -C lto=true ` :
87
- * ` lto=true ` : 16 codegen units, performs fat LTO across crates.
90
+ * ` lto=true ` : 16 codegen units, perform fat LTO across crates.
88
91
* ` codegen-units=1 ` + ` lto=true ` : 1 codegen unit, fat LTO across crates.
89
92
90
93
See also [ linker-plugin-lto] ( #linker-plugin-lto ) for cross-language LTO.
91
94
92
95
## linker-plugin-lto
93
96
94
- Defers LTO optimizations to the linker. See
95
- [ linkger -plugin-LTO] ( ../linker-plugin-lto.md ) for more details. Takes one of
97
+ This flag defers LTO optimizations to the linker. See
98
+ [ linker -plugin-LTO] ( ../linker-plugin-lto.md ) for more details. It takes one of
96
99
the following values:
97
100
98
- * ` y ` , ` yes ` , ` on ` , or no value: Enabled .
99
- * ` n ` , ` no ` , or ` off ` : Disabled ( default).
101
+ * ` y ` , ` yes ` , ` on ` , or no value: enable linker plugin LTO .
102
+ * ` n ` , ` no ` , or ` off ` : disable linker plugin LTO (the default).
100
103
* A path to the linker plugin.
101
104
102
105
## target-cpu
@@ -148,14 +151,19 @@ Pass `--help` to see a list of options.
148
151
149
152
## save-temps
150
153
151
- ` rustc ` will generate temporary files during compilation; normally it will
152
- delete them after it's done with its work. This option will cause them to be
153
- preserved instead of removed.
154
+ This flag controls whether temporary files generated during compilation are
155
+ deleted once compilation finishes. It takes one of the following values:
156
+
157
+ * ` y ` , ` yes ` , ` on ` , or no value: save temporary files.
158
+ * ` n ` , ` no ` , or ` off ` : delete temporary files (the default).
154
159
155
160
## rpath
156
161
157
- This option allows you to enable
158
- [ ` rpath ` ] ( https://en.wikipedia.org/wiki/Rpath ) .
162
+ This flag controls whether [ ` rpath ` ] ( https://en.wikipedia.org/wiki/Rpath ) is
163
+ enabled. It takes one of the following values:
164
+
165
+ * ` y ` , ` yes ` , ` on ` , or no value: enable rpath.
166
+ * ` n ` , ` no ` , or ` off ` : disable rpath (the default).
159
167
160
168
## overflow-checks
161
169
@@ -164,35 +172,46 @@ overflow](../../reference/expressions/operator-expr.md#overflow). When
164
172
overflow-checks are enabled, a panic will occur on overflow. This flag takes
165
173
one of the following values:
166
174
167
- * ` y ` , ` yes ` , ` on ` , or no value: Enable overflow checks.
168
- * ` n ` , ` no ` , or ` off ` : Disable overflow checks.
175
+ * ` y ` , ` yes ` , ` on ` , or no value: enable overflow checks.
176
+ * ` n ` , ` no ` , or ` off ` : disable overflow checks.
169
177
170
178
If not specified, overflow checks are enabled if
171
179
[ debug-assertions] ( #debug-assertions ) are enabled, disabled otherwise.
172
180
173
181
## no-prepopulate-passes
174
182
175
- The pass manager comes pre-populated with a list of passes; this flag
176
- ensures that list is empty.
183
+ This flag controls whether the pass manager uses a pre-populated list of
184
+ passes. It takes one of the following values:
185
+
186
+ * ` y ` , ` yes ` , ` on ` , or no value: use an empty list of passes.
187
+ * ` n ` , ` no ` , or ` off ` : use a pre-populated list of passes (the default).
177
188
178
189
## no-vectorize-loops
179
190
180
- By default, ` rustc ` will attempt to [ vectorize
181
- loops] ( https://llvm.org/docs/Vectorizers.html#the-loop-vectorizer ) . This
182
- flag will turn that behavior off.
191
+ This flag controls whether ` rustc ` will attempt to [ vectorize
192
+ loops] ( https://llvm.org/docs/Vectorizers.html#the-loop-vectorizer ) . It takes
193
+ one of the following values:
194
+
195
+ * ` y ` , ` yes ` , ` on ` , or no value: disable loop vectorization.
196
+ * ` n ` , ` no ` , or ` off ` : enable loop vectorization (the default).
183
197
184
198
## no-vectorize-slp
185
199
186
- By default, ` rustc ` will attempt to vectorize code using [ superword-level
187
- parallelism] ( https://llvm.org/docs/Vectorizers.html#the-slp-vectorizer ) . This
188
- flag will turn that behavior off.
200
+ This flag controls whether ` rustc ` will attempt to vectorize code using
201
+ [ superword-level
202
+ parallelism] ( https://llvm.org/docs/Vectorizers.html#the-slp-vectorizer ) .
203
+ It takes one of the following values:
204
+
205
+ * ` y ` , ` yes ` , ` on ` , or no value: disable SLP vectorization.
206
+ * ` n ` , ` no ` , or ` off ` : enable SLP vectorization (the default).
189
207
190
208
## soft-float
191
209
192
- This option will make ` rustc ` generate code using "soft floats." By default,
193
- a lot of hardware supports floating point instructions, and so the code generated
194
- will take advantage of this. "soft floats" emulate floating point instructions
195
- in software.
210
+ This option controls whether ` rustc ` generates code that emulates floating
211
+ point instructions in software. It takes one of the following values:
212
+
213
+ * ` y ` , ` yes ` , ` on ` , or no value: use soft floats.
214
+ * ` n ` , ` no ` , or ` off ` : use hardware floats (the default).
196
215
197
216
## prefer-dynamic
198
217
@@ -201,24 +220,21 @@ indicate that dynamic linking should be used if possible if both a static and
201
220
dynamic versions of a library are available. There is an internal algorithm
202
221
for determining whether or not it is possible to statically or dynamically
203
222
link with a dependency. For example, ` cdylib ` crate types may only use static
204
- linkage.
205
-
206
- ## no-integrated-as
223
+ linkage. This flag takes one of the following values:
207
224
208
- ` rustc ` normally uses the LLVM internal assembler to create object code. This
209
- flag will disable the internal assembler and emit assembly code to be
210
- translated using an external assembler, currently the linker such as ` cc ` .
225
+ * ` y ` , ` yes ` , ` on ` , or no value: use dynamic linking.
226
+ * ` n ` , ` no ` , or ` off ` : use static linking (the default).
211
227
212
228
## no-redzone
213
229
214
230
This flag allows you to disable [ the
215
- red zone] ( https://en.wikipedia.org/wiki/Red_zone_\( computing\) ) . This flag can
216
- be passed one of the following options :
231
+ red zone] ( https://en.wikipedia.org/wiki/Red_zone_\( computing\) ) . It takes one
232
+ of the following values :
217
233
218
- * ` y ` , ` yes ` , ` on ` , or no value: Disables the red zone.
219
- * ` n ` , ` no ` , or ` off ` : Enables the red zone.
234
+ * ` y ` , ` yes ` , ` on ` , or no value: disable the red zone.
235
+ * ` n ` , ` no ` , or ` off ` : enable the red zone.
220
236
221
- The default if not specified depends on the target.
237
+ The default behaviour, if the flag is not specified, depends on the target.
222
238
223
239
## relocation-model
224
240
@@ -257,7 +273,7 @@ them in parallel. Increasing parallelism may speed up compile times, but may
257
273
also produce slower code. Setting this to 1 may improve the performance of
258
274
generated code, but may be slower to compile.
259
275
260
- The default, if not specified, is 16 for non-incremental builds. For
276
+ The default value , if not specified, is 16 for non-incremental builds. For
261
277
incremental builds the default is 256 which allows caching to be more granular.
262
278
263
279
## remark
@@ -274,24 +290,26 @@ This option is deprecated and does nothing.
274
290
275
291
## debuginfo
276
292
277
- This flag lets you control debug information:
293
+ This flag controls the generation of debug information. It takes one of the
294
+ following values:
278
295
279
- * ` 0 ` : no debug info at all (default)
280
- * ` 1 ` : line tables only
281
- * ` 2 ` : full debug info
296
+ * ` 0 ` : no debug info at all (the default).
297
+ * ` 1 ` : line tables only.
298
+ * ` 2 ` : full debug info.
282
299
283
300
Note: The [ ` -g ` flag] [ option-g-debug ] is an alias for ` -C debuginfo=2 ` .
284
301
285
302
## opt-level
286
303
287
- This flag lets you control the optimization level.
304
+ This flag controls the optimization level.
288
305
289
- * ` 0 ` : no optimizations, also turns on [ ` cfg(debug_assertions) ` ] ( #debug-assertions ) .
290
- * ` 1 ` : basic optimizations
291
- * ` 2 ` : some optimizations
292
- * ` 3 ` : all optimizations
293
- * ` s ` : optimize for binary size
294
- * ` z ` : optimize for binary size, but also turn off loop vectorization.
306
+ * ` 0 ` : no optimizations, also turns on
307
+ [ ` cfg(debug_assertions) ` ] ( #debug-assertions ) (the default).
308
+ * ` 1 ` : basic optimizations.
309
+ * ` 2 ` : some optimizations.
310
+ * ` 3 ` : all optimizations.
311
+ * ` s ` : optimize for binary size.
312
+ * ` z ` : optimize for binary size, but also turn off loop vectorization..
295
313
296
314
Note: The [ ` -O ` flag] [ option-o-optimize ] is an alias for ` -C opt-level=2 ` .
297
315
@@ -303,8 +321,8 @@ This flag lets you turn `cfg(debug_assertions)` [conditional
303
321
compilation] ( ../../reference/conditional-compilation.md#debug_assertions ) on
304
322
or off. It takes one of the following values:
305
323
306
- * ` y ` , ` yes ` , ` on ` , or no value: Enable debug-assertions.
307
- * ` n ` , ` no ` , or ` off ` : Disable debug-assertions.
324
+ * ` y ` , ` yes ` , ` on ` , or no value: enable debug-assertions.
325
+ * ` n ` , ` no ` , or ` off ` : disable debug-assertions.
308
326
309
327
If not specified, debug assertions are automatically enabled only if the
310
328
[ opt-level] ( #opt-level ) is 0.
@@ -362,25 +380,24 @@ to a valid `.profdata` file. See the chapter on
362
380
This flag forces the use of frame pointers. It takes one of the following
363
381
values:
364
382
365
- * ` y ` , ` yes ` , ` on ` , or no value: Frame pointers are forced to be enabled .
366
- * ` n ` , ` no ` , or ` off ` : Frame pointers are not forced to be enabled . This does
383
+ * ` y ` , ` yes ` , ` on ` , or no value: force-enable frame pointers .
384
+ * ` n ` , ` no ` , or ` off ` : do not force-enable frame pointers . This does
367
385
not necessarily mean frame pointers will be removed.
368
386
369
- The default if not specified depends on the target.
387
+ The default behaviour, if frame pointers are not force-enabled, depends on the
388
+ target.
370
389
371
390
## default-linker-libraries
372
391
373
392
This flag controls whether or not the linker includes its default libraries.
374
393
It takes one of the following values:
375
394
376
- * ` y ` , ` yes ` , ` on ` , or no value: Default libraries are included .
377
- * ` n ` , ` no ` , or ` off ` : Default libraries are ** not ** included .
395
+ * ` y ` , ` yes ` , ` on ` , or no value: include default libraries (the default) .
396
+ * ` n ` , ` no ` , or ` off ` : exclude default libraries .
378
397
379
398
For example, for gcc flavor linkers, this issues the ` -nodefaultlibs ` flag to
380
399
the linker.
381
400
382
- The default is ` yes ` if not specified.
383
-
384
401
[ option-emit ] : ../command-line-arguments.md#option-emit
385
402
[ option-o-optimize ] : ../command-line-arguments.md#option-o-optimize
386
403
[ profile-guided optimization ] : ../profile-guided-optimization.md
0 commit comments