···11-diff --git a/src/go/build/build.go b/src/go/build/build.go
22-index 9706b8b..f250751 100644
33---- a/src/go/build/build.go
44-+++ b/src/go/build/build.go
55-@@ -1513,7 +1513,7 @@ func init() {
66- }
77-88- // ToolDir is the directory containing build tools.
99--var ToolDir = filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
1010-+var ToolDir = runtime.GOTOOLDIR()
1111-1212- // IsLocalImport reports whether the import path is
1313- // a local import path, like ".", "..", "./foo", or "../foo".
1414-diff --git a/src/runtime/extern.go b/src/runtime/extern.go
1515-index 441dcd9..a50277e 100644
1616---- a/src/runtime/extern.go
1717-+++ b/src/runtime/extern.go
1818-@@ -230,6 +230,17 @@ func GOROOT() string {
1919- return sys.DefaultGoroot
2020- }
2121-2222-+// GOTOOLDIR returns the root of the Go tree.
2323-+// It uses the GOTOOLDIR environment variable, if set,
2424-+// or else the root used during the Go build.
2525-+func GOTOOLDIR() string {
2626-+ s := gogetenv("GOTOOLDIR")
2727-+ if s != "" {
2828-+ return s
2929-+ }
3030-+ return GOROOT() + "/pkg/tool/" + GOOS + "_" + GOARCH
3131-+}
3232-+
3333- // Version returns the Go tree's version string.
3434- // It is either the commit hash and date at the time of the build or,
3535- // when possible, a release tag like "go1.3".