Skip to content

Commit

Permalink
cmd/dist: restore GOARM=7 default for android/arm
Browse files Browse the repository at this point in the history
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 <mail@eliasnaur.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Elias Naur <mail@eliasnaur.com>
  • Loading branch information
eliasnaur committed Nov 25, 2020
1 parent 9dc2350 commit ef603be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/cmd/dist/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/internal/objabi/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ef603be

Please sign in to comment.