2016-01-28 12:19:10 +00:00
|
|
|
diff -up go/src/cmd/dist/buildtool.go.bootstrap go/src/cmd/dist/buildtool.go
|
2017-07-12 11:38:36 +00:00
|
|
|
--- go/src/cmd/dist/buildtool.go.bootstrap 2017-07-11 12:05:00.041373419 +0200
|
|
|
|
+++ go/src/cmd/dist/buildtool.go 2017-07-11 12:07:27.141775914 +0200
|
|
|
|
@@ -153,18 +153,26 @@ 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", "")
|
|
|
|
|
2017-07-12 11:38:36 +00:00
|
|
|
+ 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", "")
|
|
|
|
|
2017-07-12 11:38:36 +00:00
|
|
|
+ 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)
|
|
|
|
+ }
|
2015-07-16 18:36:06 +00:00
|
|
|
+
|
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.
|
2017-07-12 11:38:36 +00:00
|
|
|
cmd := []string{
|
|
|
|
- pathf("%s/bin/go", goroot_bootstrap),
|
|
|
|
+ bingopath,
|
|
|
|
"install",
|
|
|
|
"-gcflags=-l",
|
|
|
|
"-tags=math_big_pure_go",
|
2016-01-28 12:19:10 +00:00
|
|
|
diff -up go/src/make.bash.bootstrap go/src/make.bash
|
2017-07-12 11:38:36 +00:00
|
|
|
--- go/src/make.bash.bootstrap 2017-07-11 12:05:00.036373439 +0200
|
|
|
|
+++ go/src/make.bash 2017-07-11 12:05:00.041373419 +0200
|
2017-01-27 10:39:40 +00:00
|
|
|
@@ -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-07-12 11:38:36 +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)
|