aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/doc.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2016-04-26 21:50:59 -0400
committerRuss Cox <rsc@golang.org>2016-05-09 17:31:45 +0000
commitfeb6131b1a4c0da098821c516e06499add886182 (patch)
tree1e5eca4df54a33267f31a9fa25e0a611012dc255 /src/cmd/compile/doc.go
parentaeecee8ce4cf1821dcb6b5e37e20f40696278498 (diff)
downloadgo-feb6131b1a4c0da098821c516e06499add886182.tar.gz
go-feb6131b1a4c0da098821c516e06499add886182.zip
cmd/compile: add -linkobj flag to allow writing object file in two parts
This flag is experimental and the semantics may change even after Go 1.7 is released. There are no changes to code not using the flag. The first part is for reading by future compiles. The second part is for reading by the final link step. Splitting the file this way allows distributed build systems to ship the compile-input part only to compile steps and the linker-input part only to linker steps. The first part is basically just the export data, and the second part is basically everything else. The overall files still have the same broad structure, so that existing tools will work with both halves. It's just that various pieces are empty in the two halves. This also copies the two bits of data the linker needed from export data into the object header proper, so that the linker doesn't need any export data at all. That eliminates a TODO that was left for switching to the binary export data. (Now the linker doesn't need to know about the switch.) The default is still to write out a combined output file. Nothing changes unless you pass -linkobj to the compiler. There is no support in the go command for -linkobj, since the go command doesn't copy objects around. The expectation is that other build systems (like bazel, say) might take advantage of this. The header adjustment and the option for the split output was intended as part of the zip archives, but the zip archives have been cut from Go 1.7. Doing this to the current archives both unblocks one step in the switch to binary export data and enables alternate build systems to experiment with the new flag using the Go 1.7 release. Change-Id: I8b6eab25b8a22b0a266ba0ac6d31e594f3d117f3 Reviewed-on: https://go-review.googlesource.com/22500 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/cmd/compile/doc.go')
-rw-r--r--src/cmd/compile/doc.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cmd/compile/doc.go b/src/cmd/compile/doc.go
index 2b45e5b998..6783c2e846 100644
--- a/src/cmd/compile/doc.go
+++ b/src/cmd/compile/doc.go
@@ -61,7 +61,12 @@ Flags:
Look for packages in $GOROOT/pkg/$GOOS_$GOARCH_suffix
instead of $GOROOT/pkg/$GOOS_$GOARCH.
-largemodel
- Generated code that assumes a large memory model.
+ Generate code that assumes a large memory model.
+ -linkobj file
+ Write linker-specific object to file and compiler-specific
+ object to usual output file (as specified by -o).
+ Without this flag, the -o output is a combination of both
+ linker and compiler input.
-memprofile file
Write memory profile for the compilation to file.
-memprofilerate rate