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 Normally, the linker will remove dead code. This flag disables this behavior.
29 An example of when this flag might be useful is when trying to construct code coverage
34 This flag instructs LLVM to use [link time
35 optimizations](https://llvm.org/docs/LinkTimeOptimization.html).
37 It takes one of two values, `thin` and `fat`. 'thin' LTO [is a new feature of
38 LLVM](http://blog.llvm.org/2016/06/thinlto-scalable-and-incremental-lto.html),
39 'fat' referring to the classic version of LTO.
43 This instructs `rustc` to generate code specifically for a particular processor.
45 You can run `rustc --print target-cpus` to see the valid options to pass
46 here. Additionally, `native` can be passed to use the processor of the host
51 Individual targets will support different features; this flag lets you control
52 enabling or disabling a feature.
54 To see the valid options and an example of use, run `rustc --print
59 This flag can be used to add extra LLVM passes to the compilation.
61 The list must be separated by spaces.
65 This flag can be used to pass a list of arguments directly to LLVM.
67 The list must be separated by spaces.
71 `rustc` will generate temporary files during compilation; normally it will
72 delete them after it's done with its work. This option will cause them to be
73 preserved instead of removed.
77 This option allows you to set the value of
78 [`rpath`](https://en.wikipedia.org/wiki/Rpath).
82 This flag allows you to control the behavior of integer overflow. This flag
83 can be passed many options:
85 * To turn overflow checks on: `y`, `yes`, or `on`.
86 * To turn overflow checks off: `n`, `no`, or `off`.
88 ## no-prepopulate-passes
90 The pass manager comes pre-populated with a list of passes; this flag
91 ensures that list is empty.
95 By default, `rustc` will attempt to [vectorize
96 loops](https://llvm.org/docs/Vectorizers.html#the-loop-vectorizer). This
97 flag will turn that behavior off.
101 By default, `rustc` will attempt to vectorize loops using [superword-level
102 parallism](https://llvm.org/docs/Vectorizers.html#the-slp-vectorizer). This
103 flag will turn that behavior off.
107 This option will make `rustc` generate code using "soft floats." By default,
108 a lot of hardware supports floating point instructions, and so the code generated
109 will take advantage of this. "soft floats" emulate floating point instructions
114 By default, `rustc` prefers to statically link dependencies. This option will
115 make it use dynamic linking instead.
119 LLVM comes with an internal assembler; this option will let you use an
120 external assembler instead.
124 This flag allows you to disable [the
125 red zone](https://en.wikipedia.org/wiki/Red_zone_\(computing\)). This flag can
126 be passed many options:
128 * To enable the red zone: `y`, `yes`, or `on`.
129 * To disable it: `n`, `no`, or `off`.
133 This option lets you choose which relocation model to use.
135 To find the valid options for this flag, run `rustc --print relocation-models`.
139 This option lets you choose which code model to use.
141 To find the valid options for this flag, run `rustc --print code-models`.
145 This option allows you to control the metadata used for symbol mangling.
149 This option allows you to put extra data in each output filename.
153 This flag lets you control how many threads are used when doing
156 Increasing paralellism may speed up compile times, but may also
161 This flag lets you print remarks for these optimization passes.
163 The list of passes should be separated by spaces.
165 `all` will remark on every pass.
169 This option is deprecated and does nothing.
173 This flag lets you control debug information:
175 * `0`: no debug info at all
176 * `1`: line tables only
177 * `2`: full debug info
181 This flag lets you control the optimization level.
183 * `0`: no optimizations
184 * `1`: basic optimizations
185 * `2`: some optimizations
186 * `3`: all optimizations
187 * `s`: optimize for binary size
188 * `z`: optimize for binary size, but also turn off loop vectorization.
192 This flag lets you turn `cfg(debug_assertions)` on or off.
196 This option lets you set the threshold for inlining a function.
202 This option lets you control what happens when the code panics.
204 * `abort`: terminate the process upon panic
205 * `unwind`: unwind the stack upon panic
209 This flag allows you to enable incremental compilation.