]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist, make.bash: darwin/arm support
authorShenghou Ma <minux@golang.org>
Fri, 26 Dec 2014 06:22:41 +0000 (01:22 -0500)
committerMinux Ma <minux@golang.org>
Fri, 6 Feb 2015 05:49:58 +0000 (05:49 +0000)
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 <iant@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
src/cmd/dist/build.go
src/cmd/dist/util.go

index e36df51f5dce1afcddebc0c3f652c82c55ea2f82..a302787c3d283435e5492e7a9d8258c122f93298 100644 (file)
@@ -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")
                }
index 9ce0749ff3285b5e30d73385f072ed1ef9d35f3f..5cdd01b334c2829f50f18588c35ddf697c824f85 100644 (file)
@@ -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"