3 All of these options are passed to `rustc` via the `-C` flag, short for "codegen." You can see
4 a version of this list for your exact compiler by running `rustc -C help`.
8 This option is deprecated and does nothing.
12 This flag lets you control which linker `rustc` invokes to link your code.
16 This flag lets you append a single extra argument to the linker invocation.
18 "Append" is significant; you can pass this flag multiple times to add multiple arguments.
22 This flag lets you append multiple extra arguments to the linker invocation. The
23 options should be separated by spaces.
27 This flag lets you control the linker flavor used by `rustc`. If a linker is given with the
28 `-C linker` flag described above then the linker flavor is inferred from the value provided. If no
29 linker is given then the linker flavor is used to determine the linker to use. Every `rustc` target
30 defaults to some linker flavor.
34 Normally, the linker will remove dead code. This flag disables this behavior.
36 An example of when this flag might be useful is when trying to construct code coverage
41 This flag instructs LLVM to use [link time
42 optimizations](https://llvm.org/docs/LinkTimeOptimization.html).
44 It takes one of two values, `thin` and `fat`. 'thin' LTO [is a new feature of
45 LLVM](http://blog.llvm.org/2016/06/thinlto-scalable-and-incremental-lto.html),
46 'fat' referring to the classic version of LTO.
50 This instructs `rustc` to generate code specifically for a particular processor.
52 You can run `rustc --print target-cpus` to see the valid options to pass
53 here. Additionally, `native` can be passed to use the processor of the host
58 Individual targets will support different features; this flag lets you control
59 enabling or disabling a feature.
61 To see the valid options and an example of use, run `rustc --print
66 This flag can be used to add extra LLVM passes to the compilation.
68 The list must be separated by spaces.
72 This flag can be used to pass a list of arguments directly to LLVM.
74 The list must be separated by spaces.
78 `rustc` will generate temporary files during compilation; normally it will
79 delete them after it's done with its work. This option will cause them to be
80 preserved instead of removed.
84 This option allows you to set the value of
85 [`rpath`](https://en.wikipedia.org/wiki/Rpath).
89 This flag allows you to control the behavior of integer overflow. This flag
90 can be passed many options:
92 * To turn overflow checks on: `y`, `yes`, or `on`.
93 * To turn overflow checks off: `n`, `no`, or `off`.
95 ## no-prepopulate-passes
97 The pass manager comes pre-populated with a list of passes; this flag
98 ensures that list is empty.
100 ## no-vectorize-loops
102 By default, `rustc` will attempt to [vectorize
103 loops](https://llvm.org/docs/Vectorizers.html#the-loop-vectorizer). This
104 flag will turn that behavior off.
108 By default, `rustc` will attempt to vectorize loops using [superword-level
109 parallelism](https://llvm.org/docs/Vectorizers.html#the-slp-vectorizer). This
110 flag will turn that behavior off.
114 This option will make `rustc` generate code using "soft floats." By default,
115 a lot of hardware supports floating point instructions, and so the code generated
116 will take advantage of this. "soft floats" emulate floating point instructions
121 By default, `rustc` prefers to statically link dependencies. This option will
122 make it use dynamic linking instead.
126 LLVM comes with an internal assembler; this option will let you use an
127 external assembler instead.
131 This flag allows you to disable [the
132 red zone](https://en.wikipedia.org/wiki/Red_zone_\(computing\)). This flag can
133 be passed many options:
135 * To enable the red zone: `y`, `yes`, or `on`.
136 * To disable it: `n`, `no`, or `off`.
140 This option lets you choose which relocation model to use.
142 To find the valid options for this flag, run `rustc --print relocation-models`.
146 This option lets you choose which code model to use.
148 To find the valid options for this flag, run `rustc --print code-models`.
152 This option allows you to control the metadata used for symbol mangling.
156 This option allows you to put extra data in each output filename.
160 This flag lets you control how many threads are used when doing
163 Increasing parallelism may speed up compile times, but may also
168 This flag lets you print remarks for these optimization passes.
170 The list of passes should be separated by spaces.
172 `all` will remark on every pass.
176 This option is deprecated and does nothing.
180 This flag lets you control debug information:
182 * `0`: no debug info at all
183 * `1`: line tables only
184 * `2`: full debug info
188 This flag lets you control the optimization level.
190 * `0`: no optimizations, also turn on `cfg(debug_assertions)`.
191 * `1`: basic optimizations
192 * `2`: some optimizations
193 * `3`: all optimizations
194 * `s`: optimize for binary size
195 * `z`: optimize for binary size, but also turn off loop vectorization.
199 This flag lets you turn `cfg(debug_assertions)` on or off.
203 This option lets you set the threshold for inlining a function.
209 This option lets you control what happens when the code panics.
211 * `abort`: terminate the process upon panic
212 * `unwind`: unwind the stack upon panic
216 This flag allows you to enable incremental compilation.
220 This flag allows for creating instrumented binaries that will collect
221 profiling data for use with profile-guided optimization (PGO). The flag takes
222 an optional argument which is the path to a directory into which the
223 instrumented binary will emit the collected data. See the chapter on
224 [profile-guided optimization] for more information.
228 This flag specifies the profiling data file to be used for profile-guided
229 optimization (PGO). The flag takes a mandatory argument which is the path
230 to a valid `.profdata` file. See the chapter on
231 [profile-guided optimization] for more information.
233 [profile-guided optimization]: ../profile-guided-optimization.md