cmd/dist: detect gohostarch for openbsd/mips64

On OpenBSD/octeon `uname -m` returns 'octeon' and we need `uname -p` to determine
the processor type (mips64).

Update #40995

Change-Id: I37c53ca2c372ab958fff17917d82d41f4b0a0393
Reviewed-on: https://go-review.googlesource.com/c/go/+/250583
Trust: Joel Sing <joel@sing.id.au>
Run-TryBot: Joel Sing <joel@sing.id.au>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Joel Sing 2020-08-26 03:18:30 +10:00
parent 15eaa870e1
commit 9499a2e108

View File

@ -133,6 +133,10 @@ func main() {
if strings.Contains(run("", CheckExit, "uname", "-v"), "RELEASE_ARM64_") { if strings.Contains(run("", CheckExit, "uname", "-v"), "RELEASE_ARM64_") {
gohostarch = "arm64" gohostarch = "arm64"
} }
case gohostos == "openbsd":
if strings.Contains(run("", CheckExit, "uname", "-p"), "mips64") {
gohostarch = "mips64"
}
default: default:
fatalf("unknown architecture: %s", out) fatalf("unknown architecture: %s", out)
} }