2016-01-28 12:19:10 +00:00
|
|
|
diff -up go/src/cmd/dist/buildtool.go.bootstrap go/src/cmd/dist/buildtool.go
|
2017-01-27 10:39:40 +00:00
|
|
|
--- go/src/cmd/dist/buildtool.go.bootstrap 2016-10-24 12:54:57.620563325 +0200
|
|
|
|
+++ go/src/cmd/dist/buildtool.go 2016-10-24 13:12:25.036466602 +0200
|
|
|
|
@@ -131,17 +131,25 @@ func bootstrapBuildTools() {
|
2016-07-19 12:15:19 +00:00
|
|
|
defer os.Setenv("GOBIN", os.Getenv("GOBIN"))
|
2015-07-16 18:36:06 +00:00
|
|
|
os.Setenv("GOBIN", "")
|
|
|
|
|
|
|
|
+ hostos := os.Getenv("GOHOSTOS")
|
|
|
|
+ hostarch := os.Getenv("GOHOSTARCH")
|
2016-07-19 12:15:19 +00:00
|
|
|
+
|
|
|
|
os.Setenv("GOOS", "")
|
|
|
|
os.Setenv("GOHOSTOS", "")
|
|
|
|
os.Setenv("GOARCH", "")
|
2015-07-16 18:36:06 +00:00
|
|
|
os.Setenv("GOHOSTARCH", "")
|
|
|
|
|
|
|
|
+ bingopath := pathf("%s/bin/%s_%s/go", goroot_bootstrap, hostos, hostarch)
|
|
|
|
+ if _, err := os.Stat(bingopath); os.IsNotExist(err) {
|
|
|
|
+ bingopath = pathf("%s/bin/go", goroot_bootstrap)
|
|
|
|
+ }
|
|
|
|
+
|
2016-07-19 12:15:19 +00:00
|
|
|
// Run Go 1.4 to build binaries. Use -gcflags=-l to disable inlining to
|
|
|
|
// workaround bugs in Go 1.4's compiler. See discussion thread:
|
|
|
|
// https://groups.google.com/d/msg/golang-dev/Ss7mCKsvk8w/Gsq7VYI0AwAJ
|
2017-01-27 10:39:40 +00:00
|
|
|
// Use the math_big_pure_go build tag to disable the assembly in math/big
|
|
|
|
// which may contain unsupported instructions.
|
|
|
|
- run(workspace, ShowOutput|CheckExit, pathf("%s/bin/go", goroot_bootstrap), "install", "-gcflags=-l", "-tags=math_big_pure_go", "-v", "bootstrap/cmd/...")
|
|
|
|
+ run(workspace, ShowOutput|CheckExit, bingopath, "install", "-gcflags=-l", "-v", "-tags=math_big_pure_go", "bootstrap/...")
|
2015-07-16 18:36:06 +00:00
|
|
|
|
|
|
|
// Copy binaries into tool binary directory.
|
|
|
|
for _, name := range bootstrapDirs {
|
2016-01-28 12:19:10 +00:00
|
|
|
diff -up go/src/make.bash.bootstrap go/src/make.bash
|
2017-01-27 10:39:40 +00:00
|
|
|
--- go/src/make.bash.bootstrap 2016-10-24 12:54:57.606563267 +0200
|
|
|
|
+++ go/src/make.bash 2016-10-24 12:54:57.620563325 +0200
|
|
|
|
@@ -120,8 +120,15 @@ echo '##### Building Go bootstrap tool.'
|
2015-07-16 18:36:06 +00:00
|
|
|
echo cmd/dist
|
|
|
|
export GOROOT="$(cd .. && pwd)"
|
|
|
|
GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:-$HOME/go1.4}
|
|
|
|
-if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
|
|
|
|
- echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go." >&2
|
|
|
|
+if [ -x "$GOROOT_BOOTSTRAP/bin/${GOHOSTOS}_${GOHOSTARCH}/go" ]; then
|
|
|
|
+ rm -f cmd/dist/dist
|
|
|
|
+ GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/${GOHOSTOS}_${GOHOSTARCH}/go" build -o cmd/dist/dist ./cmd/dist
|
|
|
|
+elif [ -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
|
|
|
|
+ rm -f cmd/dist/dist
|
|
|
|
+ GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
|
|
|
|
+else
|
|
|
|
+ echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/${GOHOSTOS}_${GOHOSTARCH}/go." >&2
|
|
|
|
+ echo "ERROR: or $GOROOT_BOOTSTRAP/bin/${GOHOSTOS}_${GOHOSTARCH}/go." >&2
|
|
|
|
echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2
|
2016-01-28 12:19:10 +00:00
|
|
|
exit 1
|
2015-07-16 18:36:06 +00:00
|
|
|
fi
|
2017-01-27 10:39:40 +00:00
|
|
|
@@ -130,8 +137,6 @@ if [ "$GOROOT_BOOTSTRAP" == "$GOROOT" ];
|
2016-07-19 12:15:19 +00:00
|
|
|
echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
-rm -f cmd/dist/dist
|
|
|
|
-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
|
|
|
|
|
|
|
|
# -e doesn't propagate out of eval, so check success by hand.
|
|
|
|
eval $(./cmd/dist/dist env -p || echo FAIL=true)
|