Commit 3d1ccf89 authored by Shenghou Ma's avatar Shenghou Ma Committed by Minux Ma

cmd/dist, make.bash: darwin/arm support

cmd/dist: recognize darwin/arm as (host) goos/goarches. also hard
          code GOARM=7 for darwin/arm.
make.bash: don't pass -mmacosx-version-min=10.6 when building for
           darwin/arm.

Change-Id: If0ecd84a5179cd9bb61b801ac1899adc45f12f75
Reviewed-on: https://go-review.googlesource.com/2126Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
parent 5b806e58
...@@ -617,7 +617,7 @@ func install(dir string) { ...@@ -617,7 +617,7 @@ func install(dir string) {
} }
// disable word wrapping in error messages // disable word wrapping in error messages
gccargs = append(gccargs, "-fmessage-length=0") gccargs = append(gccargs, "-fmessage-length=0")
if gohostos == "darwin" { if gohostos == "darwin" && gohostarch != "arm" {
// golang.org/issue/5261 // golang.org/issue/5261
gccargs = append(gccargs, "-mmacosx-version-min=10.6") gccargs = append(gccargs, "-mmacosx-version-min=10.6")
} }
......
...@@ -376,7 +376,7 @@ func main() { ...@@ -376,7 +376,7 @@ func main() {
if gohostarch == "" { if gohostarch == "" {
// Default Unix system. // Default Unix system.
out := run("", CheckExit, "uname", "-m") out := run("", CheckExit, "uname", "-m", "-v")
switch { switch {
case strings.Contains(out, "x86_64"), strings.Contains(out, "amd64"): case strings.Contains(out, "x86_64"), strings.Contains(out, "amd64"):
gohostarch = "amd64" gohostarch = "amd64"
...@@ -388,6 +388,10 @@ func main() { ...@@ -388,6 +388,10 @@ func main() {
gohostarch = "ppc64le" gohostarch = "ppc64le"
case strings.Contains(out, "ppc64"): case strings.Contains(out, "ppc64"):
gohostarch = "ppc64" gohostarch = "ppc64"
case gohostos == "darwin":
if strings.Contains(out, "RELEASE_ARM_") {
gohostarch = "arm"
}
default: default:
fatal("unknown architecture: %s", out) fatal("unknown architecture: %s", out)
} }
...@@ -453,6 +457,12 @@ func xgetgoarm() string { ...@@ -453,6 +457,12 @@ func xgetgoarm() string {
// NaCl guarantees VFPv3 and is always cross-compiled. // NaCl guarantees VFPv3 and is always cross-compiled.
return "7" return "7"
} }
if goos == "darwin" {
// Assume all darwin/arm devices are have VFPv3. This
// port is also mostly cross-compiled, so it makes little
// sense to auto-detect the setting.
return "7"
}
if gohostarch != "arm" || goos != gohostos { if gohostarch != "arm" || goos != gohostos {
// Conservative default for cross-compilation. // Conservative default for cross-compilation.
return "5" return "5"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment