From ef603bead5d336e81954f890e20efa0261581792 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Wed, 25 Nov 2020 19:12:13 +0100 Subject: [PATCH] cmd/dist: restore GOARM=7 default for android/arm Fixes the android/arm builder. Without it, the builder reported unexpected stale targets during bootstrap: https://build.golang.org/log/b951f1171be54cf4a12c2a0720ffaf07f8a11377 Tighten the GOARM=7 default in cmd/internal/objabi while here. Change-Id: I944744910193e72e91bc37b5bf0783076b45e579 Reviewed-on: https://go-review.googlesource.com/c/go/+/273167 Run-TryBot: Elias Naur Reviewed-by: Cherry Zhang TryBot-Result: Go Bot Trust: Elias Naur --- src/cmd/dist/util.go | 6 ++++++ src/cmd/internal/objabi/util.go | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/cmd/dist/util.go b/src/cmd/dist/util.go index 9b4f8d2dec..0a419e465f 100644 --- a/src/cmd/dist/util.go +++ b/src/cmd/dist/util.go @@ -383,6 +383,12 @@ func xsamefile(f1, f2 string) bool { } func xgetgoarm() string { + if goos == "android" { + // Assume all android devices have VFPv3. + // These ports are also mostly cross-compiled, so it makes little + // sense to auto-detect the setting. + return "7" + } if gohostarch != "arm" || goos != gohostos { // Conservative default for cross-compilation. return "5" diff --git a/src/cmd/internal/objabi/util.go b/src/cmd/internal/objabi/util.go index d36e743580..a73ab479a1 100644 --- a/src/cmd/internal/objabi/util.go +++ b/src/cmd/internal/objabi/util.go @@ -41,8 +41,8 @@ const ( func goarm() int { def := defaultGOARM - if GOOS == "android" { - // Android devices always support GOARM=7. + if GOOS == "android" && GOARCH == "arm" { + // Android arm devices always support GOARM=7. def = "7" } switch v := envOr("GOARM", def); v {