@@ -9,10 +9,10 @@ This option is deprecated and does nothing.
99
1010## linker
1111
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.
1616
1717## link-arg
1818
@@ -27,49 +27,52 @@ options should be separated by spaces.
2727
2828## linker-flavor
2929
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
4041 [ ` rust-ptx-linker ` ] ( https://github.com/denzp/rust-ptx-linker ) for Nvidia
4142 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 )
4344 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 `
4546 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 `
4748 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 `
4950 flag] [ lld-flavor ] for Microsoft's ` link.exe ` .
5051
5152[ lld-flavor ] : https://lld.llvm.org/Driver.html
5253
5354## link-dead-code
5455
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).
5661
5762An example of when this flag might be useful is when trying to construct code coverage
5863metrics.
5964
6065## lto
6166
62- This flag instructs LLVM to use [ link time
67+ This flag controls whether LLVM uses [ link time
6368optimizations] ( https://llvm.org/docs/LinkTimeOptimization.html ) to produce
6469better optimized code, using whole-program analysis, at the cost of longer
65- linking time.
70+ linking time. It takes one of the following values:
6671
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
7073 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"
7376 LTO] ( http://blog.llvm.org/2016/06/thinlto-scalable-and-incremental-lto.html ) .
7477 This is similar to "fat", but takes substantially less time to run while
7578 still achieving performance gains similar to "fat".
@@ -81,22 +84,22 @@ disabled if codegen units is 1 or optimizations are disabled ([`-C
8184opt-level=0`] ( #opt-level ) ). That is:
8285
8386* 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.
8689* 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.
8891 * ` codegen-units=1 ` + ` lto=true ` : 1 codegen unit, fat LTO across crates.
8992
9093See also [ linker-plugin-lto] ( #linker-plugin-lto ) for cross-language LTO.
9194
9295## linker-plugin-lto
9396
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
9699the following values:
97100
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).
100103* A path to the linker plugin.
101104
102105## target-cpu
@@ -148,14 +151,19 @@ Pass `--help` to see a list of options.
148151
149152## save-temps
150153
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).
154159
155160## rpath
156161
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).
159167
160168## overflow-checks
161169
@@ -164,35 +172,35 @@ overflow](../../reference/expressions/operator-expr.md#overflow). When
164172overflow-checks are enabled, a panic will occur on overflow. This flag takes
165173one of the following values:
166174
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.
169177
170178If not specified, overflow checks are enabled if
171179[ debug-assertions] ( #debug-assertions ) are enabled, disabled otherwise.
172180
173181## no-prepopulate-passes
174182
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 .
177185
178186## no-vectorize-loops
179187
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 ) .
183190
184191## no-vectorize-slp
185192
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 ) .
189196
190197## soft-float
191198
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).
196204
197205## prefer-dynamic
198206
@@ -201,24 +209,21 @@ indicate that dynamic linking should be used if possible if both a static and
201209dynamic versions of a library are available. There is an internal algorithm
202210for determining whether or not it is possible to statically or dynamically
203211link with a dependency. For example, ` cdylib ` crate types may only use static
204- linkage.
212+ linkage. This flag takes one of the following values:
205213
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).
211216
212217## no-redzone
213218
214219This 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 :
217222
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.
220225
221- The default if not specified depends on the target.
226+ The default behaviour, if the flag is not specified, depends on the target.
222227
223228## relocation-model
224229
@@ -257,7 +262,7 @@ them in parallel. Increasing parallelism may speed up compile times, but may
257262also produce slower code. Setting this to 1 may improve the performance of
258263generated code, but may be slower to compile.
259264
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
261266incremental builds the default is 256 which allows caching to be more granular.
262267
263268## remark
@@ -274,23 +279,25 @@ This option is deprecated and does nothing.
274279
275280## debuginfo
276281
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:
278284
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.
282288
283289Note: The [ ` -g ` flag] [ option-g-debug ] is an alias for ` -C debuginfo=2 ` .
284290
285291## opt-level
286292
287- This flag lets you control the optimization level.
293+ This flag controls the optimization level.
288294
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.
294301* ` z ` : optimize for binary size, but also turn off loop vectorization.
295302
296303Note: 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
303310compilation] ( ../../reference/conditional-compilation.md#debug_assertions ) on
304311or off. It takes one of the following values:
305312
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.
308315
309316If not specified, debug assertions are automatically enabled only if the
310317[ opt-level] ( #opt-level ) is 0.
@@ -362,25 +369,24 @@ to a valid `.profdata` file. See the chapter on
362369This flag forces the use of frame pointers. It takes one of the following
363370values:
364371
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
367374 not necessarily mean frame pointers will be removed.
368375
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.
370378
371379## default-linker-libraries
372380
373381This flag controls whether or not the linker includes its default libraries.
374382It takes one of the following values:
375383
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 .
378386
379387For example, for gcc flavor linkers, this issues the ` -nodefaultlibs ` flag to
380388the linker.
381389
382- The default is ` yes ` if not specified.
383-
384390[ option-emit ] : ../command-line-arguments.md#option-emit
385391[ option-o-optimize ] : ../command-line-arguments.md#option-o-optimize
386392[ profile-guided optimization ] : ../profile-guided-optimization.md
0 commit comments