]> git.lizzy.rs Git - rust.git/blob - man/rustc.1
doc: remove incomplete sentence
[rust.git] / man / rustc.1
1 .TH RUSTC "1" "March 2014" "rustc 0.13.0" "User Commands"
2 .SH NAME
3 rustc \- The Rust compiler
4 .SH SYNOPSIS
5 .B rustc
6 [\fIOPTIONS\fR] \fIINPUT\fR
7
8 .SH DESCRIPTION
9 This program is a compiler for the Rust language, available at
10 <\fBhttps://www.rust-lang.org\fR>.
11
12 .SH OPTIONS
13
14 .TP
15 \fB\-h\fR, \fB\-\-help\fR
16 Display the help message
17 .TP
18 \fB\-\-cfg\fR SPEC
19 Configure the compilation environment
20 .TP
21 \fB\-L\fR PATH
22 Add a directory to the library search path
23 .TP
24 \fB\-l\fR NAME[:KIND]
25 Link the generated crate(s) to the specified native library NAME. The optional
26 KIND can be one of, static, dylib, or framework. If omitted, dylib is assumed.
27 .TP
28 \fB\-\-crate-type\fR [bin|lib|rlib|dylib|staticlib]
29 Comma separated list of types of crates for the compiler to emit
30 .TP
31 \fB\-\-crate-name NAME\fR
32 Specify the name of the crate being built
33 .TP
34 \fB\-\-emit\fR [asm|llvm-bc|llvm-ir|obj|link|dep-info]
35 Configure the output that rustc will produce
36 .TP
37 \fB\-\-print\fR [crate-name|output-file-names|sysroot]
38 Comma separated list of compiler information to print on stdout
39 .TP
40 \fB\-g\fR
41 Equivalent to \fI\-C\fR debuginfo=2
42 .TP
43 \fB\-O\fR
44 Equivalent to \fI\-C\fR opt-level=2
45 .TP
46 \fB\-o\fR FILENAME
47 Write output to <filename>. Ignored if multiple \fI\-\-emit\fR outputs are
48 specified.
49 .TP
50 \fB\-\-out\-dir\fR DIR
51 Write output to compiler-chosen filename in <dir>. Ignored if \fI\-o\fR is
52 specified. Defaults to the current directory.
53 .TP
54 \fB\-\-explain\fR OPT
55 Provide a detailed explanation of an error message
56 .TP
57 \fB\-\-test\fR
58 Build a test harness
59 .TP
60 \fB\-\-target\fR TRIPLE
61 Target triple cpu-manufacturer-kernel[-os] to compile for (see chapter 3.4 of
62 http://www.sourceware.org/autobook/ for details)
63 .TP
64 \fB\-W\fR help
65 Print 'lint' options and default settings
66 .TP
67 \fB\-W\fR OPT, \fB\-\-warn\fR OPT
68 Set lint warnings
69 .TP
70 \fB\-A\fR OPT, \fB\-\-allow\fR OPT
71 Set lint allowed
72 .TP
73 \fB\-D\fR OPT, \fB\-\-deny\fR OPT
74 Set lint denied
75 .TP
76 \fB\-F\fR OPT, \fB\-\-forbid\fR OPT
77 Set lint forbidden
78 .TP
79 \fB\-C\fR FLAG[=VAL], \fB\-\-codegen\fR FLAG[=VAL]
80 Set a codegen-related flag to the value specified. Use "-C help" to print
81 available flags. See CODEGEN OPTIONS below
82 .TP
83 \fB\-V\fR, \fB\-\-version\fR
84 Print version info and exit
85 .TP
86 \fB\-v\fR, \fB\-\-verbose\fR
87 Use verbose output
88 .TP
89 \fB\-\-extern\fR NAME=PATH
90 Specify where an external rust library is located
91 .TP
92 \fB\-\-sysroot\fR PATH
93 Override the system root
94 .TP
95 \fB\-Z\fR FLAG
96 Set internal debugging options. Use "-Z help" to print available options.
97 .TP
98 \fB\-\-color\fR auto|always|never
99 Configure coloring of output:
100     auto = colorize, if output goes to a tty (default);
101     always = always colorize output;
102     never = never colorize output
103
104 .SH CODEGEN OPTIONS
105
106 .TP
107 \fBar\fR=/path/to/ar
108 Path to the archive utility to use when assembling archives.
109 .TP
110 \fBlinker\fR=/path/to/cc
111 Path to the linker utility to use when linking libraries, executables, and
112 objects.
113 .TP
114 \fBlink-args\fR='-flag1 -flag2'
115 A space-separated list of extra arguments to pass to the linker when the linker
116 is invoked.
117 .TP
118 \fBlto\fR
119 Perform LLVM link-time optimizations.
120 .TP
121 \fBtarget-cpu\fR=help
122 Selects a target processor. If the value is 'help', then a list of available
123 CPUs is printed.
124 .TP
125 \fBtarget-feature\fR='+feature1,-feature2'
126 A comma-separated list of features to enable or disable for the target. A
127 preceding '+' enables a feature while a preceding '-' disables it. Available
128 features can be discovered through target-cpu=help.
129 .TP
130 \fBpasses\fR=list
131 A space-separated list of extra LLVM passes to run. A value of 'list' will
132 cause rustc to print all known passes and exit. The passes specified are
133 appended at the end of the normal pass manager.
134 .TP
135 \fBllvm-args\fR='-arg1 -arg2'
136 A space-separated list of arguments to pass through to LLVM.
137 .TP
138 \fBsave-temps\fR
139 If specified, the compiler will save more files (.bc, .o, .no-opt.bc) generated
140 throughout compilation in the output directory.
141 .TP
142 \fBrpath\fR
143 If specified, then the rpath value for dynamic libraries will be set in
144 either dynamic library or executable outputs.
145 .TP
146 \fBno-prepopulate-passes\fR
147 Suppresses pre-population of the LLVM pass manager that is run over the module.
148 .TP
149 \fBno-vectorize-loops\fR
150 Suppresses running the loop vectorization LLVM pass, regardless of optimization
151 level.
152 .TP
153 \fBno-vectorize-slp\fR
154 Suppresses running the LLVM SLP vectorization pass, regardless of optimization
155 level.
156 .TP
157 \fBsoft-float\fR
158 Generates software floating point library calls instead of hardware
159 instructions.
160 .TP
161 \fBprefer-dynamic\fR
162 Prefers dynamic linking to static linking.
163 .TP
164 \fBno-integrated-as\fR
165 Force usage of an external assembler rather than LLVM's integrated one.
166 .TP
167 \fBno-redzone\fR
168 Disable the use of the redzone.
169 .TP
170 \fBrelocation-model\fR=[pic,static,dynamic-no-pic]
171 The relocation model to use. (Default: pic)
172 .TP
173 \fBcode-model\fR=[small,kernel,medium,large]
174 Choose the code model to use.
175 .TP
176 \fBmetadata\fR=val
177 Metadata to mangle symbol names with.
178 .TP
179 \fBextra-filename\fR=val
180 Extra data to put in each output filename.
181 .TP
182 \fBcodegen-units\fR=val
183 Divide crate into N units to optimize in parallel.
184 .TP
185 \fBremark\fR=val
186 Print remarks for these optimization passes (space separated, or "all").
187 .TP
188 \fBno-stack-check\fR
189 Disable checks for stack exhaustion (a memory-safety hazard!).
190 .TP
191 \fBdebuginfo\fR=val
192 Debug info emission level:
193     0 = no debug info;
194     1 = line-tables only (for stacktraces and breakpoints);
195     2 = full debug info with variable and type information.
196 .TP
197 \fBopt-level\fR=val
198 Optimize with possible levels 0-3
199
200 .SH "EXAMPLES"
201 To build an executable from a source file with a main function:
202     $ rustc -o hello hello.rs
203
204 To build a library from a source file:
205     $ rustc --crate-type=lib hello-lib.rs
206
207 To build either with a crate (.rs) file:
208     $ rustc hello.rs
209
210 To build an executable with debug info:
211     $ rustc -g -o hello hello.rs
212
213 .SH "SEE ALSO"
214
215 rustdoc
216
217 .SH "BUGS"
218 See <\fBhttps://github.com/rust-lang/rust/issues\fR> for issues.
219
220 .SH "AUTHOR"
221 See \fBAUTHORS.txt\fR in the Rust source distribution.
222
223 .SH "COPYRIGHT"
224 This work is dual-licensed under Apache 2.0 and MIT terms.  See \fBCOPYRIGHT\fR
225 file in the rust source distribution.