@@ -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.
66-
67- This flag may take one of the following values:
70+ linking time. It takes one of the following values:
6871
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,46 @@ 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 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).
177188
178189## no-vectorize-loops
179190
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).
183197
184198## no-vectorize-slp
185199
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).
189207
190208## soft-float
191209
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).
196215
197216## prefer-dynamic
198217
@@ -201,24 +220,21 @@ indicate that dynamic linking should be used if possible if both a static and
201220dynamic versions of a library are available. There is an internal algorithm
202221for determining whether or not it is possible to statically or dynamically
203222link 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:
207224
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).
211227
212228## no-redzone
213229
214230This 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 :
217233
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.
220236
221- The default if not specified depends on the target.
237+ The default behaviour, if the flag is not specified, depends on the target.
222238
223239## relocation-model
224240
@@ -257,7 +273,7 @@ them in parallel. Increasing parallelism may speed up compile times, but may
257273also produce slower code. Setting this to 1 may improve the performance of
258274generated code, but may be slower to compile.
259275
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
261277incremental builds the default is 256 which allows caching to be more granular.
262278
263279## remark
@@ -274,24 +290,26 @@ This option is deprecated and does nothing.
274290
275291## debuginfo
276292
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:
278295
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.
282299
283300Note: The [ ` -g ` flag] [ option-g-debug ] is an alias for ` -C debuginfo=2 ` .
284301
285302## opt-level
286303
287- This flag lets you control the optimization level.
304+ This flag controls the optimization level.
288305
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..
295313
296314Note: The [ ` -O ` flag] [ option-o-optimize ] is an alias for ` -C opt-level=2 ` .
297315
@@ -303,8 +321,8 @@ This flag lets you turn `cfg(debug_assertions)` [conditional
303321compilation] ( ../../reference/conditional-compilation.md#debug_assertions ) on
304322or off. It takes one of the following values:
305323
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.
308326
309327If not specified, debug assertions are automatically enabled only if the
310328[ opt-level] ( #opt-level ) is 0.
@@ -362,25 +380,24 @@ to a valid `.profdata` file. See the chapter on
362380This flag forces the use of frame pointers. It takes one of the following
363381values:
364382
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
367385 not necessarily mean frame pointers will be removed.
368386
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.
370389
371390## default-linker-libraries
372391
373392This flag controls whether or not the linker includes its default libraries.
374393It takes one of the following values:
375394
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 .
378397
379398For example, for gcc flavor linkers, this issues the ` -nodefaultlibs ` flag to
380399the linker.
381400
382- The default is ` yes ` if not specified.
383-
384401[ option-emit ] : ../command-line-arguments.md#option-emit
385402[ option-o-optimize ] : ../command-line-arguments.md#option-o-optimize
386403[ profile-guided optimization ] : ../profile-guided-optimization.md
0 commit comments