File gcc-go.patch of Package go1.23
diff --git a/src/cmd/dist/buildtool.go b/src/cmd/dist/buildtool.go
index 9ca8fc5..25a1958 100644
--- a/src/cmd/dist/buildtool.go
+++ b/src/cmd/dist/buildtool.go
@@ -226,7 +226,7 @@ func bootstrapBuildTools() {
// Use the purego build tag to disable other assembly code,
// such as in cmd/internal/notsha256.
cmd := []string{
- pathf("%s/bin/go", goroot_bootstrap),
+ pathf("%s/bin/go-$gcc_go_version", goroot_bootstrap),
"install",
"-tags=math_big_pure_go compiler_bootstrap purego",
}
diff --git a/src/make.bash b/src/make.bash
index 814b7e8..6e79e70 100755
--- a/src/make.bash
+++ b/src/make.bash
@@ -165,29 +165,29 @@ bootstrapenv() {
export GOROOT="$(cd .. && pwd)"
IFS=$'\n'; for go_exe in $(type -ap go); do
- if [[ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]]; then
+ if [[ ! -x "$GOROOT_BOOTSTRAP/bin/go-$gcc_go_version" ]]; then
goroot_bootstrap=$GOROOT_BOOTSTRAP
GOROOT_BOOTSTRAP=""
goroot=$(bootstrapenv "$go_exe" env GOROOT)
GOROOT_BOOTSTRAP=$goroot_bootstrap
if [[ "$goroot" != "$GOROOT" ]]; then
if [[ "$goroot_bootstrap_set" == "true" ]]; then
- printf 'WARNING: %s does not exist, found %s from env\n' "$GOROOT_BOOTSTRAP/bin/go" "$go_exe" >&2
+ printf 'WARNING: %s does not exist, found %s from env\n' "$GOROOT_BOOTSTRAP/bin/go-$gcc_go_version" "$go_exe" >&2
printf 'WARNING: set %s as GOROOT_BOOTSTRAP\n' "$goroot" >&2
fi
GOROOT_BOOTSTRAP="$goroot"
fi
fi
done; unset IFS
-if [[ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]]; then
- echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go." >&2
+if [ ! -x "$GOROOT_BOOTSTRAP/bin/go-$gcc_go_version" ]; then
+ echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go-$gcc_go_version." >&2
echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go $bootgo." >&2
exit 1
fi
# Get the exact bootstrap toolchain version to help with debugging.
# We clear GOOS and GOARCH to avoid an ominous but harmless warning if
# the bootstrap doesn't support them.
-GOROOT_BOOTSTRAP_VERSION=$(bootstrapenv "$GOROOT_BOOTSTRAP/bin/go" version | sed 's/go version //')
+GOROOT_BOOTSTRAP_VERSION=$(bootstrapenv "$GOROOT_BOOTSTRAP/bin/go-$gcc_go_version" version | sed 's/go version //')
echo "Building Go cmd/dist using $GOROOT_BOOTSTRAP. ($GOROOT_BOOTSTRAP_VERSION)"
if $verbose; then
echo cmd/dist
@@ -198,7 +198,7 @@ if [[ "$GOROOT_BOOTSTRAP" == "$GOROOT" ]]; then
exit 1
fi
rm -f cmd/dist/dist
-bootstrapenv "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
+bootstrapenv "$GOROOT_BOOTSTRAP/bin/go-$gcc_go_version" 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)
diff --git a/src/make.rc b/src/make.rc
index 5425001..864e825 100755
--- a/src/make.rc
+++ b/src/make.rc
@@ -59,7 +59,7 @@ if(! ~ $#GOROOT_BOOTSTRAP 1){
GOROOT_BOOTSTRAP = $home/$d
}
for(p in $path){
- if(! test -x $GOROOT_BOOTSTRAP/bin/go){
+ if(! test -x $GOROOT_BOOTSTRAP/bin/go-$gcc_go_version){
if(go_exe = `{path=$p whatis go}){
goroot_bootstrap = $GOROOT_BOOTSTRAP
GOROOT_BOOTSTRAP = ()
@@ -75,8 +75,8 @@ for(p in $path){
}
}
}
-if(! test -x $GOROOT_BOOTSTRAP/bin/go){
- echo 'ERROR: Cannot find '$GOROOT_BOOTSTRAP'/bin/go.' >[1=2]
+if(! test -x $GOROOT_BOOTSTRAP/bin/go-$gcc_go_version){
+ echo 'ERROR: Cannot find '$GOROOT_BOOTSTRAP'/bin/go-$gcc_go_version.' >[1=2]
echo 'Set $GOROOT_BOOTSTRAP to a working Go tree >= Go '$bootgo'.' >[1=2]
exit bootstrap
}
@@ -89,11 +89,11 @@ if(~ $GOROOT_BOOTSTRAP $GOROOT){
# Get the exact bootstrap toolchain version to help with debugging.
# We clear GOOS and GOARCH to avoid an ominous but harmless warning if
# the bootstrap doesn't support them.
-GOROOT_BOOTSTRAP_VERSION=`{bootstrapenv $GOROOT_BOOTSTRAP/bin/go version | sed 's/go version //'}
+GOROOT_BOOTSTRAP_VERSION=`{bootstrapenv $GOROOT_BOOTSTRAP/bin/go-$gcc_go_version build version | sed 's/go-$gcc_go_version build version //'}
echo 'Building Go cmd/dist using '$GOROOT_BOOTSTRAP'. ('$"GOROOT_BOOTSTRAP_VERSION')'
if(~ $#vflag 1)
echo cmd/dist
-bootstrapenv $GOROOT_BOOTSTRAP/bin/go build -o cmd/dist/dist ./cmd/dist
+bootstrapenv $GOROOT_BOOTSTRAP/bin/go-$gcc_go_version build build -o cmd/dist/dist ./cmd/dist
eval `{./cmd/dist/dist env -9}
if(~ $#vflag 1)