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