]> Cypherpunks repositories - gostls13.git/commitdiff
all: remove scattered remnants of darwin/arm
authorAustin Clements <austin@google.com>
Fri, 3 Apr 2020 16:22:27 +0000 (12:22 -0400)
committerAustin Clements <austin@google.com>
Wed, 8 Apr 2020 18:35:49 +0000 (18:35 +0000)
This removes all conditions and conditional code (that I could find)
that depended on darwin/arm.

Fixes #35439 (since that only happened on darwin/arm)
Fixes #37611.

Change-Id: Ia4c32a5a4368ed75231075832b0b5bfb1ad11986
Reviewed-on: https://go-review.googlesource.com/c/go/+/227198
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
50 files changed:
misc/cgo/test/pkg_test.go
misc/cgo/test/sigaltstack.go
misc/cgo/test/testx.go
misc/cgo/testcarchive/carchive_test.go
misc/cgo/testcshared/cshared_test.go
misc/cgo/testso/so_test.go
misc/cgo/testsovar/so_test.go
misc/ios/clangwrap.sh
src/buildall.bash
src/cmd/dist/build.go
src/cmd/dist/test.go
src/cmd/dist/util.go
src/cmd/doc/doc_test.go
src/cmd/go/go_test.go
src/cmd/go/internal/load/pkg.go
src/cmd/go/internal/work/build_test.go
src/cmd/go/internal/work/init.go
src/cmd/internal/sys/supported.go
src/cmd/link/internal/arm/asm.go
src/cmd/link/internal/arm/obj.go
src/cmd/link/internal/ld/sym.go
src/cmd/oldlink/internal/arm/asm.go
src/cmd/oldlink/internal/arm/obj.go
src/cmd/oldlink/internal/ld/sym.go
src/crypto/x509/root_darwin_test.go
src/go/build/build_test.go
src/go/build/deps_test.go
src/go/internal/gcimporter/gcimporter_test.go
src/internal/testenv/testenv.go
src/iostest.bash
src/log/syslog/syslog_test.go
src/net/dial_test.go
src/net/lookup_test.go
src/net/platform_test.go
src/net/timeout_test.go
src/os/file.go
src/os/os_test.go
src/os/path_test.go
src/os/wait_waitid.go
src/path/filepath/path_test.go
src/runtime/cgo/cgo.go
src/runtime/cgo/gcc_darwin_arm64.c
src/runtime/os_darwin.go
src/runtime/pprof/pprof_test.go
src/runtime/signal_arm.go
src/runtime/signal_unix.go
src/runtime/tls_arm.s
src/runtime/vlrt.go
src/syscall/mkall.sh
src/syscall/syscall_unix_test.go

index 08e075c022c849a22d91ab8fe38dd7f94afd5ccb..26c50ad883f643b74ef69c54324e5e6219f49221 100644 (file)
@@ -32,7 +32,7 @@ func TestCrossPackageTests(t *testing.T) {
                t.Skip("Can't exec cmd/go subprocess on Android.")
        case "darwin":
                switch runtime.GOARCH {
-               case "arm", "arm64":
+               case "arm64":
                        t.Skip("Can't exec cmd/go subprocess on iOS.")
                }
        }
index 7b3f4acbb7569b6da88392be4ddcbbb73f16debd..f501f9ba3aec120ed985922625781c0a85c45174 100644 (file)
@@ -62,7 +62,7 @@ import (
 
 func testSigaltstack(t *testing.T) {
        switch {
-       case runtime.GOOS == "solaris", runtime.GOOS == "illumos", runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64"):
+       case runtime.GOOS == "solaris", runtime.GOOS == "illumos", runtime.GOOS == "darwin" && runtime.GOARCH == "arm64":
                t.Skipf("switching signal stack not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
        case runtime.GOOS == "darwin" && runtime.GOARCH == "386":
                t.Skipf("sigaltstack fails on darwin/386")
index 42979b5f4d5092e3771c828faa2fdecbd0fb5f6d..98c48fa383ac7e4e954ebd617e54ad0b624b1ac7 100644 (file)
@@ -159,7 +159,7 @@ func Add(x int) {
 }
 
 func testCthread(t *testing.T) {
-       if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
+       if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
                t.Skip("the iOS exec wrapper is unable to properly handle the panic from Add")
        }
        sum.i = 0
index 82a1a5a54ce63ccd22f9577810f30db1e22c55af..b4a046c4bc41ae63ae5a594bd2c2efd750ea2e7c 100644 (file)
@@ -134,7 +134,7 @@ func testMain(m *testing.M) int {
        } else {
                switch GOOS {
                case "darwin":
-                       if GOARCH == "arm" || GOARCH == "arm64" {
+                       if GOARCH == "arm64" {
                                libbase += "_shared"
                        }
                case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris", "illumos":
@@ -305,7 +305,7 @@ func TestEarlySignalHandler(t *testing.T) {
        switch GOOS {
        case "darwin":
                switch GOARCH {
-               case "arm", "arm64":
+               case "arm64":
                        t.Skipf("skipping on %s/%s; see https://golang.org/issue/13701", GOOS, GOARCH)
                }
        case "windows":
@@ -487,7 +487,7 @@ func checkSignalForwardingTest(t *testing.T) {
        switch GOOS {
        case "darwin":
                switch GOARCH {
-               case "arm", "arm64":
+               case "arm64":
                        t.Skipf("skipping on %s/%s; see https://golang.org/issue/13701", GOOS, GOARCH)
                }
        case "windows":
@@ -603,7 +603,7 @@ func TestExtar(t *testing.T) {
        if runtime.Compiler == "gccgo" {
                t.Skip("skipping -extar test when using gccgo")
        }
-       if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
+       if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
                t.Skip("shell scripts are not executable on iOS hosts")
        }
 
index cb95153abf603ee38adff4bea749107b9265ddca..bd4d341820ecfa610493846eeb4428523ff61041 100644 (file)
@@ -108,7 +108,7 @@ func testMain(m *testing.M) int {
        libgodir := GOOS + "_" + GOARCH
        switch GOOS {
        case "darwin":
-               if GOARCH == "arm" || GOARCH == "arm64" {
+               if GOARCH == "arm64" {
                        libgodir += "_shared"
                }
        case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris", "illumos":
index f94017025c0a05a629f555a1a75582db93dbd354..bdd6bd84685c9ca936861b16f6bc86662733009b 100644 (file)
@@ -20,7 +20,7 @@ import (
 func requireTestSOSupported(t *testing.T) {
        t.Helper()
        switch runtime.GOARCH {
-       case "arm", "arm64":
+       case "arm64":
                if runtime.GOOS == "darwin" {
                        t.Skip("No exec facility on iOS.")
                }
index f94017025c0a05a629f555a1a75582db93dbd354..bdd6bd84685c9ca936861b16f6bc86662733009b 100644 (file)
@@ -20,7 +20,7 @@ import (
 func requireTestSOSupported(t *testing.T) {
        t.Helper()
        switch runtime.GOARCH {
-       case "arm", "arm64":
+       case "arm64":
                if runtime.GOOS == "darwin" {
                        t.Skip("No exec facility on iOS.")
                }
index c69a9bf355d022e20b4b0a5be47300ded0486f32..5fdbb6db4acbf69b351dc25fb227252d9639d983 100755 (executable)
@@ -8,9 +8,7 @@ export IPHONEOS_DEPLOYMENT_TARGET=5.1
 # cmd/cgo doesn't support llvm-gcc-4.2, so we have to use clang.
 CLANG=`xcrun --sdk $SDK --find clang`
 
-if [ "$GOARCH" == "arm" ]; then
-       CLANGARCH="armv7"
-elif [ "$GOARCH" == "arm64" ]; then
+if [ "$GOARCH" == "arm64" ]; then
        CLANGARCH="arm64"
 else
        echo "unknown GOARCH=$GOARCH" >&2
index 18d0b0db198351dba2a98a3aa1798b15ccdcf517..dc67c0630f5c6a1379fa859b2484b4d4ba9edb01 100755 (executable)
@@ -42,7 +42,7 @@ gettargets() {
 }
 
 selectedtargets() {
-       gettargets | egrep -v 'android-arm|darwin-arm' | egrep "$pattern"
+       gettargets | egrep -v 'android-arm|darwin-arm64' | egrep "$pattern"
 }
 
 # put linux first in the target list to get all the architectures up front.
index ab55a98b745512a7740719347775500d5ee36b48..9e2b4f33b866b9b10a6326cd342a3a50822695b2 100644 (file)
@@ -1461,8 +1461,8 @@ func wrapperPathFor(goos, goarch string) string {
                if gohostos != "android" {
                        return pathf("%s/misc/android/go_android_exec.go", goroot)
                }
-       case goos == "darwin" && (goarch == "arm" || goarch == "arm64"):
-               if gohostos != "darwin" || (gohostarch != "arm" && gohostarch != "arm64") {
+       case goos == "darwin" && goarch == "arm64":
+               if gohostos != "darwin" || gohostarch != "arm64" {
                        return pathf("%s/misc/ios/go_darwin_arm_exec.go", goroot)
                }
        }
index 0ab5e6e3b62b15167802fe36820ae88668f009a1..a7ef8f27d576ab83d7062cd19596cddbf28e7249 100644 (file)
@@ -887,7 +887,7 @@ func (t *tester) addCmd(dt *distTest, dir string, cmdline ...interface{}) *exec.
 }
 
 func (t *tester) iOS() bool {
-       return goos == "darwin" && (goarch == "arm" || goarch == "arm64")
+       return goos == "darwin" && goarch == "arm64"
 }
 
 func (t *tester) out(v string) {
@@ -902,7 +902,7 @@ func (t *tester) extLink() bool {
        switch pair {
        case "aix-ppc64",
                "android-arm", "android-arm64",
-               "darwin-386", "darwin-amd64", "darwin-arm", "darwin-arm64",
+               "darwin-386", "darwin-amd64", "darwin-arm64",
                "dragonfly-amd64",
                "freebsd-386", "freebsd-amd64", "freebsd-arm",
                "linux-386", "linux-amd64", "linux-arm", "linux-arm64", "linux-ppc64le", "linux-mips64", "linux-mips64le", "linux-mips", "linux-mipsle", "linux-s390x",
@@ -927,7 +927,7 @@ func (t *tester) internalLink() bool {
        if goos == "android" {
                return false
        }
-       if goos == "darwin" && (goarch == "arm" || goarch == "arm64") {
+       if t.iOS() {
                return false
        }
        // Internally linking cgo is incomplete on some architectures.
@@ -963,7 +963,7 @@ func (t *tester) supportedBuildmode(mode string) bool {
                }
                switch pair {
                case "aix-ppc64",
-                       "darwin-386", "darwin-amd64", "darwin-arm", "darwin-arm64",
+                       "darwin-386", "darwin-amd64", "darwin-arm64",
                        "linux-amd64", "linux-386", "linux-ppc64le", "linux-s390x",
                        "freebsd-amd64",
                        "windows-amd64", "windows-386":
index b9e8a513d96930c0ab9551d0a3fbbc295085ccca..0a419e465fe87a7f3b088611aa56c8d7c50e5d5d 100644 (file)
@@ -383,8 +383,8 @@ func xsamefile(f1, f2 string) bool {
 }
 
 func xgetgoarm() string {
-       if goos == "darwin" || goos == "android" {
-               // Assume all darwin/arm and android devices have VFPv3.
+       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"
index fd2ae3082705e0bf9ba88f58bd8c138f46ea42a5..80b8cd4d69a00c06b658db3a120b384453ebdb78 100644 (file)
@@ -36,8 +36,8 @@ func TestMain(m *testing.M) {
 }
 
 func maybeSkip(t *testing.T) {
-       if runtime.GOOS == "darwin" && strings.HasPrefix(runtime.GOARCH, "arm") {
-               t.Skip("darwin/arm does not have a full file tree")
+       if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
+               t.Skip("darwin/arm64 does not have a full file tree")
        }
 }
 
index 33c3f48f8550dc59622ac51ee9d8896bdcf56b74..723e1d91220b8dac429a255a19bfd6c33b247c54 100644 (file)
@@ -61,7 +61,7 @@ func init() {
                canRun = false
        case "darwin":
                switch runtime.GOARCH {
-               case "arm", "arm64":
+               case "arm64":
                        canRun = false
                }
        case "linux":
index 247f5ed50644512958c58268c466eabdc5130e95..3c018a0f7f3f965093a525ef48abd22bee6e097e 100644 (file)
@@ -1940,8 +1940,7 @@ func externalLinkingForced(p *Package) bool {
                        return true
                }
        case "darwin":
-               switch cfg.BuildContext.GOARCH {
-               case "arm", "arm64":
+               if cfg.BuildContext.GOARCH == "arm64" {
                        return true
                }
        }
index b60f4e27c04a539e693aec00aee069cb7debdb4a..c33de2635dc34f536421f8efeebd6aabe48e3a24 100644 (file)
@@ -222,7 +222,7 @@ func pkgImportPath(pkgpath string) *load.Package {
 func TestRespectSetgidDir(t *testing.T) {
        switch runtime.GOOS {
        case "darwin":
-               if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" {
+               if runtime.GOARCH == "arm64" {
                        t.Skip("can't set SetGID bit with chmod on iOS")
                }
        case "windows", "plan9":
index a574924c5b3a9b4dcfa5b80b9c300322ebf4981d..473bd1a31b8edeea7d6818f916c3b60896904a9b 100644 (file)
@@ -117,7 +117,7 @@ func buildModeInit() {
                        switch cfg.Goos {
                        case "darwin":
                                switch cfg.Goarch {
-                               case "arm", "arm64":
+                               case "arm64":
                                        codegenArg = "-shared"
                                }
 
@@ -151,7 +151,7 @@ func buildModeInit() {
                        ldBuildmode = "pie"
                case "darwin":
                        switch cfg.Goarch {
-                       case "arm", "arm64":
+                       case "arm64":
                                codegenArg = "-shared"
                        }
                        fallthrough
index 639827be866f7c4ef1fcfabb644e34ccb17a76f1..efc07af56beb21811a20f083a83267450b66d78a 100644 (file)
@@ -39,7 +39,7 @@ func MustLinkExternal(goos, goarch string) bool {
                        return true
                }
        case "darwin":
-               if goarch == "arm" || goarch == "arm64" {
+               if goarch == "arm64" {
                        return true
                }
        }
index 43ee4bf200ae60fb56611e4c525786b295879894..8472cb86608a797a176bd970bc05a265ee55ab56 100644 (file)
@@ -789,11 +789,6 @@ func asmb(ctxt *ld.Link) {
 }
 
 func asmb2(ctxt *ld.Link) {
-       machlink := uint32(0)
-       if ctxt.HeadType == objabi.Hdarwin {
-               machlink = uint32(ld.Domacholink(ctxt))
-       }
-
        /* output symbol table */
        ld.Symsize = 0
 
@@ -811,9 +806,6 @@ func asmb2(ctxt *ld.Link) {
                case objabi.Hplan9:
                        symo = uint32(ld.Segdata.Fileoff + ld.Segdata.Filelen)
 
-               case objabi.Hdarwin:
-                       symo = uint32(ld.Segdwarf.Fileoff + uint64(ld.Rnd(int64(ld.Segdwarf.Filelen), int64(*ld.FlagRound))) + uint64(machlink))
-
                case objabi.Hwindows:
                        symo = uint32(ld.Segdwarf.Fileoff + ld.Segdwarf.Filelen)
                        symo = uint32(ld.Rnd(int64(symo), ld.PEFILEALIGN))
@@ -845,11 +837,6 @@ func asmb2(ctxt *ld.Link) {
 
                case objabi.Hwindows:
                        // Do nothing
-
-               case objabi.Hdarwin:
-                       if ctxt.LinkMode == ld.LinkExternal {
-                               ld.Machoemitreloc(ctxt)
-                       }
                }
        }
 
@@ -872,9 +859,6 @@ func asmb2(ctxt *ld.Link) {
                objabi.Hopenbsd:
                ld.Asmbelf(ctxt, int64(symo))
 
-       case objabi.Hdarwin:
-               ld.Asmbmacho(ctxt)
-
        case objabi.Hwindows:
                ld.Asmbpe(ctxt)
        }
index 27246df21f43106b5a10057443c9c1c0d4390aed..003c80a508f7c2cc62f25deae11889369f8c0a32 100644 (file)
@@ -100,15 +100,6 @@ func archinit(ctxt *ld.Link) {
                        *ld.FlagRound = 0x10000
                }
 
-       case objabi.Hdarwin: /* apple MACH */
-               ld.HEADR = ld.INITIAL_MACHO_HEADR
-               if *ld.FlagTextAddr == -1 {
-                       *ld.FlagTextAddr = 4096 + int64(ld.HEADR)
-               }
-               if *ld.FlagRound == -1 {
-                       *ld.FlagRound = 4096
-               }
-
        case objabi.Hwindows: /* PE executable */
                // ld.HEADR, ld.FlagTextAddr, ld.FlagRound are set in ld.Peinit
                return
index 97966ed7e4c14790056694ba03ad102dff7c1a17..2284963f59646ad990ed682fbeaf1e8dcf465deb 100644 (file)
@@ -106,9 +106,6 @@ func (ctxt *Link) computeTLSOffset() {
                case sys.AMD64:
                        ctxt.Tlsoffset = 0x30
 
-               case sys.ARM:
-                       ctxt.Tlsoffset = 0 // dummy value, not needed
-
                case sys.ARM64:
                        ctxt.Tlsoffset = 0 // dummy value, not needed
                }
index 8db0bc3c9ac9b35d10e49180cd8553b19bacfc09..a2a0879c5b0331faaa3c69a6ef9c04aa9fda36fd 100644 (file)
@@ -618,15 +618,6 @@ func archreloc(ctxt *ld.Link, r *sym.Reloc, s *sym.Symbol, val int64) (int64, bo
                        }
                        r.Xsym = rs
 
-                       // ld64 for arm seems to want the symbol table to contain offset
-                       // into the section rather than pseudo virtual address that contains
-                       // the section load address.
-                       // we need to compensate that by removing the instruction's address
-                       // from addend.
-                       if ctxt.HeadType == objabi.Hdarwin {
-                               r.Xadd -= ld.Symaddr(s) + int64(r.Off)
-                       }
-
                        if r.Xadd/4 > 0x7fffff || r.Xadd/4 < -0x800000 {
                                ld.Errorf(s, "direct call too far %d", r.Xadd/4)
                        }
@@ -789,11 +780,6 @@ func asmb(ctxt *ld.Link) {
 }
 
 func asmb2(ctxt *ld.Link) {
-       machlink := uint32(0)
-       if ctxt.HeadType == objabi.Hdarwin {
-               machlink = uint32(ld.Domacholink(ctxt))
-       }
-
        /* output symbol table */
        ld.Symsize = 0
 
@@ -811,9 +797,6 @@ func asmb2(ctxt *ld.Link) {
                case objabi.Hplan9:
                        symo = uint32(ld.Segdata.Fileoff + ld.Segdata.Filelen)
 
-               case objabi.Hdarwin:
-                       symo = uint32(ld.Segdwarf.Fileoff + uint64(ld.Rnd(int64(ld.Segdwarf.Filelen), int64(*ld.FlagRound))) + uint64(machlink))
-
                case objabi.Hwindows:
                        symo = uint32(ld.Segdwarf.Fileoff + ld.Segdwarf.Filelen)
                        symo = uint32(ld.Rnd(int64(symo), ld.PEFILEALIGN))
@@ -845,11 +828,6 @@ func asmb2(ctxt *ld.Link) {
 
                case objabi.Hwindows:
                        // Do nothing
-
-               case objabi.Hdarwin:
-                       if ctxt.LinkMode == ld.LinkExternal {
-                               ld.Machoemitreloc(ctxt)
-                       }
                }
        }
 
@@ -872,9 +850,6 @@ func asmb2(ctxt *ld.Link) {
                objabi.Hopenbsd:
                ld.Asmbelf(ctxt, int64(symo))
 
-       case objabi.Hdarwin:
-               ld.Asmbmacho(ctxt)
-
        case objabi.Hwindows:
                ld.Asmbpe(ctxt)
        }
index 1fe4b9c2c85cbc5d7c2a1f7b0113d66a19d95e72..c423937355170d2f473acefb32298f3f2eb60f6a 100644 (file)
@@ -100,15 +100,6 @@ func archinit(ctxt *ld.Link) {
                        *ld.FlagRound = 0x10000
                }
 
-       case objabi.Hdarwin: /* apple MACH */
-               ld.HEADR = ld.INITIAL_MACHO_HEADR
-               if *ld.FlagTextAddr == -1 {
-                       *ld.FlagTextAddr = 4096 + int64(ld.HEADR)
-               }
-               if *ld.FlagRound == -1 {
-                       *ld.FlagRound = 4096
-               }
-
        case objabi.Hwindows: /* PE executable */
                // ld.HEADR, ld.FlagTextAddr, ld.FlagRound are set in ld.Peinit
                return
index c0f725c125d6aa3a06a573db4ef327e74effcf79..a470ddbca89e5d3367295e2683e99e673134456c 100644 (file)
@@ -104,9 +104,6 @@ func (ctxt *Link) computeTLSOffset() {
                case sys.AMD64:
                        ctxt.Tlsoffset = 0x30
 
-               case sys.ARM:
-                       ctxt.Tlsoffset = 0 // dummy value, not needed
-
                case sys.ARM64:
                        ctxt.Tlsoffset = 0 // dummy value, not needed
                }
index 0a1529e833cf97b5e454a1a0b42e9c1fb077a762..bd14d34b90abe36d8edd7f46c4de32c82b3696f5 100644 (file)
@@ -16,7 +16,7 @@ import (
 
 func TestSystemRoots(t *testing.T) {
        switch runtime.GOARCH {
-       case "arm", "arm64":
+       case "arm64":
                t.Skipf("skipping on %s/%s, no system root", runtime.GOOS, runtime.GOARCH)
        }
 
index 05ddb499203bc85a3e217ad1859a91bf6af0ab52..7151ba11806d671fba7af938d655212089edf9d4 100644 (file)
@@ -111,11 +111,8 @@ func TestMultiplePackageImport(t *testing.T) {
 }
 
 func TestLocalDirectory(t *testing.T) {
-       if runtime.GOOS == "darwin" {
-               switch runtime.GOARCH {
-               case "arm", "arm64":
-                       t.Skipf("skipping on %s/%s, no valid GOROOT", runtime.GOOS, runtime.GOARCH)
-               }
+       if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
+               t.Skipf("skipping on %s/%s, no valid GOROOT", runtime.GOOS, runtime.GOARCH)
        }
 
        cwd, err := os.Getwd()
@@ -244,11 +241,8 @@ func TestMatchFile(t *testing.T) {
 }
 
 func TestImportCmd(t *testing.T) {
-       if runtime.GOOS == "darwin" {
-               switch runtime.GOARCH {
-               case "arm", "arm64":
-                       t.Skipf("skipping on %s/%s, no valid GOROOT", runtime.GOOS, runtime.GOARCH)
-               }
+       if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
+               t.Skipf("skipping on %s/%s, no valid GOROOT", runtime.GOOS, runtime.GOARCH)
        }
 
        p, err := Import("cmd/internal/objfile", "", 0)
index 91ecae836a0976d2ad493e6adcc6a760ef7e9f90..6585855bb4c219a41a6b3ea7c1e67bf79e691893 100644 (file)
@@ -517,7 +517,7 @@ func listStdPkgs(goroot string) ([]string, error) {
 }
 
 func TestDependencies(t *testing.T) {
-       iOS := runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64")
+       iOS := runtime.GOOS == "darwin" && runtime.GOARCH == "arm64"
        if iOS {
                // Tests run in a limited file system and we do not
                // provide access to every source file.
index 0ccf60aadde609485b79a62559652b89c003a2c8..663753a18a03c93ba8bf5f3b5fb5bcb738c7f2e9 100644 (file)
@@ -26,8 +26,7 @@ import (
 // import.
 func skipSpecialPlatforms(t *testing.T) {
        switch platform := runtime.GOOS + "-" + runtime.GOARCH; platform {
-       case "darwin-arm",
-               "darwin-arm64":
+       case "darwin-arm64":
                t.Skipf("no compiled packages available for import on %s", platform)
        }
 }
index b036aa6ebc78ce976e8735634e639cc81775ba09..309b2702ed5f183fe9cdce2403908cfe9f15140b 100644 (file)
@@ -46,7 +46,7 @@ func HasGoBuild() bool {
        case "android", "js":
                return false
        case "darwin":
-               if strings.HasPrefix(runtime.GOARCH, "arm") {
+               if runtime.GOARCH == "arm64" {
                        return false
                }
        }
@@ -125,7 +125,7 @@ func HasExec() bool {
        case "js":
                return false
        case "darwin":
-               if strings.HasPrefix(runtime.GOARCH, "arm") {
+               if runtime.GOARCH == "arm64" {
                        return false
                }
        }
@@ -136,7 +136,7 @@ func HasExec() bool {
 func HasSrc() bool {
        switch runtime.GOOS {
        case "darwin":
-               if strings.HasPrefix(runtime.GOARCH, "arm") {
+               if runtime.GOARCH == "arm64" {
                        return false
                }
        }
index 1fc1666bae221869ab55269dbbe0f3f3c5993f5e..5fa6744979545c26cf9ce12b797dd9175d778ef3 100755 (executable)
@@ -3,7 +3,7 @@
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-# For testing darwin/arm{,64} on iOS.
+# For testing darwin/arm64 on iOS.
 
 set -e
 ulimit -c 0 # no core files
@@ -20,13 +20,10 @@ if [ "$GOOS" != "darwin" ]; then
        echo "iostest.bash requires GOOS=darwin, got GOOS=$GOOS" 1>&2
        exit 1
 fi
-if [ "$GOARCH" != "arm" ] && [ "$GOARCH" != "arm64" ]; then
-       echo "iostest.bash requires GOARCH=arm or GOARCH=arm64, got GOARCH=$GOARCH" 1>&2
+if [ "$GOARCH" != "arm64" ]; then
+       echo "iostest.bash requires GOARCH=arm64, got GOARCH=$GOARCH" 1>&2
        exit 1
 fi
-if [ "$GOARCH" = "arm" ]; then
-       export GOARM=7
-fi
 
 if [ "$1" = "-restart" ]; then
        # Reboot to make sure previous runs do not interfere with the current run.
index b2cf8df4b9374a625e5f3829fc6d064129346e6b..f778e965f3b2c7104f9fd2b219fb970a1eab6ab3 100644 (file)
@@ -53,7 +53,7 @@ func testableNetwork(network string) bool {
                switch runtime.GOOS {
                case "darwin":
                        switch runtime.GOARCH {
-                       case "arm", "arm64":
+                       case "arm64":
                                return false
                        }
                case "android":
index 78feaae7f46f9e33eb5f11c647f22fa2a3a0618e..aedf643e98d2255f32079afa5afc036106de8dae 100644 (file)
@@ -991,7 +991,7 @@ func TestDialerControl(t *testing.T) {
 // except that it won't skip testing on non-mobile builders.
 func mustHaveExternalNetwork(t *testing.T) {
        t.Helper()
-       mobile := runtime.GOOS == "android" || runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64")
+       mobile := runtime.GOOS == "android" || runtime.GOOS == "darwin" && runtime.GOARCH == "arm64"
        if testenv.Builder() == "" || mobile {
                testenv.MustHaveExternalNetwork(t)
        }
index 2bc5592d5ad730c4c5da39a57d1cc63de5b10887..4956037f4bd65ca4cdbe4b7564c028f620f2fbc7 100644 (file)
@@ -74,7 +74,7 @@ func TestLookupGoogleSRV(t *testing.T) {
        t.Parallel()
        mustHaveExternalNetwork(t)
 
-       if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
+       if iOS() {
                t.Skip("no resolv.conf on iOS")
        }
 
@@ -123,7 +123,7 @@ func TestLookupGmailMX(t *testing.T) {
        t.Parallel()
        mustHaveExternalNetwork(t)
 
-       if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
+       if iOS() {
                t.Skip("no resolv.conf on iOS")
        }
 
@@ -169,7 +169,7 @@ func TestLookupGmailNS(t *testing.T) {
        t.Parallel()
        mustHaveExternalNetwork(t)
 
-       if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
+       if iOS() {
                t.Skip("no resolv.conf on iOS")
        }
 
@@ -218,7 +218,7 @@ func TestLookupGmailTXT(t *testing.T) {
        t.Parallel()
        mustHaveExternalNetwork(t)
 
-       if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
+       if iOS() {
                t.Skip("no resolv.conf on iOS")
        }
 
@@ -637,7 +637,7 @@ func TestLookupDotsWithRemoteSource(t *testing.T) {
                t.Skip("IPv4 is required")
        }
 
-       if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
+       if iOS() {
                t.Skip("no resolv.conf on iOS")
        }
 
index d35dfaade3ebc934cdbe276884a2e4e18c4006ae..d3bb918edbf9662d223055988f9ef87f9e8390fe 100644 (file)
@@ -54,7 +54,7 @@ func testableNetwork(network string) bool {
                        return unixEnabledOnAIX
                }
                // iOS does not support unix, unixgram.
-               if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
+               if iOS() {
                        return false
                }
        case "unixpacket":
@@ -81,6 +81,10 @@ func testableNetwork(network string) bool {
        return true
 }
 
+func iOS() bool {
+       return runtime.GOOS == "darwin" && runtime.GOARCH == "arm64"
+}
+
 // testableAddress reports whether address of network is testable on
 // the current platform configuration.
 func testableAddress(network, address string) bool {
index f54c9564f9e37b63d16179a31bfb0bebdc797582..51123dfbc46b44142029aebe4292de18323203b9 100644 (file)
@@ -745,7 +745,7 @@ func TestWriteTimeoutFluctuation(t *testing.T) {
        defer c.Close()
 
        d := time.Second
-       if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
+       if iOS() {
                d = 3 * time.Second // see golang.org/issue/10775
        }
        max := time.NewTimer(d)
index 9f8c82718bb60c6ba72d4959643edc2160b41ea7..94341f90e2140a11b13887a01ca278ecf8577f32 100644 (file)
@@ -482,7 +482,7 @@ func UserHomeDir() (string, error) {
        case "android":
                return "/sdcard", nil
        case "darwin":
-               if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" {
+               if runtime.GOARCH == "arm64" {
                        return "/", nil
                }
        }
index 44e1434dbe795a84b93b01c613e767fbbce949f9..978e99110c08c9a9eb8db98d6a0f2764ad3cd6a7 100644 (file)
@@ -54,7 +54,7 @@ var sysdir = func() *sysDir {
                }
        case "darwin":
                switch runtime.GOARCH {
-               case "arm", "arm64":
+               case "arm64":
                        wd, err := syscall.Getwd()
                        if err != nil {
                                wd = err.Error()
@@ -146,7 +146,7 @@ func localTmp() string {
                return TempDir()
        case "darwin":
                switch runtime.GOARCH {
-               case "arm", "arm64":
+               case "arm64":
                        return TempDir()
                }
        }
@@ -483,7 +483,7 @@ func TestReaddirnamesOneAtATime(t *testing.T) {
                dir = "/system/bin"
        case "darwin":
                switch runtime.GOARCH {
-               case "arm", "arm64":
+               case "arm64":
                        wd, err := Getwd()
                        if err != nil {
                                t.Fatal(err)
@@ -1297,7 +1297,7 @@ func TestChdirAndGetwd(t *testing.T) {
                dirs = []string{"/", "/usr"}
        case "darwin":
                switch runtime.GOARCH {
-               case "arm", "arm64":
+               case "arm64":
                        dirs = nil
                        for _, d := range []string{"d1", "d2"} {
                                dir, err := ioutil.TempDir("", d)
index 6cb25bcaa716d1a87b6e207cf55899a1fdea363e..d586daf936e918a0a1c1ebe26d1cab6c4f98c183 100644 (file)
@@ -109,8 +109,8 @@ func TestMkdirAllAtSlash(t *testing.T) {
                t.Skipf("skipping on %s", runtime.GOOS)
        case "darwin":
                switch runtime.GOARCH {
-               case "arm", "arm64":
-                       t.Skipf("skipping on darwin/%s, mkdir returns EPERM", runtime.GOARCH)
+               case "arm64":
+                       t.Skipf("skipping on darwin/arm64, mkdir returns EPERM")
                }
        }
        RemoveAll("/_go_os_test")
index 946c085a500422ceab0ffc2a9f224d59bbe7ef5d..c57bace90f36a72531a64415823714df61d30fe3 100644 (file)
@@ -24,7 +24,7 @@ func (p *Process) blockUntilWaitable() (bool, error) {
        // The waitid system call expects a pointer to a siginfo_t,
        // which is 128 bytes on all GNU/Linux systems.
        // On Darwin, it requires greater than or equal to 64 bytes
-       // for darwin/{386,arm} and 104 bytes for darwin/amd64.
+       // for darwin/386 and 104 bytes for darwin/amd64.
        // We don't care about the values it returns.
        var siginfo [16]uint64
        psig := &siginfo[0]
index 2d13149f3f62026adc075c0b120078f4d3346134..d6f680556c9bc72d76f2b91cbe7777e572fdd22d 100644 (file)
@@ -431,12 +431,9 @@ func chtmpdir(t *testing.T) (restore func()) {
 }
 
 func TestWalk(t *testing.T) {
-       if runtime.GOOS == "darwin" {
-               switch runtime.GOARCH {
-               case "arm", "arm64":
-                       restore := chtmpdir(t)
-                       defer restore()
-               }
+       if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
+               restore := chtmpdir(t)
+               defer restore()
        }
 
        tmpDir, err := ioutil.TempDir("", "TestWalk")
@@ -1281,11 +1278,8 @@ func TestDriveLetterInEvalSymlinks(t *testing.T) {
 }
 
 func TestBug3486(t *testing.T) { // https://golang.org/issue/3486
-       if runtime.GOOS == "darwin" {
-               switch runtime.GOARCH {
-               case "arm", "arm64":
-                       t.Skipf("skipping on %s/%s", runtime.GOOS, runtime.GOARCH)
-               }
+       if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
+               t.Skipf("skipping on %s/%s", runtime.GOOS, runtime.GOARCH)
        }
        root, err := filepath.EvalSymlinks(runtime.GOROOT() + "/test")
        if err != nil {
index 5b3c70130926d2615589e2c1dee10c03c7ec95ac..c02b837978a7038aa5a8c6070b25f6c111f575aa 100644 (file)
@@ -11,8 +11,7 @@ package cgo
 
 /*
 
-#cgo darwin,!arm,!arm64 LDFLAGS: -lpthread
-#cgo darwin,arm LDFLAGS: -framework CoreFoundation
+#cgo darwin,!arm64 LDFLAGS: -lpthread
 #cgo darwin,arm64 LDFLAGS: -framework CoreFoundation
 #cgo dragonfly LDFLAGS: -lpthread
 #cgo freebsd LDFLAGS: -lpthread
index e6e305789f1a2984e595aedfbdea4618721b56fa..fd7d4084c9b6cf457d5ee4defdfbc1d4d56d0393 100644 (file)
@@ -94,7 +94,7 @@ threadentry(void *v)
 }
 
 // init_working_dir sets the current working directory to the app root.
-// By default darwin/arm processes start in "/".
+// By default darwin/arm64 processes start in "/".
 static void
 init_working_dir()
 {
index c11fbec0a585258a2a088e410be240a2d9f1074c..01c40b4813dffcc9ce8e647e4e5a851ee9a4c43c 100644 (file)
@@ -289,9 +289,9 @@ func mpreinit(mp *m) {
 // Called to initialize a new m (including the bootstrap m).
 // Called on the new thread, cannot allocate memory.
 func minit() {
-       // The alternate signal stack is buggy on arm and arm64.
+       // The alternate signal stack is buggy on arm64.
        // The signal handler handles it directly.
-       if GOARCH != "arm" && GOARCH != "arm64" {
+       if GOARCH != "arm64" {
                minitSignalStack()
        }
        minitSignalMask()
@@ -301,9 +301,9 @@ func minit() {
 // Called from dropm to undo the effect of an minit.
 //go:nosplit
 func unminit() {
-       // The alternate signal stack is buggy on arm and arm64.
+       // The alternate signal stack is buggy on arm64.
        // See minit.
-       if GOARCH != "arm" && GOARCH != "arm64" {
+       if GOARCH != "arm64" {
                unminitSignals()
        }
 }
index 83b3152d684756fbbc9e989964ac100a47e127c2..e78f1a4938b4ebb36917a9f97b922b0a44ade4c6 100644 (file)
@@ -226,7 +226,7 @@ func testCPUProfile(t *testing.T, matches matchFunc, need []string, avoid []stri
        switch runtime.GOOS {
        case "darwin":
                switch runtime.GOARCH {
-               case "arm", "arm64":
+               case "arm64":
                        // nothing
                default:
                        out, err := exec.Command("uname", "-a").CombinedOutput()
index 1663d913c39ae58deabf9b4d9241930031983603..e1d19244a9790fe271026bc28bedb09d31fec340 100644 (file)
@@ -63,9 +63,7 @@ func (c *sigctxt) preparePanic(sig uint32, gp *g) {
        c.set_pc(uint32(funcPC(sigpanic)))
 }
 
-// TODO(issue 35439): enabling async preemption causes failures on darwin/arm.
-// Disable for now.
-const pushCallSupported = GOOS != "darwin"
+const pushCallSupported = true
 
 func (c *sigctxt) pushCall(targetPC uintptr) {
        // Push the LR to stack, as we'll clobber it in order to
index b8f27d1147bc38d85e5fef61e6c659aa3e8cda06..5dbfbaf4b14ba27cfa1acd0640a52d290e15c135 100644 (file)
@@ -350,8 +350,8 @@ func preemptM(mp *m) {
                // yet, so doSigPreempt won't work.
                return
        }
-       if GOOS == "darwin" && (GOARCH == "arm" || GOARCH == "arm64") && !iscgo {
-               // On darwin, we use libc calls, and cgo is required on ARM and ARM64
+       if GOOS == "darwin" && GOARCH == "arm64" && !iscgo {
+               // On darwin, we use libc calls, and cgo is required on ARM64
                // so we have TLS set up to save/restore G during C calls. If cgo is
                // absent, we cannot save/restore G in TLS, and if a signal is
                // received during C execution we cannot get the G. Therefore don't
@@ -1191,7 +1191,7 @@ func signalstack(s *stack) {
        sigaltstack(&st, nil)
 }
 
-// setsigsegv is used on darwin/arm{,64} to fake a segmentation fault.
+// setsigsegv is used on darwin/arm64 to fake a segmentation fault.
 //
 // This is exported via linkname to assembly in runtime/cgo.
 //
index bed789136896a56b2c51d7a4429e7e68d04c2177..e42de8deb4f9f7389767c7c0c3fddc1fac7b2db3 100644 (file)
 // Note: both functions will clobber R0 and R11 and
 // can be called from 5c ABI code.
 
-// On android and darwin, runtime.tls_g is a normal variable.
+// On android, runtime.tls_g is a normal variable.
 // TLS offset is computed in x_cgo_inittls.
 #ifdef GOOS_android
 #define TLSG_IS_VARIABLE
 #endif
-#ifdef GOOS_darwin
-#define TLSG_IS_VARIABLE
-#endif
 
 // save_g saves the g register into pthread-provided
 // thread-local memory, so that we can call externally compiled
index f790d3b17f201dff3cd9c19bfb0ab5895c1e8eb0..e4d1be5d8a5e69b84a4928315f1e75196db8ef37 100644 (file)
@@ -132,7 +132,7 @@ func uint64mod(n, d uint64) uint64 {
 
 //go:nosplit
 // nosplit because division is used in syscall context in nanotime on darwin/386
-// and darwin/arm where stack splits are not allowed.
+// where stack splits are not allowed.
 func int64div(n, d int64) int64 {
        // Check for 32 bit operands
        if int64(int32(n)) == n && int64(int32(d)) == d {
index aa6706c82ec87dc414572908f71ec03fb04b2694..7e624c5a21b34d5f653d08521b00eea8d89703c5 100755 (executable)
@@ -142,13 +142,6 @@ darwin_arm64)
        mktypes="GOARCH=$GOARCH go tool cgo -godefs"
        mkasm="go run mkasm_darwin.go"
        ;;
-darwin_arm)
-       mkerrors="$mkerrors -m32"
-       mksyscall="./mksyscall.pl -l32 -darwin"
-       mksysnum="./mksysnum_darwin.pl /usr/include/sys/syscall.h"
-       mktypes="GOARCH=$GOARCH go tool cgo -godefs"
-       mkasm="go run mkasm_darwin.go"
-       ;;
 dragonfly_amd64)
        mkerrors="$mkerrors -m64"
        mksyscall="./mksyscall.pl -dragonfly"
index ff47a0c81a2491fe77fe43b815db12f16036e47f..13b79ca8d81b152eb5ce3106d3c2b169b6a8e4f6 100644 (file)
@@ -70,7 +70,7 @@ func _() {
 // Thus this test also verifies that the Flock_t structure can be
 // roundtripped with F_SETLK and F_GETLK.
 func TestFcntlFlock(t *testing.T) {
-       if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
+       if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
                t.Skip("skipping; no child processes allowed on iOS")
        }
        flock := syscall.Flock_t{