2011-10-25 22:05:41 -05:00
|
|
|
.TH RUSTC "1" "October 2011" "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://github.com/graydon/rust\fR>.
|
|
|
|
.SH OPTIONS
|
|
|
|
.TP
|
2011-10-25 23:22:38 -05:00
|
|
|
\fB-h, --help\fR:
|
|
|
|
Display help.
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2011-10-25 23:22:38 -05:00
|
|
|
\fB-v, --version\fR:
|
|
|
|
Display version information.
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2011-10-25 23:22:38 -05:00
|
|
|
\fB-o\fR \fIfilename\fR:
|
2011-10-28 14:04:53 -05:00
|
|
|
Write output to \fIfilename\fR. The default
|
|
|
|
output filename for \fBfoo.rs\fR is otherwise \fBfoo\fR plus any
|
|
|
|
platform-specific extension (when compiling a binary), a
|
|
|
|
platform-specific name, e.g. \fBlibfoo.so\fR (when compiling a
|
|
|
|
library), \fBfoo.o\fR (when using \fB-c\fR), \fBfoo.s\fR (when using
|
2011-11-07 22:37:42 -06:00
|
|
|
\fB-S\fR) or \fBfoo.bc\fR (when using \fB--emit-llvm\fR), and \fBfoo.ll\fR
|
|
|
|
(when using both \fB-S\fR and \fB--emit-llvm\fR).
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2011-10-25 23:22:38 -05:00
|
|
|
\fB--lib\fR:
|
|
|
|
Compile and link a library crate into a shared object.
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2011-10-25 23:22:38 -05:00
|
|
|
\fB--static\fR:
|
|
|
|
Produce a statically-linked binary, or generate a static
|
2011-10-25 22:05:41 -05:00
|
|
|
library.
|
|
|
|
.TP
|
2011-10-28 14:53:57 -05:00
|
|
|
\fB--pretty\fR \fI[type]\fR:
|
2011-10-25 23:22:38 -05:00
|
|
|
Pretty-print the input. Valid \fItype\fRs are:
|
2011-10-25 22:05:41 -05:00
|
|
|
.RS
|
|
|
|
.TP
|
2011-10-28 14:53:57 -05:00
|
|
|
\fBnormal\fR: Un-annotated source (default).
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
|
|
|
\fBexpanded\fR: Crates expanded.
|
|
|
|
.TP
|
|
|
|
\fBtyped\fR: Crates expanded, all expressions annotated with types.
|
|
|
|
.TP
|
|
|
|
\fBidentified\fR: Fully parenthesized, ast nodes and blocks annotated with IDs.
|
|
|
|
.RE
|
|
|
|
.TP
|
2011-10-25 23:22:38 -05:00
|
|
|
\fB--ls\fR:
|
|
|
|
Lists symbols defined by the specified \fBcompiled\fR library.
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2011-10-25 23:22:38 -05:00
|
|
|
\fB-L\fR \fIpath\fR:
|
|
|
|
Adds \fIpath\fR to the library search path.
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2011-10-25 23:22:38 -05:00
|
|
|
\fB--noverify\fR:
|
|
|
|
Disables LLVM verification pass, which does sanity checking of
|
2011-10-25 22:05:41 -05:00
|
|
|
bitcode generated by rustc. Using this option gives a slight speedup, at the
|
|
|
|
cost of vastly reduced ability to catch rustc bugs. See
|
|
|
|
<\fBhttp://llvm.org/docs/Passes.html\fR> for a list of properties checked.
|
|
|
|
.TP
|
2011-10-25 23:22:38 -05:00
|
|
|
\fB--parse-only\fR:
|
|
|
|
Run the parse phase only. If parsing succeeds, produces no
|
2011-10-25 22:05:41 -05:00
|
|
|
output.
|
|
|
|
.TP
|
2011-10-25 23:22:38 -05:00
|
|
|
\fB--no-trans\fR:
|
|
|
|
Run all passes except translation. Produces no output.
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2011-10-28 14:45:14 -05:00
|
|
|
\fB-g\fR:
|
|
|
|
Produce debug info.
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2011-10-28 14:53:57 -05:00
|
|
|
\fB--opt-level\fR \fIlevel\fR:
|
2011-10-25 23:22:38 -05:00
|
|
|
Set optimization level to \fIlevel\fR.
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2011-10-25 23:22:38 -05:00
|
|
|
\fB-O\fR:
|
2011-10-28 14:49:19 -05:00
|
|
|
Equal to --opt-level=2
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2011-10-25 23:22:38 -05:00
|
|
|
\fB-S\fR:
|
|
|
|
Compile to assembly, but do not assemble or link.
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2011-10-25 23:22:38 -05:00
|
|
|
\fB-c\fR:
|
|
|
|
Compile and assemble, but do not link.
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2011-10-25 23:22:38 -05:00
|
|
|
\fB--emit-llvm\fR:
|
2011-11-07 22:37:42 -06:00
|
|
|
Generate output files in LLVM format. When used with \fB-S\fR this generate LLVM
|
|
|
|
intermediate language assembly files, otherwise this generates LLVM bitcode
|
|
|
|
format object files.
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2011-10-25 23:22:38 -05:00
|
|
|
\fB--save-temps\fR:
|
|
|
|
For foo.rs, save generated bitcode before optimization to
|
2011-10-25 22:05:41 -05:00
|
|
|
\fBfoo.bc\fR, bitcode after optimization to \fBfoo.opt.bc\fR, and the generated
|
|
|
|
object file to \fBfoo.o\fR.
|
|
|
|
.TP
|
2011-10-25 23:22:38 -05:00
|
|
|
\fB--stats\fR:
|
|
|
|
Print statistics about compilation.
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2011-10-25 23:22:38 -05:00
|
|
|
\fB--cfg\fR \fIcfgspec\fR:
|
|
|
|
Provide a crate config spec.
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2011-10-25 23:22:38 -05:00
|
|
|
\fB--time-passes\fR:
|
|
|
|
Print runtimes of compilation phases.
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2011-10-25 23:22:38 -05:00
|
|
|
\fB--time-llvm-passes\fR:
|
|
|
|
Print runtimes of llvm phases.
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2011-10-25 23:22:38 -05:00
|
|
|
\fB--sysroot\fR \fIpath\fR:
|
|
|
|
Set the system root. Default is the directory above
|
2011-10-25 22:32:10 -05:00
|
|
|
rustc's.
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2011-10-25 23:22:38 -05:00
|
|
|
\fB--target\fR \fIgnu-config-name\fR:
|
|
|
|
Set the compilation target, which is a
|
2011-10-25 22:05:41 -05:00
|
|
|
string of the form \fBcpu\fR-\fBmanufacturer\fR-\fBkernel\fR[-\fBos\fR]. Example
|
|
|
|
values include "i686-unknown-linux-gnu" and "mips-idt-ecoff"; see
|
|
|
|
<\fBhttp://sources.redhat.com/autobook/autobook/autobook_17.html\fR>. If not
|
|
|
|
supplied, the host triple is used (see \fB--version\fR output).
|
|
|
|
.TP
|
2011-10-25 23:22:38 -05:00
|
|
|
\fB--test\fR:
|
|
|
|
Build a test harness.
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2011-10-25 23:22:38 -05:00
|
|
|
\fB--gc\fR:
|
|
|
|
\fBEXPERIMENTAL\fR. Garbage-collect shared data.
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2011-10-25 23:22:38 -05:00
|
|
|
\fB--stack-growth\fR:
|
|
|
|
\fBEXPERIMENTAL\fR. Perform stack growth checks.
|
2011-10-25 22:05:41 -05:00
|
|
|
.SH "BUGS"
|
|
|
|
See \fBhttps://github.com/graydon/rust/issues\fR for a list of known bugs.
|
|
|
|
.SH "AUTHOR"
|
|
|
|
See \fBAUTHORS.txt\fR in the rust source distribution. Graydon Hoare
|
|
|
|
<\fIgraydon@mozilla.com\fR> is the project leader.
|
|
|
|
.SH "COPYRIGHT"
|
|
|
|
See \fBLICENSE.txt\fR in the rust source distribution.
|