From: Shenghou Ma Date: Fri, 26 Dec 2014 06:22:41 +0000 (-0500) Subject: cmd/dist, make.bash: darwin/arm support X-Git-Tag: go1.5beta1~2107 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=3d1ccf8964367abbb5c7524d485b4df3e0531195;p=gostls13.git 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/2126 Reviewed-by: Ian Lance Taylor Reviewed-by: David Crawshaw --- diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go index e36df51f5d..a302787c3d 100644 --- a/src/cmd/dist/build.go +++ b/src/cmd/dist/build.go @@ -617,7 +617,7 @@ func install(dir string) { } // disable word wrapping in error messages gccargs = append(gccargs, "-fmessage-length=0") - if gohostos == "darwin" { + if gohostos == "darwin" && gohostarch != "arm" { // golang.org/issue/5261 gccargs = append(gccargs, "-mmacosx-version-min=10.6") } diff --git a/src/cmd/dist/util.go b/src/cmd/dist/util.go index 9ce0749ff3..5cdd01b334 100644 --- a/src/cmd/dist/util.go +++ b/src/cmd/dist/util.go @@ -376,7 +376,7 @@ func main() { if gohostarch == "" { // Default Unix system. - out := run("", CheckExit, "uname", "-m") + out := run("", CheckExit, "uname", "-m", "-v") switch { case strings.Contains(out, "x86_64"), strings.Contains(out, "amd64"): gohostarch = "amd64" @@ -388,6 +388,10 @@ func main() { gohostarch = "ppc64le" case strings.Contains(out, "ppc64"): gohostarch = "ppc64" + case gohostos == "darwin": + if strings.Contains(out, "RELEASE_ARM_") { + gohostarch = "arm" + } default: fatal("unknown architecture: %s", out) } @@ -453,6 +457,12 @@ func xgetgoarm() string { // NaCl guarantees VFPv3 and is always cross-compiled. 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 { // Conservative default for cross-compilation. return "5"