aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-02-08 01:44:08 +0900
committerOphestra <cat@gensokyo.uk>2026-02-08 15:04:03 +0900
commit9fb0722cdf58aac3d630dc0de51b9758c0d63e93 (patch)
tree9d2ca34e98eff2bacf94f30fb89e132ed2317895
parent2f3e323c466a9ec7b386a38e7c4c8c823a2d5501 (diff)
internal/rosa/go: alternative bootstrap path
For targets where the bootstrap toolchain is not available. Signed-off-by: Ophestra <cat@gensokyo.uk>
-rw-r--r--internal/rosa/go.go46
1 files changed, 41 insertions, 5 deletions
diff --git a/internal/rosa/go.go b/internal/rosa/go.go
index 31417ee8..27bfa43d 100644
--- a/internal/rosa/go.go
+++ b/internal/rosa/go.go
@@ -63,18 +63,54 @@ ln -s \
}
func (t Toolchain) newGoLatest() pkg.Artifact {
+ var (
+ bootstrapEnv []string
+ bootstrapExtra []pkg.Artifact
+
+ finalEnv []string
+ )
+ switch runtime.GOARCH {
+ case "amd64":
+ bootstrapExtra = append(bootstrapExtra, t.newGoBootstrap())
+
+ case "arm64":
+ bootstrapEnv = append(bootstrapEnv,
+ "GOROOT_BOOTSTRAP=/system",
+ )
+ bootstrapExtra = append(bootstrapExtra,
+ t.Load(Binutils),
+
+ t.Load(GMP),
+ t.Load(MPFR),
+ t.Load(MPC),
+
+ t.Load(Zlib),
+ t.Load(Libucontext),
+
+ t.Load(gcc),
+ )
+
+ finalEnv = append(finalEnv, "CGO_ENABLED=0")
+
+ default:
+ panic("unsupported target " + runtime.GOARCH)
+ }
+
go119 := t.newGo(
"1.19",
"9_e0aFHsIkVxWVGsp9T2RvvjOc3p4n9o9S8tkNe9Cvgzk_zI2FhRQB7ioQkeAAro",
- []string{"CGO_ENABLED=0"}, `
+ append(bootstrapEnv, "CGO_ENABLED=0"), `
rm \
crypto/tls/handshake_client_test.go \
+ cmd/pprof/pprof_test.go \
os/os_unix_test.go
+sed -i \
+ 's/os\.Getenv("GCCGO")$/"nonexistent"/' \
+ go/internal/gccgoimporter/importer_test.go
echo \
'type syscallDescriptor = int' >> \
os/rawconn_test.go
-`, t.newGoBootstrap(),
- )
+`, bootstrapExtra...)
go121 := t.newGo(
"1.21.13",
@@ -97,7 +133,7 @@ echo \
go123 := t.newGo(
"1.23.12",
"wcI32bl1tkqbgcelGtGWPI4RtlEddd-PTd76Eb-k7nXA5LbE9yTNdIL9QSOOxMOs",
- nil, `
+ []string{"CGO_ENABLED=0"}, `
sed -i \
's,/lib/ld-musl-`+linuxArch()+`.so.1,/system/bin/linker,' \
cmd/link/internal/`+runtime.GOARCH+`/obj.go
@@ -107,7 +143,7 @@ sed -i \
go125 := t.newGo(
"1.25.6",
"x0z430qoDvQbbw_fftjW0rh_GSoh0VJhPzttWk_0hj9yz9AKOjuwRMupF_Q0dbt7",
- nil, `
+ finalEnv, `
sed -i \
's,/lib/ld-musl-`+linuxArch()+`.so.1,/system/bin/linker,' \
cmd/link/internal/`+runtime.GOARCH+`/obj.go