2021-12-14 22:31:07 +01:00
|
|
|
Index: go/src/cmd/dist/buildtool.go
|
|
|
|
===================================================================
|
|
|
|
--- go.orig/src/cmd/dist/buildtool.go
|
|
|
|
+++ go/src/cmd/dist/buildtool.go
|
2022-04-08 07:20:19 +02:00
|
|
|
@@ -205,7 +205,7 @@ func bootstrapBuildTools() {
|
2021-12-14 22:31:07 +01:00
|
|
|
// only applies to the final cmd/go binary, but that's OK: if this is Go 1.10
|
|
|
|
// or later we don't need to disable inlining to work around bugs in the Go 1.4 compiler.
|
|
|
|
cmd := []string{
|
|
|
|
- pathf("%s/bin/go", goroot_bootstrap),
|
2022-04-08 04:33:45 +02:00
|
|
|
+ pathf("%s/bin/go-$gcc_go_version", goroot_bootstrap),
|
2021-12-14 22:31:07 +01:00
|
|
|
"install",
|
|
|
|
"-gcflags=-l",
|
|
|
|
"-tags=math_big_pure_go compiler_bootstrap",
|
|
|
|
Index: go/src/make.bash
|
|
|
|
===================================================================
|
|
|
|
--- go.orig/src/make.bash
|
|
|
|
+++ go/src/make.bash
|
|
|
|
@@ -60,7 +60,7 @@
|
|
|
|
# time goes when these scripts run.
|
|
|
|
#
|
|
|
|
# GOROOT_BOOTSTRAP: A working Go tree >= Go 1.4 for bootstrap.
|
|
|
|
-# If $GOROOT_BOOTSTRAP/bin/go is missing, $(go env GOROOT) is
|
2022-04-08 04:33:45 +02:00
|
|
|
+# If $GOROOT_BOOTSTRAP/bin/go-$gcc_go_version is missing, $(go env GOROOT) is
|
2021-12-14 22:31:07 +01:00
|
|
|
# tried for all "go" in $PATH. $HOME/go1.4 by default.
|
|
|
|
|
|
|
|
set -e
|
2022-04-08 07:20:19 +02:00
|
|
|
@@ -176,8 +176,8 @@
|
2021-12-14 22:31:07 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done; unset IFS
|
|
|
|
-if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
|
|
|
|
- echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go." >&2
|
2022-04-08 04:33:45 +02:00
|
|
|
+if [ ! -x "$GOROOT_BOOTSTRAP/bin/go-$gcc_go_version" ]; then
|
|
|
|
+ echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go-$gcc_go_version." >&2
|
2021-12-14 22:31:07 +01:00
|
|
|
echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
2022-04-08 07:20:19 +02:00
|
|
|
@@ -195,7 +195,7 @@
|
2021-12-14 22:31:07 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
rm -f cmd/dist/dist
|
|
|
|
-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" GO111MODULE=off "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
|
2022-04-08 04:33:45 +02:00
|
|
|
+GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" GO111MODULE=off "$GOROOT_BOOTSTRAP/bin/go-$gcc_go_version" build -o cmd/dist/dist ./cmd/dist
|
2021-12-14 22:31:07 +01:00
|
|
|
|
|
|
|
# -e doesn't propagate out of eval, so check success by hand.
|
|
|
|
eval $(./cmd/dist/dist env -p || echo FAIL=true)
|
|
|
|
Index: go/src/make.rc
|
|
|
|
===================================================================
|
|
|
|
--- go.orig/src/make.rc
|
|
|
|
+++ go/src/make.rc
|
2022-04-08 07:20:19 +02:00
|
|
|
@@ -60,7 +60,7 @@ GOROOT = `{cd .. && pwd}
|
2021-12-14 22:31:07 +01:00
|
|
|
if(! ~ $#GOROOT_BOOTSTRAP 1)
|
|
|
|
GOROOT_BOOTSTRAP = $home/go1.4
|
|
|
|
for(p in $path){
|
|
|
|
- if(! test -x $GOROOT_BOOTSTRAP/bin/go){
|
2022-04-08 04:33:45 +02:00
|
|
|
+ if(! test -x $GOROOT_BOOTSTRAP/bin/go-$gcc_go_version){
|
2021-12-14 22:31:07 +01:00
|
|
|
if(go_exe = `{path=$p whatis go}){
|
|
|
|
goroot = `{GOROOT='' $go_exe env GOROOT}
|
|
|
|
if(! ~ $goroot $GOROOT){
|
2022-04-08 07:20:19 +02:00
|
|
|
@@ -73,7 +73,7 @@ for(p in $path){
|
2021-12-14 22:31:07 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
-if(! test -x $GOROOT_BOOTSTRAP/bin/go){
|
2022-04-08 04:33:45 +02:00
|
|
|
+if(! test -x $GOROOT_BOOTSTRAP/bin/go-$gcc_go_version){
|
2021-12-14 22:31:07 +01:00
|
|
|
echo 'ERROR: Cannot find '$GOROOT_BOOTSTRAP'/bin/go.' >[1=2]
|
|
|
|
echo 'Set $GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4.' >[1=2]
|
|
|
|
exit bootstrap
|
2022-04-08 07:20:19 +02:00
|
|
|
@@ -87,7 +87,7 @@ if(~ $GOROOT_BOOTSTRAP $GOROOT){
|
2021-12-14 22:31:07 +01:00
|
|
|
echo 'Building Go cmd/dist using '^$GOROOT_BOOTSTRAP
|
|
|
|
if(~ $#vflag 1)
|
|
|
|
echo cmd/dist
|
|
|
|
-GOROOT=$GOROOT_BOOTSTRAP GOOS='' GOARCH='' GO111MODULE=off $GOROOT_BOOTSTRAP/bin/go build -o cmd/dist/dist ./cmd/dist
|
2022-04-08 04:33:45 +02:00
|
|
|
+GOROOT=$GOROOT_BOOTSTRAP GOOS='' GOARCH='' GO111MODULE=off $GOROOT_BOOTSTRAP/bin/go-$gcc_go_version build -o cmd/dist/dist ./cmd/dist
|
2021-12-14 22:31:07 +01:00
|
|
|
|
|
|
|
eval `{./cmd/dist/dist env -9}
|
|
|
|
if(~ $#vflag 1)
|