rust/man/rustc.1

125 lines
2.8 KiB
Groff
Raw Normal View History

.TH RUSTC "1" "October 2012" "rustc 0.4" "User Commands"
.SH NAME
rustc \- rust compiler
.SH SYNOPSIS
2012-05-26 15:15:28 +00:00
.B rustc
[\fIoptions\fR] \fI<input>\fR
2012-01-31 03:02:20 +00:00
.SH DESCRIPTION
This program is a compiler for the Rust language, available at
<\fBhttps://www.rust-lang.org\fR>.
2012-01-31 03:02:20 +00:00
.SH OPTIONS
2012-05-26 15:15:28 +00:00
.TP
2012-05-26 15:15:28 +00:00
\fB\-\-bin\fR
2012-01-31 03:02:20 +00:00
Compile an executable crate (default)
.TP
2012-05-26 15:15:28 +00:00
\fB\-c\fR
2012-01-31 03:02:20 +00:00
Compile and assemble, but do not link
.TP
2012-05-26 15:15:28 +00:00
\fB\-\-cfg\fR <cfgspec>
2012-01-31 03:02:20 +00:00
Configure the compilation environment
.TP
2012-05-26 15:15:28 +00:00
\fB\-\-emit\-llvm\fR
2012-01-31 03:02:20 +00:00
Produce an LLVM bitcode file
.TP
2012-05-26 15:15:28 +00:00
\fB\-g\fR
2012-07-03 00:21:08 +00:00
Produce debug info (experimental)
.TP
2012-05-26 15:15:28 +00:00
\fB\-\-gc\fR
2012-01-31 03:02:20 +00:00
Garbage collect shared data (experimental/temporary)
.TP
2012-05-26 15:15:28 +00:00
\fB\-h\fR \fB\-\-help\fR
2012-01-31 03:02:20 +00:00
Display this message
.TP
2012-05-26 15:15:28 +00:00
\fB\-L\fR <path>
2012-01-31 03:02:20 +00:00
Add a directory to the library search path
.TP
2012-05-26 15:15:28 +00:00
\fB\-\-lib\fR
2012-01-31 03:02:20 +00:00
Compile a library crate
.TP
2012-05-26 15:15:28 +00:00
\fB\-\-ls\fR
List the symbols defined by a compiled library crate
.TP
\fB\-\-jit\fR
Execute using JIT (experimental)
.TP
2012-05-26 15:15:28 +00:00
\fB\-\-no\-trans\fR
2012-01-31 03:02:20 +00:00
Run all passes except translation; no output
.TP
2012-05-26 15:15:28 +00:00
\fB\-O\fR
Equivalent to \fB\-\-opt\-level\fR=\fI2\fR
.TP
2012-05-26 15:15:28 +00:00
\fB\-o\fR <filename>
2012-01-31 03:02:20 +00:00
Write output to <filename>
.TP
2012-05-26 15:15:28 +00:00
\fB\-\-opt\-level\fR <lvl>
Optimize with possible levels 0\-3
.TP
2012-05-26 15:15:28 +00:00
\fB\-\-out\-dir\fR <dir>
Write output to compiler\-chosen filename in <dir>
.TP
2012-05-26 15:15:28 +00:00
\fB\-\-parse\-only\fR
2012-01-31 03:02:20 +00:00
Parse only; do not compile, assemble, or link
.TP
2012-05-26 15:15:28 +00:00
\fB\-\-pretty\fR [type]
Pretty\-print the input instead of compiling;
valid types are: normal (un\-annotated source),
expanded (crates expanded), typed (crates expanded,
with type annotations), or identified (fully
2012-05-26 15:15:28 +00:00
parenthesized, AST nodes and blocks with IDs)
.TP
2012-05-26 15:15:28 +00:00
\fB\-S\fR
2012-01-31 03:02:20 +00:00
Compile only; do not assemble or link
.TP
2012-05-26 15:15:28 +00:00
\fB\-\-save\-temps\fR
Write intermediate files (.bc, .opt.bc, .o)
in addition to normal output
.TP
2012-05-26 15:15:28 +00:00
\fB\-\-static\fR
Use or produce static libraries or binaries
(experimental)
.TP
2012-05-26 15:15:28 +00:00
\fB\-\-sysroot\fR <path>
2012-01-31 03:02:20 +00:00
Override the system root
.TP
2012-05-26 15:15:28 +00:00
\fB\-\-test\fR
Build a test harness
.TP
2012-05-26 15:15:28 +00:00
\fB\-\-target\fR <triple>
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\-W help\fR
Print 'lint' options and default settings
.TP
\fB\-Z help\fR
Print internal options for debugging rustc
.TP
2012-05-26 15:15:28 +00:00
\fB\-v\fR \fB\-\-version\fR
Print version info and exit
2012-01-31 03:02:20 +00:00
.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 issues.
2012-01-31 03:02:20 +00:00
.SH "AUTHOR"
See \fBAUTHORS.txt\fR in the rust source distribution. Graydon Hoare
<\fIgraydon@mozilla.com\fR> is the project leader.
2012-01-31 03:02:20 +00:00
.SH "COPYRIGHT"
This work is licensed under MIT-like terms. See \fBLICENSE.txt\fR
in the rust source distribution.