forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrustc.1
134 lines (123 loc) · 3.19 KB
/
rustc.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
.TH RUSTC "1" "January 2012" "Rust" "User Commands"
.SH NAME
rustc \- rust compiler
.SH SYNOPSIS
rustc [\fB-h\fR] [\fB-v\fR] [\fB-o\fR \fIoutfile\fR]
[\fB--lib\fR] [\fB--static\fR] [\fB-L\fR \fIpath\fR]
[\fB-g\fR] [\fB-S\fR] [\fB-c\fR] <\fIinput\fR>
.PP
Only the most commonly-used options are listed here. All options are listed and
described below.
.SH DESCRIPTION
This program is a compiler for the Rust language, available at
<\fBhttps://www.rust-lang.org\fR>.
.SH OPTIONS
.TP
\fB--bin\fR
Compile an executable crate (default)
.TP
\fB-c\fR
Compile and assemble, but do not link
.TP
\fB--cfg <cfgspec>\fR
Configure the compilation environment
.TP
\fB--emit-llvm\fR
Produce an LLVM bitcode file
.TP
\fB-g\fR
Produce debug info
.TP
\fB--gc\fR
Garbage collect shared data (experimental/temporary)
.TP
\fB-h --help\fR
Display this message
.TP
\fB-L <path>\fR
Add a directory to the library search path
.TP
\fB--lib\fR
Compile a library crate
.TP
\fB--ls\fR
List the symbols defined by a compiled librar crate
.TP
\fB--no-asm-comments\fR
Do not add comments into the assembly source
.TP
\fB--no-lint-ctypes\fR
Suppress warnings for possibly incorrect ctype usage
.TP
\fB--no-trans\fR
Run all passes except translation; no output
.TP
\fB--no-verify\fR
Suppress LLVM verification step (slight speedup)
(see http://llvm.org/docs/Passes.html for detail)
.TP
\fB-O\fR
Equivalent to --opt-level=2
.TP
\fB-o <filename>\fR
Write output to <filename>
.TP
\fB--opt-level <lvl>\fR
Optimize with possible levels 0-3
.TP
\fB--out-dir <dir>\fR
Write output to compiler-chosen filename in <dir>
.TP
\fB--parse-only\fR
Parse only; do not compile, assemble, or link
.TP
\fB--pretty [type]\fR
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)
.TP
\fB-S\fR
Compile only; do not assemble or link
.TP
\fB--save-temps\fR
Write intermediate files (.bc, .opt.bc, .o) in addition to normal output
.TP
\fB--static\fR
Use or produce static libraries or binaries
.TP
\fB--stats\fR
Print compilation statistics
.TP
\fB--sysroot <path>\fR
Override the system root
.TP
\fB--test\fR
Build test harness
.TP
\fB--target <triple>\fR
Target cpu-manufacturer-kernel[-os] to compile for (default: host triple)
(see http://sources.redhat.com/autobook/autobook/autobook_17.html for detail)
.TP
\fB--time-passes\fR
Time the individual phases of the compiler
.TP
\fB--time-llvm-passes\fR
Time the individual phases of the LLVM backend
.TP
\fB-v --version\fR
Print version info and exit
.TP
\fB--warn-unused-imports\fR
Warn about unnecessary imports
.SH "EXAMPLES"
To build an executable from a source file with a main function:
$ rustc -o hello hello.rs
To build a library from a source file:
$ rustc --lib hello-lib.rs
To build either with a crate (.rc) file:
$ rustc hello.rc
.SH "BUGS"
See \fBhttps://github.com/mozilla/rust/issues\fR for a list of known bugs.
.SH "AUTHOR"
See \fBAUTHORS.txt\fR in the rust source distribution. Graydon Hoare
<\[email protected]\fR> is the project leader.
.SH "COPYRIGHT"
See \fBLICENSE.txt\fR in the rust source distribution.