forked from security/hakurei
internal/rosa/go: alternative bootstrap path
For targets where the bootstrap toolchain is not available. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -63,18 +63,50 @@ ln -s \
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t Toolchain) newGoLatest() pkg.Artifact {
|
func (t Toolchain) newGoLatest() pkg.Artifact {
|
||||||
|
var (
|
||||||
|
bootstrapEnv []string
|
||||||
|
bootstrapExtra []pkg.Artifact
|
||||||
|
)
|
||||||
|
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),
|
||||||
|
)
|
||||||
|
|
||||||
|
default:
|
||||||
|
panic("unsupported target " + runtime.GOARCH)
|
||||||
|
}
|
||||||
|
|
||||||
go119 := t.newGo(
|
go119 := t.newGo(
|
||||||
"1.19",
|
"1.19",
|
||||||
"9_e0aFHsIkVxWVGsp9T2RvvjOc3p4n9o9S8tkNe9Cvgzk_zI2FhRQB7ioQkeAAro",
|
"9_e0aFHsIkVxWVGsp9T2RvvjOc3p4n9o9S8tkNe9Cvgzk_zI2FhRQB7ioQkeAAro",
|
||||||
[]string{"CGO_ENABLED=0"}, `
|
append(bootstrapEnv, "CGO_ENABLED=0"), `
|
||||||
rm \
|
rm \
|
||||||
crypto/tls/handshake_client_test.go \
|
crypto/tls/handshake_client_test.go \
|
||||||
|
cmd/pprof/pprof_test.go \
|
||||||
os/os_unix_test.go
|
os/os_unix_test.go
|
||||||
|
sed -i \
|
||||||
|
's/os\.Getenv("GCCGO")$/"nonexistent"/' \
|
||||||
|
go/internal/gccgoimporter/importer_test.go
|
||||||
echo \
|
echo \
|
||||||
'type syscallDescriptor = int' >> \
|
'type syscallDescriptor = int' >> \
|
||||||
os/rawconn_test.go
|
os/rawconn_test.go
|
||||||
`, t.newGoBootstrap(),
|
`, bootstrapExtra...)
|
||||||
)
|
|
||||||
|
|
||||||
go121 := t.newGo(
|
go121 := t.newGo(
|
||||||
"1.21.13",
|
"1.21.13",
|
||||||
|
|||||||
Reference in New Issue
Block a user