]> Cypherpunks repositories - gostls13.git/commit
cmd/go: put computed GOROOT in built binaries
authorDavid Crawshaw <crawshaw@golang.org>
Sun, 3 Sep 2017 16:33:56 +0000 (12:33 -0400)
committerDavid Crawshaw <crawshaw@golang.org>
Sat, 9 Sep 2017 16:59:35 +0000 (16:59 +0000)
commit06f4d93699ebbf05a500313c6b6ae6f80105d838
tree48a110a3dd8b871c2ad6a009f873a57215c43142
parentffb4708d1bcf4a391ecf293b01695565c1b7cd04
cmd/go: put computed GOROOT in built binaries

As of CL 42533, cmd/go will recompute its GOROOT based on the
location of its own executable. This CL plumbs that computed GOROOT
into every binary it builds using the linker -X flag. This
means binaries built with a moved cmd/go will report the GOROOT
they were built in from runtime.GOROOT().

Fixes #21313

Change-Id: I6c2c559f40f2a0c867ab60cf47c6dbc73ae5e28a
Reviewed-on: https://go-review.googlesource.com/61310
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/dist/buildruntime.go
src/cmd/go/go_test.go
src/cmd/go/internal/work/build.go
src/cmd/go/testdata/print_goroot.go [new file with mode: 0644]