|
1 |
| -.TH RUSTC "1" "January 2012" "Rust" "User Commands" |
2 |
| - |
| 1 | +.TH RUSTC "1" "October 2011" "Rust" "User Commands" |
3 | 2 | .SH NAME
|
4 | 3 | rustc \- rust compiler
|
5 |
| - |
6 | 4 | .SH SYNOPSIS
|
7 | 5 | rustc [\fB-h\fR] [\fB-v\fR] [\fB-o\fR \fIoutfile\fR]
|
8 | 6 | [\fB--lib\fR] [\fB--static\fR] [\fB-L\fR \fIpath\fR]
|
9 | 7 | [\fB-g\fR] [\fB-S\fR] [\fB-c\fR] <\fIinput\fR>
|
10 | 8 | .PP
|
11 | 9 | Only the most commonly-used options are listed here. All options are listed and
|
12 | 10 | described below.
|
13 |
| - |
14 | 11 | .SH DESCRIPTION
|
15 | 12 | This program is a compiler for the Rust language, available at
|
16 | 13 | <\fBhttps://www.rust-lang.org\fR>.
|
17 |
| - |
18 | 14 | .SH OPTIONS
|
19 | 15 | .TP
|
20 |
| -\fB--bin\fR |
21 |
| -Compile an executable crate (default) |
| 16 | +\fB-h, --help\fR: |
| 17 | +Display help. |
22 | 18 | .TP
|
23 |
| -\fB-c\fR |
24 |
| -Compile and assemble, but do not link |
| 19 | +\fB-v, --version\fR: |
| 20 | +Display version information. |
25 | 21 | .TP
|
26 |
| -\fB--cfg <cfgspec>\fR |
27 |
| -Configure the compilation environment |
| 22 | +\fB-o\fR \fIfilename\fR: |
| 23 | +Write output to \fIfilename\fR. The default |
| 24 | +output filename for \fBfoo.rs\fR is otherwise \fBfoo\fR plus any |
| 25 | +platform-specific extension (when compiling a binary), a |
| 26 | +platform-specific name, e.g. \fBlibfoo.so\fR (when compiling a |
| 27 | +library), \fBfoo.o\fR (when using \fB-c\fR), \fBfoo.s\fR (when using |
| 28 | +\fB-S\fR) or \fBfoo.bc\fR (when using \fB--emit-llvm\fR), and \fBfoo.ll\fR |
| 29 | +(when using both \fB-S\fR and \fB--emit-llvm\fR). |
28 | 30 | .TP
|
29 |
| -\fB--emit-llvm\fR |
30 |
| -Produce an LLVM bitcode file |
| 31 | +\fB--lib\fR: |
| 32 | +Compile and link a library crate into a shared object. |
31 | 33 | .TP
|
32 |
| -\fB-g\fR |
33 |
| -Produce debug info |
| 34 | +\fB--static\fR: |
| 35 | +Produce a statically-linked binary, or generate a static |
| 36 | +library. |
34 | 37 | .TP
|
35 |
| -\fB--gc\fR |
36 |
| -Garbage collect shared data (experimental/temporary) |
| 38 | +\fB--pretty\fR \fI[type]\fR: |
| 39 | +Pretty-print the input. Valid \fItype\fRs are: |
| 40 | +.RS |
37 | 41 | .TP
|
38 |
| -\fB-h --help\fR |
39 |
| -Display this message |
| 42 | +\fBnormal\fR: Un-annotated source (default). |
40 | 43 | .TP
|
41 |
| -\fB-L <path>\fR |
42 |
| -Add a directory to the library search path |
| 44 | +\fBexpanded\fR: Crates expanded. |
43 | 45 | .TP
|
44 |
| -\fB--lib\fR |
45 |
| -Compile a library crate |
| 46 | +\fBtyped\fR: Crates expanded, all expressions annotated with types. |
46 | 47 | .TP
|
47 |
| -\fB--ls\fR |
48 |
| -List the symbols defined by a compiled librar crate |
| 48 | +\fBidentified\fR: Fully parenthesized, ast nodes and blocks annotated with IDs. |
| 49 | +.RE |
49 | 50 | .TP
|
50 |
| -\fB--no-asm-comments\fR |
51 |
| -Do not add comments into the assembly source |
| 51 | +\fB--ls\fR: |
| 52 | +Lists symbols defined by the specified \fBcompiled\fR library. |
52 | 53 | .TP
|
53 |
| -\fB--no-lint-ctypes\fR |
54 |
| -Suppress warnings for possibly incorrect ctype usage |
| 54 | +\fB-L\fR \fIpath\fR: |
| 55 | +Adds \fIpath\fR to the library search path. |
55 | 56 | .TP
|
56 |
| -\fB--no-trans\fR |
57 |
| -Run all passes except translation; no output |
| 57 | +\fB--noverify\fR: |
| 58 | +Disables LLVM verification pass, which does sanity checking of |
| 59 | +bitcode generated by rustc. Using this option gives a slight speedup, at the |
| 60 | +cost of vastly reduced ability to catch rustc bugs. See |
| 61 | +<\fBhttp://llvm.org/docs/Passes.html\fR> for a list of properties checked. |
58 | 62 | .TP
|
59 |
| -\fB--no-verify\fR |
60 |
| -Suppress LLVM verification step (slight speedup) |
61 |
| -(see http://llvm.org/docs/Passes.html for detail) |
| 63 | +\fB--parse-only\fR: |
| 64 | +Run the parse phase only. If parsing succeeds, produces no |
| 65 | +output. |
62 | 66 | .TP
|
63 |
| -\fB-O\fR |
64 |
| -Equivalent to --opt-level=2 |
| 67 | +\fB--no-trans\fR: |
| 68 | +Run all passes except translation. Produces no output. |
65 | 69 | .TP
|
66 |
| -\fB-o <filename>\fR |
67 |
| -Write output to <filename> |
| 70 | +\fB-g\fR: |
| 71 | +Produce debug info. |
68 | 72 | .TP
|
69 |
| -\fB--opt-level <lvl>\fR |
70 |
| -Optimize with possible levels 0-3 |
| 73 | +\fB--opt-level\fR \fIlevel\fR: |
| 74 | +Set optimization level to \fIlevel\fR. |
71 | 75 | .TP
|
72 |
| -\fB--out-dir <dir>\fR |
73 |
| -Write output to compiler-chosen filename in <dir> |
| 76 | +\fB-O\fR: |
| 77 | +Equal to --opt-level=2 |
74 | 78 | .TP
|
75 |
| -\fB--parse-only\fR |
76 |
| -Parse only; do not compile, assemble, or link |
| 79 | +\fB-S\fR: |
| 80 | +Compile to assembly, but do not assemble or link. |
77 | 81 | .TP
|
78 |
| -\fB--pretty [type]\fR |
79 |
| -Pretty-print the input instead of compiling; valid types are: \fBnormal\fR (un-annotated source), \fBexpanded\fR (crates expanded), \fBtyped\fR (crates expanded, with type annotations), or \fBidentified\fR (fully parenthesized, AST nodes and blocks with IDs) |
| 82 | +\fB-c\fR: |
| 83 | +Compile and assemble, but do not link. |
80 | 84 | .TP
|
81 |
| -\fB-S\fR |
82 |
| -Compile only; do not assemble or link |
| 85 | +\fB--emit-llvm\fR: |
| 86 | +Generate output files in LLVM format. When used with \fB-S\fR this generate LLVM |
| 87 | +intermediate language assembly files, otherwise this generates LLVM bitcode |
| 88 | +format object files. |
83 | 89 | .TP
|
84 |
| -\fB--save-temps\fR |
85 |
| -Write intermediate files (.bc, .opt.bc, .o) in addition to normal output |
| 90 | +\fB--save-temps\fR: |
| 91 | +For foo.rs, save generated bitcode before optimization to |
| 92 | +\fBfoo.bc\fR, bitcode after optimization to \fBfoo.opt.bc\fR, and the generated |
| 93 | +object file to \fBfoo.o\fR. |
86 | 94 | .TP
|
87 |
| -\fB--static\fR |
88 |
| -Use or produce static libraries or binaries |
| 95 | +\fB--stats\fR: |
| 96 | +Print statistics about compilation. |
89 | 97 | .TP
|
90 |
| -\fB--stats\fR |
91 |
| -Print compilation statistics |
| 98 | +\fB--cfg\fR \fIcfgspec\fR: |
| 99 | +Provide a crate config spec. |
92 | 100 | .TP
|
93 |
| -\fB--sysroot <path>\fR |
94 |
| -Override the system root |
| 101 | +\fB--time-passes\fR: |
| 102 | +Print runtimes of compilation phases. |
95 | 103 | .TP
|
96 |
| -\fB--test\fR |
97 |
| -Build test harness |
| 104 | +\fB--time-llvm-passes\fR: |
| 105 | +Print runtimes of llvm phases. |
98 | 106 | .TP
|
99 |
| -\fB--target <triple>\fR |
100 |
| -Target cpu-manufacturer-kernel[-os] to compile for (default: host triple) |
101 |
| -(see http://sources.redhat.com/autobook/autobook/autobook_17.html for detail) |
| 107 | +\fB--sysroot\fR \fIpath\fR: |
| 108 | +Set the system root. Default is the directory above |
| 109 | +rustc's. |
102 | 110 | .TP
|
103 |
| -\fB--time-passes\fR |
104 |
| -Time the individual phases of the compiler |
| 111 | +\fB--target\fR \fIgnu-config-name\fR: |
| 112 | +Set the compilation target, which is a |
| 113 | +string of the form \fBcpu\fR-\fBmanufacturer\fR-\fBkernel\fR[-\fBos\fR]. Example |
| 114 | +values include "i686-unknown-linux-gnu" and "mips-idt-ecoff"; see |
| 115 | +<\fBhttp://sources.redhat.com/autobook/autobook/autobook_17.html\fR>. If not |
| 116 | +supplied, the host triple is used (see \fB--version\fR output). |
105 | 117 | .TP
|
106 |
| -\fB--time-llvm-passes\fR |
107 |
| -Time the individual phases of the LLVM backend |
| 118 | +\fB--test\fR: |
| 119 | +Build a test harness. |
108 | 120 | .TP
|
109 |
| -\fB-v --version\fR |
110 |
| -Print version info and exit |
| 121 | +\fB--gc\fR: |
| 122 | +\fBEXPERIMENTAL\fR. Garbage-collect shared data. |
111 | 123 | .TP
|
112 |
| -\fB--warn-unused-imports\fR |
113 |
| -Warn about unnecessary imports |
114 |
| - |
115 |
| -.SH "EXAMPLES" |
116 |
| -To build an executable from a source file with a main function: |
117 |
| - $ rustc -o hello hello.rs |
118 |
| - |
119 |
| -To build a library from a source file: |
120 |
| - $ rustc --lib hello-lib.rs |
121 |
| - |
122 |
| -To build either with a crate (.rc) file: |
123 |
| - $ rustc hello.rc |
124 |
| - |
| 124 | +\fB--warn-unused-imports\fR: |
| 125 | +Warn about unnecessary imports. |
| 126 | +.TP |
| 127 | +\fB--no-lint-ctypes\fR: |
| 128 | +Disables checking of possibly incorrect usage of Rust int or uint types in |
| 129 | +native function declarations, where types defined in libcore::ctypes should be |
| 130 | +used instead. Ctypes check emits warnings by default. |
125 | 131 | .SH "BUGS"
|
126 | 132 | See \fBhttps://github.com/mozilla/rust/issues\fR for a list of known bugs.
|
127 |
| - |
128 | 133 | .SH "AUTHOR"
|
129 | 134 | See \fBAUTHORS.txt\fR in the rust source distribution. Graydon Hoare
|
130 | 135 | < \fI[email protected]\fR> is the project leader.
|
131 |
| - |
132 | 136 | .SH "COPYRIGHT"
|
133 | 137 | See \fBLICENSE.txt\fR in the rust source distribution.
|
134 |
| - |
|
0 commit comments