Commit 8b7cf898 authored by yo-tak's avatar yo-tak Committed by Ian Lance Taylor

cmd/compile, cmd/link: document more flags

Fixes #26533

Change-Id: I5a48d667d474f3f222f9055e51131561a0cf45b6
Reviewed-on: https://go-review.googlesource.com/c/138757
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 9d23975d
......@@ -44,8 +44,12 @@ Flags:
Print compiler version and exit.
-asmhdr file
Write assembly header to file.
-buildid id
Record id as the build id in the export metadata.
-blockprofile file
Write block profile for the compilation to file.
-c int
Concurrency during compilation. Set 1 for no concurrency (default is 1).
-complete
Assume package has no non-Go components.
-cpuprofile file
......@@ -54,8 +58,14 @@ Flags:
Allow references to Go symbols in shared libraries (experimental).
-e
Remove the limit on the number of errors reported (default limit is 10).
-goversion string
Specify required go tool version of the runtime.
Exits when the runtime go version does not match goversion.
-h
Halt with a stack trace at the first error detected.
-importcfg file
Read import configuration from file.
In the file, set importmap, packagefile to specify import resolution.
-importmap old=new
Interpret import "old" as import "new" during compilation.
The option may be repeated to add multiple mappings.
......@@ -74,6 +84,8 @@ Flags:
object to usual output file (as specified by -o).
Without this flag, the -o output is a combination of both
linker and compiler input.
-m
Print optimization decisions.
-memprofile file
Write memory profile for the compilation to file.
-memprofilerate rate
......@@ -93,11 +105,50 @@ Flags:
Write a package (archive) file rather than an object file
-race
Compile with race detector enabled.
-s
Warn about composite literals that can be simplified.
-shared
Generate code that can be linked into a shared library.
-traceprofile file
Write an execution trace to file.
-trimpath prefix
Remove prefix from recorded source file paths.
There are also a number of debugging flags; run the command with no arguments
for a usage message.
Flags related to debugging information:
-dwarf
Generate DWARF symbols.
-dwarflocationlists
Add location lists to DWARF in optimized mode.
-gendwarfinl int
Generate DWARF inline info records (default 2).
Flags to debug the compiler itself:
-E
Debug symbol export.
-K
Debug missing line numbers.
-d list
Print debug information about items in list. Try -d help for further information.
-live
Debug liveness analysis.
-v
Increase debug verbosity.
-%
Debug non-static initializers.
-W
Debug parse tree after type checking.
-f
Debug stack frames.
-i
Debug line number stack.
-j
Debug runtime-initialized variables.
-r
Debug generated wrappers.
-w
Debug type checking.
Compiler Directives
......
......@@ -43,8 +43,16 @@ Flags:
or initialized to a constant string expression. -X will not work if the initializer makes
a function call or refers to other variables.
Note that before Go 1.5 this option took two separate arguments.
-a
Disassemble output.
-buildid id
Record id as Go toolchain build id.
-buildmode mode
Set build mode (default exe).
-c
Dump call graphs.
-compressdwarf
Compress DWARF if possible (default true).
-cpuprofile file
Write CPU profile to file.
-d
......@@ -54,6 +62,10 @@ Flags:
The dynamic header is on by default, even without any
references to dynamic libraries, because many common
system tools now assume the presence of the header.
-debugtramp int
Debug trampolines.
-dumpdep
Dump symbol dependency graph.
-extar ar
Set the external archive program (default "ar").
Used only for -buildmode=c-archive.
......@@ -65,9 +77,14 @@ Flags:
Ignore version mismatch in the linked archives.
-g
Disable Go package data checks.
-importcfg file
Read import configuration from file.
In the file, set packagefile, packageshlib to specify import resolution.
-installsuffix suffix
Look for packages in $GOROOT/pkg/$GOOS_$GOARCH_suffix
instead of $GOROOT/pkg/$GOOS_$GOARCH.
-k symbol
Set field tracking symbol. Use this flag when GOEXPERIMENT=fieldtrack is set.
-libgcc file
Set name of compiler support library.
This is only used in internal link mode.
......@@ -85,6 +102,8 @@ Flags:
Set runtime.MemProfileRate to rate.
-msan
Link with C/C++ memory sanitizer support.
-n
Dump symbol table.
-o file
Write output to file (default a.out, or a.out.exe on Windows).
-pluginpath path
......@@ -100,6 +119,8 @@ Flags:
-tmpdir dir
Write temporary files to dir.
Temporary files are only used in external linking mode.
-u
Reject unsafe packages.
-v
Print trace of linker operations.
-w
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment