@@ -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.
70
+ linking time. It takes one of the following values:
66
71
67
- This flag may take one of the following values:
68
-
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,35 @@ 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 tells the pass manager to use an empty list of passes, instead of the
184
+ usual pre-populated list of passes .
177
185
178
186
## no-vectorize-loops
179
187
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.
188
+ This flag disables [ loop
189
+ vectorization] ( https://llvm.org/docs/Vectorizers.html#the-loop-vectorizer ) .
183
190
184
191
## no-vectorize-slp
185
192
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 .
193
+ This flag disables vectorization using
194
+ [ superword-level
195
+ parallelism ] ( https://llvm.org/docs/Vectorizers.html#the-slp-vectorizer ) .
189
196
190
197
## soft-float
191
198
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.
199
+ This option controls whether ` rustc ` generates code that emulates floating
200
+ point instructions in software. It takes one of the following values:
201
+
202
+ * ` y ` , ` yes ` , ` on ` , or no value: use soft floats.
203
+ * ` n ` , ` no ` , or ` off ` : use hardware floats (the default).
196
204
197
205
## prefer-dynamic
198
206
@@ -201,24 +209,21 @@ indicate that dynamic linking should be used if possible if both a static and
201
209
dynamic versions of a library are available. There is an internal algorithm
202
210
for determining whether or not it is possible to statically or dynamically
203
211
link with a dependency. For example, ` cdylib ` crate types may only use static
204
- linkage.
212
+ linkage. This flag takes one of the following values:
205
213
206
- ## no-integrated-as
207
-
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 ` .
214
+ * ` y ` , ` yes ` , ` on ` , or no value: use dynamic linking.
215
+ * ` n ` , ` no ` , or ` off ` : use static linking (the default).
211
216
212
217
## no-redzone
213
218
214
219
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 :
220
+ red zone] ( https://en.wikipedia.org/wiki/Red_zone_\( computing\) ) . It takes one
221
+ of the following values :
217
222
218
- * ` y ` , ` yes ` , ` on ` , or no value: Disables the red zone.
219
- * ` n ` , ` no ` , or ` off ` : Enables the red zone.
223
+ * ` y ` , ` yes ` , ` on ` , or no value: disable the red zone.
224
+ * ` n ` , ` no ` , or ` off ` : enable the red zone.
220
225
221
- The default if not specified depends on the target.
226
+ The default behaviour, if the flag is not specified, depends on the target.
222
227
223
228
## relocation-model
224
229
@@ -257,7 +262,7 @@ them in parallel. Increasing parallelism may speed up compile times, but may
257
262
also produce slower code. Setting this to 1 may improve the performance of
258
263
generated code, but may be slower to compile.
259
264
260
- The default, if not specified, is 16 for non-incremental builds. For
265
+ The default value , if not specified, is 16 for non-incremental builds. For
261
266
incremental builds the default is 256 which allows caching to be more granular.
262
267
263
268
## remark
@@ -274,23 +279,25 @@ This option is deprecated and does nothing.
274
279
275
280
## debuginfo
276
281
277
- This flag lets you control debug information:
282
+ This flag controls the generation of debug information. It takes one of the
283
+ following values:
278
284
279
- * ` 0 ` : no debug info at all (default)
280
- * ` 1 ` : line tables only
281
- * ` 2 ` : full debug info
285
+ * ` 0 ` : no debug info at all (the default).
286
+ * ` 1 ` : line tables only.
287
+ * ` 2 ` : full debug info.
282
288
283
289
Note: The [ ` -g ` flag] [ option-g-debug ] is an alias for ` -C debuginfo=2 ` .
284
290
285
291
## opt-level
286
292
287
- This flag lets you control the optimization level.
293
+ This flag controls the optimization level.
288
294
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
295
+ * ` 0 ` : no optimizations, also turns on
296
+ [ ` cfg(debug_assertions) ` ] ( #debug-assertions ) (the default).
297
+ * ` 1 ` : basic optimizations.
298
+ * ` 2 ` : some optimizations.
299
+ * ` 3 ` : all optimizations.
300
+ * ` s ` : optimize for binary size.
294
301
* ` z ` : optimize for binary size, but also turn off loop vectorization.
295
302
296
303
Note: The [ ` -O ` flag] [ option-o-optimize ] is an alias for ` -C opt-level=2 ` .
@@ -303,8 +310,8 @@ This flag lets you turn `cfg(debug_assertions)` [conditional
303
310
compilation] ( ../../reference/conditional-compilation.md#debug_assertions ) on
304
311
or off. It takes one of the following values:
305
312
306
- * ` y ` , ` yes ` , ` on ` , or no value: Enable debug-assertions.
307
- * ` n ` , ` no ` , or ` off ` : Disable debug-assertions.
313
+ * ` y ` , ` yes ` , ` on ` , or no value: enable debug-assertions.
314
+ * ` n ` , ` no ` , or ` off ` : disable debug-assertions.
308
315
309
316
If not specified, debug assertions are automatically enabled only if the
310
317
[ opt-level] ( #opt-level ) is 0.
@@ -362,25 +369,24 @@ to a valid `.profdata` file. See the chapter on
362
369
This flag forces the use of frame pointers. It takes one of the following
363
370
values:
364
371
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
372
+ * ` y ` , ` yes ` , ` on ` , or no value: force-enable frame pointers .
373
+ * ` n ` , ` no ` , or ` off ` : do not force-enable frame pointers . This does
367
374
not necessarily mean frame pointers will be removed.
368
375
369
- The default if not specified depends on the target.
376
+ The default behaviour, if frame pointers are not force-enabled, depends on the
377
+ target.
370
378
371
379
## default-linker-libraries
372
380
373
381
This flag controls whether or not the linker includes its default libraries.
374
382
It takes one of the following values:
375
383
376
- * ` y ` , ` yes ` , ` on ` , or no value: Default libraries are included .
377
- * ` n ` , ` no ` , or ` off ` : Default libraries are ** not ** included .
384
+ * ` y ` , ` yes ` , ` on ` , or no value: include default libraries (the default) .
385
+ * ` n ` , ` no ` , or ` off ` : exclude default libraries .
378
386
379
387
For example, for gcc flavor linkers, this issues the ` -nodefaultlibs ` flag to
380
388
the linker.
381
389
382
- The default is ` yes ` if not specified.
383
-
384
390
[ option-emit ] : ../command-line-arguments.md#option-emit
385
391
[ option-o-optimize ] : ../command-line-arguments.md#option-o-optimize
386
392
[ profile-guided optimization ] : ../profile-guided-optimization.md
0 commit comments