1 .TH RUSTC "1" "March 2014" "rustc 0.10-pre" "User Commands"
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 List the symbols defined by a library crate
34 Run all passes except translation; no output
36 \fB\-g\fR, \fB\-\-debuginfo\fR
37 Emit DWARF debug information into object files generated.
40 Equivalent to \fI\-\-opt\-level=2\fR
43 Write output to <filename>. Ignored if more than one --emit is specified.
45 \fB\-\-opt\-level\fR LEVEL
46 Optimize with possible levels 0-3
48 \fB\-\-out\-dir\fR DIR
49 Write output to compiler-chosen filename in <dir>. Ignored if -o is specified.
50 (default the current directory)
53 Parse only; do not compile, assemble, or link
55 \fB\-\-pretty\fR [TYPE]
56 Pretty-print the input instead of compiling; valid types are: normal
57 (un-annotated source), expanded (crates expanded), typed (crates
58 expanded, with type annotations), or identified (fully parenthesized,
59 AST nodes and blocks with IDs)
61 \fB\-\-sysroot\fR PATH
62 Override the system root
67 \fB\-\-target\fR TRIPLE
68 Target triple cpu-manufacturer-kernel[-os] to compile for (see
69 http://sources.redhat.com/autobook/autobook/autobook_17.html
73 Print 'lint' options and default settings
75 \fB\-W\fR OPT, \fB\-\-warn\fR OPT
78 \fB\-A\fR OPT, \fB\-\-allow\fR OPT
81 \fB\-D\fR OPT, \fB\-\-deny\fR OPT
84 \fB\-F\fR OPT, \fB\-\-forbid\fR OPT
88 Set internal debugging options. Use "-Z help" to print available options.
90 \fB\-C\fR FLAG[=VAL], \fB\-\-codegen\fR FLAG[=VAL]
91 Set a codegen-related flag to the value specifie.d Use "-C help" to print
92 available flags. See CODEGEN OPTIONS below
94 \fB\-v\fR, \fB\-\-version\fR
95 Print version info and exit
101 Path to the archive utility to use when assembling archives.
103 \fBlinker\fR=/path/to/cc
104 Path to the linker utility to use when linking libraries, executables, and
107 \fBlink-args\fR='-flag1 -flag2'
108 A space-separated list of extra arguments to pass to the linker when the linker
111 \fBtarget-cpu\fR=help
112 Selects a target processor. If the value is 'help', then a list of available
115 \fBtarget-feature\fR='+feature1 -feature2'
116 A space-separated list of features to enable or disable for the target. A
117 preceding '+' enables a feature while a preceding '-' disables it. Available
118 features can be discovered through target-cpu=help.
121 A space-separated list of extra LLVM passes to run. A value of 'list' will
122 cause rustc to print all known passes and exit. The passes specified are
123 appended at the end of the normal pass manager.
125 \fBllvm-args\fR='-arg1 -arg2'
126 A space-separted list of argument to pass through to LLVM.
129 If specified, the compiler will save more files (.bc, .o, .no-opt.bc) generated
130 throughout compilation in the output directory.
132 \fBandroid-cross-path\fR=path/to/ndk/bin
133 Directory to find the Android NDK cross-compilation tools
136 If specified, then the rpath value for dynamic libraries will not be set in
137 either dynamic library or executable outputs.
139 \fBno-prepopulate-passes\fR
140 Suppresses pre-population of the LLVM pass manager that is run over the module.
142 \fBno-vectorize-loops\fR
143 Suppresses running the loop vectorization LLVM pass, regardless of optimization
146 \fBno-vectorize-slp\fR
147 Suppresses running the LLVM SLP vectorization pass, regardless of optimization
151 Generates software floating point library calls instead of hardware
155 Forces generate of a toplevel crate map. May be required for logging to work
156 when rust is embedded into another application.
159 Prefers dynamic linking to static linking.
161 \fBno-integrated-as\fR
162 Force usage of an external assembler rather than LLVM's integrated one.
165 To build an executable from a source file with a main function:
166 $ rustc -o hello hello.rs
168 To build a library from a source file:
169 $ rustc --crate-type=lib hello-lib.rs
171 To build either with a crate (.rs) file:
174 To build an executable with debug info:
175 $ rustc -g -o hello hello.rs
182 See <\fBhttps://github.com/mozilla/rust/issues\fR> for issues.
185 See \fBAUTHORS.txt\fR in the rust source distribution. Graydon Hoare
186 <\fIgraydon@mozilla.com\fR> is the project leader.
189 This work is dual-licensed under Apache 2.0 and MIT terms. See \fBCOPYRIGHT\fR
190 file in the rust source distribution.