1 .TH RUSTC "1" "March 2014" "rustc 0.11-pre" "User Commands"
3 rustc \- The Rust compiler
6 [\fIOPTIONS\fR] \fIINPUT\fR
9 This program is a compiler for the Rust language, available at
10 <\fBhttps://www.rust-lang.org\fR>.
15 \fB\-\-crate-type=[bin|lib|dylib|rlib|staticlib]\fR
16 Configure the flavor of rust crate that is generated (default `bin`)
19 Configure the compilation environment
21 \fB\-\-emit=[asm,ir,bc,obj,link]\fR
22 Configure the output that rustc will produce
24 \fB\-h\fR, \fB\-\-help\fR
28 Add a directory to the library search path
31 Run all passes except translation; no output
33 \fB\-\-no\-analysis\fR
34 Parse and expand the source, but run no analysis and produce no output
37 Emit DWARF debug information into object files generated.
39 \fB\-\-debuginfo\fR LEVEL
40 Emit DWARF debug info to the objects created: 0 = no debug info, 1 =
41 line-tables only (for stacktraces and breakpoints), 2 = full debug
42 info with variable and type information (same as -g).
45 Equivalent to \fI\-\-opt\-level=2\fR
48 Write output to <filename>. Ignored if more than one --emit is specified.
50 \fB\-\-opt\-level\fR LEVEL
51 Optimize with possible levels 0-3
53 \fB\-\-out\-dir\fR DIR
54 Write output to compiler-chosen filename in <dir>. Ignored if -o is specified.
55 (default the current directory)
58 Parse only; do not compile, assemble, or link
60 \fB\-\-pretty\fR [TYPE]
61 Pretty-print the input instead of compiling; valid types are: normal
62 (un-annotated source), expanded (crates expanded), typed (crates
63 expanded, with type annotations), or identified (fully parenthesized,
64 AST nodes and blocks with IDs)
66 \fB\-\-dep-info\fR [FILENAME]
67 Output dependency info to <filename> after compiling, in o format suitable
70 \fB\-\-sysroot\fR PATH
71 Override the system root
76 \fB\-\-target\fR TRIPLE
77 Target triple cpu-manufacturer-kernel[-os] to compile for (see
78 http://sources.redhat.com/autobook/autobook/autobook_17.html
82 Print 'lint' options and default settings
84 \fB\-W\fR OPT, \fB\-\-warn\fR OPT
87 \fB\-A\fR OPT, \fB\-\-allow\fR OPT
90 \fB\-D\fR OPT, \fB\-\-deny\fR OPT
93 \fB\-F\fR OPT, \fB\-\-forbid\fR OPT
97 Set internal debugging options. Use "-Z help" to print available options.
99 \fB\-C\fR FLAG[=VAL], \fB\-\-codegen\fR FLAG[=VAL]
100 Set a codegen-related flag to the value specified. Use "-C help" to print
101 available flags. See CODEGEN OPTIONS below
103 \fB\-v\fR, \fB\-\-version\fR
104 Print version info and exit
110 Path to the archive utility to use when assembling archives.
112 \fBlinker\fR=/path/to/cc
113 Path to the linker utility to use when linking libraries, executables, and
116 \fBlink-args\fR='-flag1 -flag2'
117 A space-separated list of extra arguments to pass to the linker when the linker
120 \fBtarget-cpu\fR=help
121 Selects a target processor. If the value is 'help', then a list of available
124 \fBtarget-feature\fR='+feature1 -feature2'
125 A space-separated list of features to enable or disable for the target. A
126 preceding '+' enables a feature while a preceding '-' disables it. Available
127 features can be discovered through target-cpu=help.
130 A space-separated list of extra LLVM passes to run. A value of 'list' will
131 cause rustc to print all known passes and exit. The passes specified are
132 appended at the end of the normal pass manager.
134 \fBllvm-args\fR='-arg1 -arg2'
135 A space-separated list of arguments to pass through to LLVM.
138 If specified, the compiler will save more files (.bc, .o, .no-opt.bc) generated
139 throughout compilation in the output directory.
142 If specified, then the rpath value for dynamic libraries will not be set in
143 either dynamic library or executable outputs.
145 \fBno-prepopulate-passes\fR
146 Suppresses pre-population of the LLVM pass manager that is run over the module.
148 \fBno-vectorize-loops\fR
149 Suppresses running the loop vectorization LLVM pass, regardless of optimization
152 \fBno-vectorize-slp\fR
153 Suppresses running the LLVM SLP vectorization pass, regardless of optimization
157 Generates software floating point library calls instead of hardware
161 Prefers dynamic linking to static linking.
163 \fBno-integrated-as\fR
164 Force usage of an external assembler rather than LLVM's integrated one.
166 \fBrelocation-model\fR=[pic,static,dynamic-no-pic]
167 The relocation model to use. (default: pic)
170 To build an executable from a source file with a main function:
171 $ rustc -o hello hello.rs
173 To build a library from a source file:
174 $ rustc --crate-type=lib hello-lib.rs
176 To build either with a crate (.rs) file:
179 To build an executable with debug info:
180 $ rustc -g -o hello hello.rs
187 See <\fBhttps://github.com/mozilla/rust/issues\fR> for issues.
190 See \fBAUTHORS.txt\fR in the Rust source distribution.
193 This work is dual-licensed under Apache 2.0 and MIT terms. See \fBCOPYRIGHT\fR
194 file in the rust source distribution.