Update man page with the new options
This pull request updates the rustc manual page to represent post-#19900 state of rustc options better. A bit unrelatedly, --help output is changed to fix some issues too: * -g and -O descriptions were changed from deprected flags to the new codegen flags. * dep-info value was moved from crate-type to emit flag. Fixes #20111 Fixes #20131
This commit is contained in:
parent
34d6800092
commit
faa00949d9
2 changed files with 83 additions and 56 deletions
131
man/rustc.1
131
man/rustc.1
|
@ -12,75 +12,54 @@ This program is a compiler for the Rust language, available at
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-crate-name NAME\fR
|
\fB\-h\fR, \fB\-\-help\fR
|
||||||
Specify the name of the crate being built
|
Display the help message
|
||||||
.TP
|
|
||||||
\fB\-\-crate-type=[bin|lib|dylib|rlib|staticlib]\fR
|
|
||||||
Configure the flavor of rust crate that is generated (default `bin`)
|
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-cfg\fR SPEC
|
\fB\-\-cfg\fR SPEC
|
||||||
Configure the compilation environment
|
Configure the compilation environment
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-emit=[asm,ir,bc,obj,link]\fR
|
|
||||||
Configure the output that rustc will produce
|
|
||||||
.TP
|
|
||||||
\fB\-h\fR, \fB\-\-help\fR
|
|
||||||
Display this message
|
|
||||||
.TP
|
|
||||||
\fB\-L\fR PATH
|
\fB\-L\fR PATH
|
||||||
Add a directory to the library search path
|
Add a directory to the library search path
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-no\-trans\fR
|
\fB\-l\fR NAME[:KIND]
|
||||||
Run all passes except translation; no output
|
Link the generated crate(s) to the specified native library NAME. The optional
|
||||||
|
KIND can be one of, static, dylib, or framework. If omitted, dylib is assumed.
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-no\-analysis\fR
|
\fB\-\-crate-type\fR [bin|lib|rlib|dylib|staticlib]
|
||||||
Parse and expand the source, but run no analysis and produce no output
|
Comma separated list of types of crates for the compiler to emit
|
||||||
|
.TP
|
||||||
|
\fB\-\-crate-name NAME\fR
|
||||||
|
Specify the name of the crate being built
|
||||||
|
.TP
|
||||||
|
\fB\-\-emit\fR [asm|llvm-bc|llvm-ir|obj|link|dep-info]
|
||||||
|
Configure the output that rustc will produce
|
||||||
|
.TP
|
||||||
|
\fB\-\-print\fR [crate-name|output-file-names|sysroot]
|
||||||
|
Comma separated list of compiler information to print on stdout
|
||||||
.TP
|
.TP
|
||||||
\fB\-g\fR
|
\fB\-g\fR
|
||||||
Emit DWARF debug information into object files generated.
|
Equivalent to \fI\-C\fR debuginfo=2
|
||||||
.TP
|
|
||||||
\fB\-\-debuginfo\fR LEVEL
|
|
||||||
Emit DWARF debug info to the objects created: 0 = no debug info, 1 =
|
|
||||||
line-tables only (for stacktraces and breakpoints), 2 = full debug
|
|
||||||
info with variable and type information (same as -g).
|
|
||||||
.TP
|
.TP
|
||||||
\fB\-O\fR
|
\fB\-O\fR
|
||||||
Equivalent to \fI\-\-opt\-level=2\fR
|
Equivalent to \fI\-C\fR opt-level=2
|
||||||
.TP
|
.TP
|
||||||
\fB\-o\fR FILENAME
|
\fB\-o\fR FILENAME
|
||||||
Write output to <filename>. Ignored if more than one --emit is specified.
|
Write output to <filename>. Ignored if multiple \fI\-\-emit\fR outputs are
|
||||||
.TP
|
specified.
|
||||||
\fB\-\-opt\-level\fR LEVEL
|
|
||||||
Optimize with possible levels 0-3
|
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-out\-dir\fR DIR
|
\fB\-\-out\-dir\fR DIR
|
||||||
Write output to compiler-chosen filename in <dir>. Ignored if -o is specified.
|
Write output to compiler-chosen filename in <dir>. Ignored if \fI\-o\fR is
|
||||||
(default the current directory)
|
specified. Defaults to the current directory.
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-parse\-only\fR
|
\fB\-\-explain\fR OPT
|
||||||
Parse only; do not compile, assemble, or link
|
Provide a detailed explanation of an error message
|
||||||
.TP
|
|
||||||
\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), identified (fully parenthesized,
|
|
||||||
AST nodes and blocks with IDs), or flowgraph=<nodeid> (graphviz
|
|
||||||
formatted flowgraph for node)
|
|
||||||
.TP
|
|
||||||
\fB\-\-dep-info\fR [FILENAME]
|
|
||||||
Output dependency info to <filename> after compiling, in a format suitable
|
|
||||||
for use by Makefiles.
|
|
||||||
.TP
|
|
||||||
\fB\-\-sysroot\fR PATH
|
|
||||||
Override the system root
|
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-test\fR
|
\fB\-\-test\fR
|
||||||
Build a test harness
|
Build a test harness
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-target\fR TRIPLE
|
\fB\-\-target\fR TRIPLE
|
||||||
Target triple cpu-manufacturer-kernel[-os] to compile for (see
|
Target triple cpu-manufacturer-kernel[-os] to compile for (see chapter 3.4 of
|
||||||
http://sources.redhat.com/autobook/autobook/autobook_17.html
|
http://www.sourceware.org/autobook/ for details)
|
||||||
for details)
|
|
||||||
.TP
|
.TP
|
||||||
\fB\-W\fR help
|
\fB\-W\fR help
|
||||||
Print 'lint' options and default settings
|
Print 'lint' options and default settings
|
||||||
|
@ -97,15 +76,30 @@ Set lint denied
|
||||||
\fB\-F\fR OPT, \fB\-\-forbid\fR OPT
|
\fB\-F\fR OPT, \fB\-\-forbid\fR OPT
|
||||||
Set lint forbidden
|
Set lint forbidden
|
||||||
.TP
|
.TP
|
||||||
\fB\-Z\fR FLAG
|
|
||||||
Set internal debugging options. Use "-Z help" to print available options.
|
|
||||||
.TP
|
|
||||||
\fB\-C\fR FLAG[=VAL], \fB\-\-codegen\fR FLAG[=VAL]
|
\fB\-C\fR FLAG[=VAL], \fB\-\-codegen\fR FLAG[=VAL]
|
||||||
Set a codegen-related flag to the value specified. Use "-C help" to print
|
Set a codegen-related flag to the value specified. Use "-C help" to print
|
||||||
available flags. See CODEGEN OPTIONS below
|
available flags. See CODEGEN OPTIONS below
|
||||||
.TP
|
.TP
|
||||||
\fB\-v\fR, \fB\-\-version\fR
|
\fB\-V\fR, \fB\-\-version\fR
|
||||||
Print version info and exit
|
Print version info and exit
|
||||||
|
.TP
|
||||||
|
\fB\-v\fR, \fB\-\-verbose\fR
|
||||||
|
Use verbose output
|
||||||
|
.TP
|
||||||
|
\fB\-\-extern\fR NAME=PATH
|
||||||
|
Specify where an external rust library is located
|
||||||
|
.TP
|
||||||
|
\fB\-\-sysroot\fR PATH
|
||||||
|
Override the system root
|
||||||
|
.TP
|
||||||
|
\fB\-Z\fR FLAG
|
||||||
|
Set internal debugging options. Use "-Z help" to print available options.
|
||||||
|
.TP
|
||||||
|
\fB\-\-color\fR auto|always|never
|
||||||
|
Configure coloring of output:
|
||||||
|
auto = colorize, if output goes to a tty (default);
|
||||||
|
always = always colorize output;
|
||||||
|
never = never colorize output
|
||||||
|
|
||||||
.SH CODEGEN OPTIONS
|
.SH CODEGEN OPTIONS
|
||||||
|
|
||||||
|
@ -121,6 +115,9 @@ objects.
|
||||||
A space-separated list of extra arguments to pass to the linker when the linker
|
A space-separated list of extra arguments to pass to the linker when the linker
|
||||||
is invoked.
|
is invoked.
|
||||||
.TP
|
.TP
|
||||||
|
\fBlto\fR
|
||||||
|
Perform LLVM link-time optimizations.
|
||||||
|
.TP
|
||||||
\fBtarget-cpu\fR=help
|
\fBtarget-cpu\fR=help
|
||||||
Selects a target processor. If the value is 'help', then a list of available
|
Selects a target processor. If the value is 'help', then a list of available
|
||||||
CPUs is printed.
|
CPUs is printed.
|
||||||
|
@ -167,8 +164,38 @@ Prefers dynamic linking to static linking.
|
||||||
\fBno-integrated-as\fR
|
\fBno-integrated-as\fR
|
||||||
Force usage of an external assembler rather than LLVM's integrated one.
|
Force usage of an external assembler rather than LLVM's integrated one.
|
||||||
.TP
|
.TP
|
||||||
|
\fBno-redzone\fR
|
||||||
|
Disable the use of the redzone.
|
||||||
|
.TP
|
||||||
\fBrelocation-model\fR=[pic,static,dynamic-no-pic]
|
\fBrelocation-model\fR=[pic,static,dynamic-no-pic]
|
||||||
The relocation model to use. (default: pic)
|
The relocation model to use. (Default: pic)
|
||||||
|
.TP
|
||||||
|
\fBcode-model\fR=[small,kernel,medium,large]
|
||||||
|
Choose the code model to use.
|
||||||
|
.TP
|
||||||
|
\fBmetadata\fR=val
|
||||||
|
Metadata to mangle symbol names with.
|
||||||
|
.TP
|
||||||
|
\fBextra-filename\fR=val
|
||||||
|
Extra data to put in each output filename.
|
||||||
|
.TP
|
||||||
|
\fBcodegen-units\fR=val
|
||||||
|
Divide crate into N units to optimize in parallel.
|
||||||
|
.TP
|
||||||
|
\fBremark\fR=val
|
||||||
|
Print remarks for these optimization passes (space separated, or "all").
|
||||||
|
.TP
|
||||||
|
\fBno-stack-check\fR
|
||||||
|
Disable checks for stack exhaustion (a memory-safety hazard!).
|
||||||
|
.TP
|
||||||
|
\fBdebuginfo\fR=val
|
||||||
|
Debug info emission level:
|
||||||
|
0 = no debug info;
|
||||||
|
1 = line-tables only (for stacktraces and breakpoints);
|
||||||
|
2 = full debug info with variable and type information.
|
||||||
|
.TP
|
||||||
|
\fBopt-level\fR=val
|
||||||
|
Optimize with possible levels 0-3
|
||||||
|
|
||||||
.SH "EXAMPLES"
|
.SH "EXAMPLES"
|
||||||
To build an executable from a source file with a main function:
|
To build an executable from a source file with a main function:
|
||||||
|
|
|
@ -664,17 +664,17 @@ pub fn short_optgroups() -> Vec<getopts::OptGroup> {
|
||||||
assumed.", "NAME[:KIND]"),
|
assumed.", "NAME[:KIND]"),
|
||||||
optmulti("", "crate-type", "Comma separated list of types of crates
|
optmulti("", "crate-type", "Comma separated list of types of crates
|
||||||
for the compiler to emit",
|
for the compiler to emit",
|
||||||
"[bin|lib|rlib|dylib|staticlib|dep-info]"),
|
"[bin|lib|rlib|dylib|staticlib]"),
|
||||||
optopt("", "crate-name", "Specify the name of the crate being built",
|
optopt("", "crate-name", "Specify the name of the crate being built",
|
||||||
"NAME"),
|
"NAME"),
|
||||||
optmulti("", "emit", "Comma separated list of types of output for \
|
optmulti("", "emit", "Comma separated list of types of output for \
|
||||||
the compiler to emit",
|
the compiler to emit",
|
||||||
"[asm|llvm-bc|llvm-ir|obj|link]"),
|
"[asm|llvm-bc|llvm-ir|obj|link|dep-info]"),
|
||||||
optmulti("", "print", "Comma separated list of compiler information to \
|
optmulti("", "print", "Comma separated list of compiler information to \
|
||||||
print on stdout",
|
print on stdout",
|
||||||
"[crate-name|output-file-names|sysroot]"),
|
"[crate-name|output-file-names|sysroot]"),
|
||||||
optflag("g", "", "Equivalent to --debuginfo=2"),
|
optflag("g", "", "Equivalent to -C debuginfo=2"),
|
||||||
optflag("O", "", "Equivalent to --opt-level=2"),
|
optflag("O", "", "Equivalent to -C opt-level=2"),
|
||||||
optopt("o", "", "Write output to <filename>", "FILENAME"),
|
optopt("o", "", "Write output to <filename>", "FILENAME"),
|
||||||
optopt("", "out-dir", "Write output to compiler-chosen filename \
|
optopt("", "out-dir", "Write output to compiler-chosen filename \
|
||||||
in <dir>", "DIR"),
|
in <dir>", "DIR"),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue