]> Cypherpunks.ru repositories - gostls13.git/commitdiff
all: add GOOS=ios
authorCherry Zhang <cherryyz@google.com>
Wed, 16 Sep 2020 20:59:58 +0000 (16:59 -0400)
committerCherry Zhang <cherryyz@google.com>
Wed, 23 Sep 2020 18:12:59 +0000 (18:12 +0000)
Introduce GOOS=ios for iOS systems. GOOS=ios matches "darwin"
build tag, like GOOS=android matches "linux" and GOOS=illumos
matches "solaris". Only ios/arm64 is supported (ios/amd64 is
not).

GOOS=ios and GOOS=darwin remain essentially the same at this
point. They will diverge at later time, to differentiate macOS
and iOS.

Uses of GOOS=="darwin" are changed to (GOOS=="darwin" || GOOS=="ios"),
except if it clearly means macOS (e.g. GOOS=="darwin" && GOARCH=="amd64"),
it remains GOOS=="darwin".

Updates #38485.

Change-Id: I4faacdc1008f42434599efb3c3ad90763a83b67c
Reviewed-on: https://go-review.googlesource.com/c/go/+/254740
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
99 files changed:
doc/install-source.html
misc/cgo/test/issue18146.go
misc/cgo/test/pkg_test.go
misc/cgo/test/sigaltstack.go
misc/cgo/test/test.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
src/archive/tar/stat_unix.go
src/cmd/cgo/gcc.go
src/cmd/compile/internal/arm64/ggen.go
src/cmd/compile/internal/ssa/config.go
src/cmd/dist/build.go
src/cmd/dist/test.go
src/cmd/doc/doc_test.go
src/cmd/go/alldocs.go
src/cmd/go/go_test.go
src/cmd/go/internal/bug/bug.go
src/cmd/go/internal/help/helpdoc.go
src/cmd/go/internal/imports/build.go
src/cmd/go/internal/load/pkg.go
src/cmd/go/internal/work/build_test.go
src/cmd/go/internal/work/exec.go
src/cmd/go/internal/work/init.go
src/cmd/internal/archive/archive_test.go
src/cmd/internal/dwarf/dwarf.go
src/cmd/internal/objabi/head.go
src/cmd/internal/objabi/util.go
src/cmd/internal/sys/supported.go
src/cmd/link/internal/ld/ar.go
src/cmd/link/internal/ld/config.go
src/cmd/link/internal/ld/outbuf_test.go
src/cmd/nm/nm_test.go
src/crypto/x509/root_darwin_ios_gen.go
src/crypto/x509/root_darwin_iosx.go [moved from src/crypto/x509/root_darwin_ios.go with 100% similarity]
src/debug/elf/file_test.go
src/go/build/build.go
src/go/build/build_test.go
src/go/build/syslist.go
src/go/build/syslist_test.go
src/internal/poll/read_test.go
src/internal/testenv/testenv.go
src/log/syslog/syslog_test.go
src/net/conf.go
src/net/dial_test.go
src/net/http/cgi/host.go
src/net/interface_unix_test.go
src/net/lookup_test.go
src/net/main_test.go
src/net/platform_test.go
src/net/sock_bsd.go
src/net/tcpsock_test.go
src/net/udpsock_test.go
src/net/writev_test.go
src/os/file_unix.go
src/os/os_test.go
src/os/path_test.go
src/os/removeall_test.go
src/path/filepath/path_test.go
src/runtime/debug/panic_test.go
src/runtime/internal/sys/gengoos.go
src/runtime/internal/sys/zgoos_aix.go
src/runtime/internal/sys/zgoos_android.go
src/runtime/internal/sys/zgoos_darwin.go
src/runtime/internal/sys/zgoos_dragonfly.go
src/runtime/internal/sys/zgoos_freebsd.go
src/runtime/internal/sys/zgoos_hurd.go
src/runtime/internal/sys/zgoos_illumos.go
src/runtime/internal/sys/zgoos_ios.go [new file with mode: 0644]
src/runtime/internal/sys/zgoos_js.go
src/runtime/internal/sys/zgoos_linux.go
src/runtime/internal/sys/zgoos_netbsd.go
src/runtime/internal/sys/zgoos_openbsd.go
src/runtime/internal/sys/zgoos_plan9.go
src/runtime/internal/sys/zgoos_solaris.go
src/runtime/internal/sys/zgoos_windows.go
src/runtime/internal/sys/zgoos_zos.go
src/runtime/malloc.go
src/runtime/mgcscavenge.go
src/runtime/mkpreempt.go
src/runtime/pprof/pprof_rusage.go
src/runtime/pprof/pprof_test.go
src/runtime/preempt_arm64.s
src/runtime/proc.go
src/runtime/runtime2.go
src/runtime/signal_unix.go
src/runtime/sigqueue.go
src/runtime/stack.go
src/runtime/tls_arm64.h
src/runtime/tls_arm64.s
src/syscall/exec_unix.go
src/syscall/sockcmsg_unix_other.go
src/syscall/syscall_bsd.go
src/syscall/syscall_unix.go
src/syscall/syscall_unix_test.go
src/time/tick_test.go
src/time/zoneinfo_darwin_arm64.go [moved from src/time/zoneinfo_ios.go with 96% similarity]

index cbf4eac70b0ceb5d922541d547bc11e308c52965..86a4644c0ca9e148d390e7b91c2fbb6c685087d4 100644 (file)
@@ -507,8 +507,8 @@ These default to the values of <code>$GOHOSTOS</code> and
 
 <p>
 Choices for <code>$GOOS</code> are
-<code>android</code>, <code>darwin</code> (macOS/iOS),
-<code>dragonfly</code>, <code>freebsd</code>, <code>illumos</code>, <code>js</code>,
+<code>android</code>, <code>darwin</code>, <code>dragonfly</code>,
+<code>freebsd</code>, <code>illumos</code>, <code>ios</code>, <code>js</code>,
 <code>linux</code>, <code>netbsd</code>, <code>openbsd</code>,
 <code>plan9</code>, <code>solaris</code> and <code>windows</code>.
 </p>
@@ -567,6 +567,9 @@ The valid combinations of <code>$GOOS</code> and <code>$GOARCH</code> are:
 <td></td><td><code>illumos</code></td> <td><code>amd64</code></td>
 </tr>
 <tr>
+<td></td><td><code>ios</code></td> <td><code>arm64</code></td>
+</tr>
+<tr>
 <td></td><td><code>js</code></td> <td><code>wasm</code></td>
 </tr>
 <tr>
index 196d98f507982fa1dfce9fbc6c11e08073e0ac35..f92d6c7f939d22078a428f4ebfc8a80541cd0fdc 100644 (file)
@@ -24,7 +24,7 @@ func test18146(t *testing.T) {
                t.Skip("skipping in short mode")
        }
 
-       if runtime.GOOS == "darwin" {
+       if runtime.GOOS == "darwin" || runtime.GOOS == "ios" {
                t.Skipf("skipping flaky test on %s; see golang.org/issue/18202", runtime.GOOS)
        }
 
index 26c50ad883f643b74ef69c54324e5e6219f49221..a28ad4ea74f6b11c68e6edbbeb36e2105eb01de0 100644 (file)
@@ -30,7 +30,7 @@ func TestCrossPackageTests(t *testing.T) {
        switch runtime.GOOS {
        case "android":
                t.Skip("Can't exec cmd/go subprocess on Android.")
-       case "darwin":
+       case "darwin", "ios":
                switch runtime.GOARCH {
                case "arm64":
                        t.Skip("Can't exec cmd/go subprocess on iOS.")
index 8dfa1cb5adb4e1eddd029ffda9fb0afab5951ead..27b753a147a3228f39d5d15734280fc9657605c5 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 == "arm64":
+       case runtime.GOOS == "solaris", runtime.GOOS == "illumos", (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && runtime.GOARCH == "arm64":
                t.Skipf("switching signal stack not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
        }
 
index 05fa52b3810dba05baed7a277ae631e656d8ebdd..a78f88499b2a11c81e38371d25992c351c6b9b92 100644 (file)
@@ -1776,7 +1776,7 @@ func test14838(t *testing.T) {
 var sink C.int
 
 func test17065(t *testing.T) {
-       if runtime.GOOS == "darwin" {
+       if runtime.GOOS == "darwin" || runtime.GOOS == "ios" {
                t.Skip("broken on darwin; issue 17065")
        }
        for i := range C.ii {
index 7fbc5c64b31cdbcb6e0d525e1dc6e53906479e59..2b2e69ec00f162e7f2c9c0f141c73704ec2c7c83 100644 (file)
@@ -164,7 +164,7 @@ func Add(x int) {
 }
 
 func testCthread(t *testing.T) {
-       if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
+       if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && runtime.GOARCH == "arm64" {
                t.Skip("the iOS exec wrapper is unable to properly handle the panic from Add")
        }
        sum.i = 0
index b4a046c4bc41ae63ae5a594bd2c2efd750ea2e7c..2e223ea369f455cf4632c252f3590f795737370e 100644 (file)
@@ -118,9 +118,9 @@ func testMain(m *testing.M) int {
                cc = append(cc, s[start:])
        }
 
-       if GOOS == "darwin" {
+       if GOOS == "darwin" || GOOS == "ios" {
                // For Darwin/ARM.
-               // TODO(crawshaw): can we do better?
+               // TODO: do we still need this?
                cc = append(cc, []string{"-framework", "CoreFoundation", "-framework", "Foundation"}...)
        }
        if GOOS == "aix" {
@@ -133,7 +133,7 @@ func testMain(m *testing.M) int {
                libbase = "gccgo_" + libgodir + "_fPIC"
        } else {
                switch GOOS {
-               case "darwin":
+               case "darwin", "ios":
                        if GOARCH == "arm64" {
                                libbase += "_shared"
                        }
@@ -303,7 +303,7 @@ func TestInstall(t *testing.T) {
 
 func TestEarlySignalHandler(t *testing.T) {
        switch GOOS {
-       case "darwin":
+       case "darwin", "ios":
                switch GOARCH {
                case "arm64":
                        t.Skipf("skipping on %s/%s; see https://golang.org/issue/13701", GOOS, GOARCH)
@@ -384,7 +384,7 @@ func TestSignalForwarding(t *testing.T) {
        expectSignal(t, err, syscall.SIGSEGV)
 
        // SIGPIPE is never forwarded on darwin. See golang.org/issue/33384.
-       if runtime.GOOS != "darwin" {
+       if runtime.GOOS != "darwin" && runtime.GOOS != "ios" {
                // Test SIGPIPE forwarding
                cmd = exec.Command(bin[0], append(bin[1:], "3")...)
 
@@ -485,7 +485,7 @@ func TestSignalForwardingExternal(t *testing.T) {
 // doesn't work on this platform.
 func checkSignalForwardingTest(t *testing.T) {
        switch GOOS {
-       case "darwin":
+       case "darwin", "ios":
                switch GOARCH {
                case "arm64":
                        t.Skipf("skipping on %s/%s; see https://golang.org/issue/13701", GOOS, GOARCH)
@@ -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 == "arm64" {
+       if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && runtime.GOARCH == "arm64" {
                t.Skip("shell scripts are not executable on iOS hosts")
        }
 
@@ -645,7 +645,7 @@ func TestExtar(t *testing.T) {
 
 func TestPIE(t *testing.T) {
        switch GOOS {
-       case "windows", "darwin", "plan9":
+       case "windows", "darwin", "ios", "plan9":
                t.Skipf("skipping PIE test on %s", GOOS)
        }
 
@@ -738,7 +738,7 @@ func TestSIGPROF(t *testing.T) {
        switch GOOS {
        case "windows", "plan9":
                t.Skipf("skipping SIGPROF test on %s", GOOS)
-       case "darwin":
+       case "darwin", "ios":
                t.Skipf("skipping SIGPROF test on %s; see https://golang.org/issue/19320", GOOS)
        }
 
@@ -841,7 +841,7 @@ func TestCompileWithoutShared(t *testing.T) {
        expectSignal(t, err, syscall.SIGSEGV)
 
        // SIGPIPE is never forwarded on darwin. See golang.org/issue/33384.
-       if runtime.GOOS != "darwin" {
+       if runtime.GOOS != "darwin" && runtime.GOOS != "ios" {
                binArgs := append(cmdToRun(exe), "3")
                t.Log(binArgs)
                out, err = exec.Command(binArgs[0], binArgs[1:]...).CombinedOutput()
index bd4d341820ecfa610493846eeb4428523ff61041..d557f34b0ff113f293076ae0e3bec3b8df235d3f 100644 (file)
@@ -98,7 +98,7 @@ func testMain(m *testing.M) int {
        }
 
        switch GOOS {
-       case "darwin":
+       case "darwin", "ios":
                // For Darwin/ARM.
                // TODO(crawshaw): can we do better?
                cc = append(cc, []string{"-framework", "CoreFoundation", "-framework", "Foundation"}...)
@@ -107,7 +107,7 @@ func testMain(m *testing.M) int {
        }
        libgodir := GOOS + "_" + GOARCH
        switch GOOS {
-       case "darwin":
+       case "darwin", "ios":
                if GOARCH == "arm64" {
                        libgodir += "_shared"
                }
@@ -407,7 +407,7 @@ func TestUnexportedSymbols(t *testing.T) {
        adbPush(t, libname)
 
        linkFlags := "-Wl,--no-as-needed"
-       if GOOS == "darwin" {
+       if GOOS == "darwin" || GOOS == "ios" {
                linkFlags = ""
        }
 
@@ -636,7 +636,7 @@ func copyFile(t *testing.T, dst, src string) {
 
 func TestGo2C2Go(t *testing.T) {
        switch GOOS {
-       case "darwin":
+       case "darwin", "ios":
                // Darwin shared libraries don't support the multiple
                // copies of the runtime package implied by this test.
                t.Skip("linking c-shared into Go programs not supported on Darwin; issue 29061")
index bdd6bd84685c9ca936861b16f6bc86662733009b..57f0fd34f78aca081045e20a22c9f3c68e10cbbd 100644 (file)
@@ -21,7 +21,7 @@ func requireTestSOSupported(t *testing.T) {
        t.Helper()
        switch runtime.GOARCH {
        case "arm64":
-               if runtime.GOOS == "darwin" {
+               if runtime.GOOS == "darwin" || runtime.GOOS == "ios" {
                        t.Skip("No exec facility on iOS.")
                }
        case "ppc64":
@@ -74,7 +74,7 @@ func TestSO(t *testing.T) {
        ext := "so"
        args := append(gogccflags, "-shared")
        switch runtime.GOOS {
-       case "darwin":
+       case "darwin", "ios":
                ext = "dylib"
                args = append(args, "-undefined", "suppress", "-flat_namespace")
        case "windows":
@@ -119,7 +119,7 @@ func TestSO(t *testing.T) {
        cmd.Env = append(os.Environ(), "GOPATH="+GOPATH)
        if runtime.GOOS != "windows" {
                s := "LD_LIBRARY_PATH"
-               if runtime.GOOS == "darwin" {
+               if runtime.GOOS == "darwin" || runtime.GOOS == "ios" {
                        s = "DYLD_LIBRARY_PATH"
                }
                cmd.Env = append(os.Environ(), s+"=.")
index bdd6bd84685c9ca936861b16f6bc86662733009b..57f0fd34f78aca081045e20a22c9f3c68e10cbbd 100644 (file)
@@ -21,7 +21,7 @@ func requireTestSOSupported(t *testing.T) {
        t.Helper()
        switch runtime.GOARCH {
        case "arm64":
-               if runtime.GOOS == "darwin" {
+               if runtime.GOOS == "darwin" || runtime.GOOS == "ios" {
                        t.Skip("No exec facility on iOS.")
                }
        case "ppc64":
@@ -74,7 +74,7 @@ func TestSO(t *testing.T) {
        ext := "so"
        args := append(gogccflags, "-shared")
        switch runtime.GOOS {
-       case "darwin":
+       case "darwin", "ios":
                ext = "dylib"
                args = append(args, "-undefined", "suppress", "-flat_namespace")
        case "windows":
@@ -119,7 +119,7 @@ func TestSO(t *testing.T) {
        cmd.Env = append(os.Environ(), "GOPATH="+GOPATH)
        if runtime.GOOS != "windows" {
                s := "LD_LIBRARY_PATH"
-               if runtime.GOOS == "darwin" {
+               if runtime.GOOS == "darwin" || runtime.GOOS == "ios" {
                        s = "DYLD_LIBRARY_PATH"
                }
                cmd.Env = append(os.Environ(), s+"=.")
index d1576db41d5edb5b79aa00b007a826089e17194f..8df3616990267a3862417e6d72445e2d4d44dcbc 100644 (file)
@@ -66,7 +66,7 @@ func statUnix(fi os.FileInfo, h *Header) error {
                        minor := uint32((dev & 0x00000000000000ff) >> 0)
                        minor |= uint32((dev & 0x00000ffffff00000) >> 12)
                        h.Devmajor, h.Devminor = int64(major), int64(minor)
-               case "darwin":
+               case "darwin", "ios":
                        // Copied from golang.org/x/sys/unix/dev_darwin.go.
                        major := uint32((dev >> 24) & 0xff)
                        minor := uint32(dev & 0xffffff)
index 730db44990ecaf1106c8a3f153931d697171d8e8..111a309eb5c026c78c99808c7ae8bfe25ee7b2a0 100644 (file)
@@ -298,7 +298,7 @@ func (p *Package) guessKinds(f *File) []*Name {
                        continue
                }
 
-               if goos == "darwin" && strings.HasSuffix(n.C, "Ref") {
+               if (goos == "darwin" || goos == "ios") && strings.HasSuffix(n.C, "Ref") {
                        // For FooRef, find out if FooGetTypeID exists.
                        s := n.C[:len(n.C)-3] + "GetTypeID"
                        n := &Name{Go: s, C: s}
@@ -3075,7 +3075,7 @@ func (c *typeConv) badCFType(dt *dwarf.TypedefType) bool {
        // We identify the correct set of types as those ending in Ref and for which
        // there exists a corresponding GetTypeID function.
        // See comment below for details about the bad pointers.
-       if goos != "darwin" {
+       if goos != "darwin" && goos != "ios" {
                return false
        }
        s := dt.Name
index f698919e9b268ab7d922d2c6fe400997a71fda56..f3fec03854f16c8308f0efce89a33b3c665c8bd4 100644 (file)
@@ -11,7 +11,7 @@ import (
        "cmd/internal/objabi"
 )
 
-var darwin = objabi.GOOS == "darwin"
+var darwin = objabi.GOOS == "darwin" || objabi.GOOS == "ios"
 
 func padframe(frame int64) int64 {
        // arm64 requires that the frame size (not counting saved FP&LR)
index 4b2f06def11ff689186f3af5af788cd7269bfe7f..7f01f8047fb458d59759a4461383c60d455065ba 100644 (file)
@@ -248,7 +248,7 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize bool) *Config
                c.FPReg = framepointerRegARM64
                c.LinkReg = linkRegARM64
                c.hasGReg = true
-               c.noDuffDevice = objabi.GOOS == "darwin" // darwin linker cannot handle BR26 reloc with non-zero addend
+               c.noDuffDevice = objabi.GOOS == "darwin" || objabi.GOOS == "ios" // darwin linker cannot handle BR26 reloc with non-zero addend
        case "ppc64":
                c.BigEndian = true
                fallthrough
index 397b3bb88f181a3775dda279fa5a848e2cafb7de..3ac742fa557398d385e738701308252926718025 100644 (file)
@@ -80,6 +80,7 @@ var okgoos = []string{
        "darwin",
        "dragonfly",
        "illumos",
+       "ios",
        "js",
        "linux",
        "android",
@@ -970,7 +971,10 @@ func matchtag(tag string) bool {
                }
                return !matchtag(tag[1:])
        }
-       return tag == "gc" || tag == goos || tag == goarch || tag == "cmd_go_bootstrap" || tag == "go1.1" || (goos == "android" && tag == "linux") || (goos == "illumos" && tag == "solaris")
+       return tag == "gc" || tag == goos || tag == goarch || tag == "cmd_go_bootstrap" || tag == "go1.1" ||
+               (goos == "android" && tag == "linux") ||
+               (goos == "illumos" && tag == "solaris") ||
+               (goos == "ios" && tag == "darwin")
 }
 
 // shouldbuild reports whether we should build this file.
@@ -984,7 +988,7 @@ func shouldbuild(file, pkg string) bool {
        name := filepath.Base(file)
        excluded := func(list []string, ok string) bool {
                for _, x := range list {
-                       if x == ok || (ok == "android" && x == "linux") || (ok == "illumos" && x == "solaris") {
+                       if x == ok || (ok == "android" && x == "linux") || (ok == "illumos" && x == "solaris") || (ok == "ios" && x == "darwin") {
                                continue
                        }
                        i := strings.Index(name, x)
@@ -1462,7 +1466,7 @@ func wrapperPathFor(goos, goarch string) string {
                if gohostos != "android" {
                        return pathf("%s/misc/android/go_android_exec.go", goroot)
                }
-       case goos == "darwin" && goarch == "arm64":
+       case (goos == "darwin" || goos == "ios") && goarch == "arm64":
                if gohostos != "darwin" || gohostarch != "arm64" {
                        return pathf("%s/misc/ios/go_darwin_arm_exec.go", goroot)
                }
@@ -1541,6 +1545,7 @@ var cgoEnabled = map[string]bool{
        "android/amd64":   true,
        "android/arm":     true,
        "android/arm64":   true,
+       "ios/arm64":       true,
        "js/wasm":         false,
        "netbsd/386":      true,
        "netbsd/amd64":    true,
index 5ea5c81656def7f707afd8ea9f0dbeedd075a5c5..f953a76963a169ebc0d303712818b418d6293c87 100644 (file)
@@ -464,7 +464,7 @@ func (t *tester) registerTests() {
        }
 
        // Test the ios build tag on darwin/amd64 for the iOS simulator.
-       if goos == "darwin" && !t.iOS() {
+       if goos == "darwin" && goarch == "amd64" {
                t.tests = append(t.tests, distTest{
                        name:    "amd64ios",
                        heading: "ios tag on darwin/amd64",
@@ -903,7 +903,7 @@ func (t *tester) addCmd(dt *distTest, dir string, cmdline ...interface{}) *exec.
 }
 
 func (t *tester) iOS() bool {
-       return goos == "darwin" && goarch == "arm64"
+       return (goos == "darwin" || goos == "ios") && goarch == "arm64"
 }
 
 func (t *tester) out(v string) {
@@ -943,7 +943,10 @@ func (t *tester) internalLink() bool {
        if goos == "android" {
                return false
        }
-       if t.iOS() {
+       if goos == "ios" {
+               return false
+       }
+       if goos == "darwin" && goarch == "arm64" {
                return false
        }
        // Internally linking cgo is incomplete on some architectures.
index f13d917634cf0df57cb8cffb14a28e9623acd121..47602833d357099472709abe1a04466d5c866e90 100644 (file)
@@ -36,8 +36,8 @@ func TestMain(m *testing.M) {
 }
 
 func maybeSkip(t *testing.T) {
-       if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
-               t.Skip("darwin/arm64 does not have a full file tree")
+       if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && runtime.GOARCH == "arm64" {
+               t.Skip("iOS does not have a full file tree")
        }
 }
 
index 804ca9e5a54c68a89c64485909fdc11f415b7e85..4bc87008ffbeb768610edad0dd3d8663d322f06b 100644 (file)
 // Using GOOS=illumos matches build tags and files as for GOOS=solaris
 // in addition to illumos tags and files.
 //
+// Using GOOS=ios matches build tags and files as for GOOS=darwin
+// in addition to ios tags and files.
+//
 // To keep a file from being considered for the build:
 //
 //     // +build ignore
index 021930a8a8170106002e7d6cde64b749c43d49be..66a52c86ad92fa04e2ffe434fec9c9e3167a65f7 100644 (file)
@@ -58,7 +58,7 @@ func init() {
        switch runtime.GOOS {
        case "android", "js":
                canRun = false
-       case "darwin":
+       case "darwin", "ios":
                switch runtime.GOARCH {
                case "arm64":
                        canRun = false
index 52bd40f2fb1cd3699840b539992e1f92f57ae843..07e35168554a8e808df0897a6649a7750ac68d6a 100644 (file)
@@ -105,7 +105,7 @@ func printGoDetails(w io.Writer) {
 
 func printOSDetails(w io.Writer) {
        switch runtime.GOOS {
-       case "darwin":
+       case "darwin", "ios":
                printCmdOut(w, "uname -v: ", "uname", "-v")
                printCmdOut(w, "", "sw_vers")
        case "linux":
index e1f0521ea412bf33857a7ec6c61bf3032d0987e4..0ae5fd7ca9672970a9b5d81bf8351a28bb984cad 100644 (file)
@@ -838,6 +838,9 @@ in addition to android tags and files.
 Using GOOS=illumos matches build tags and files as for GOOS=solaris
 in addition to illumos tags and files.
 
+Using GOOS=ios matches build tags and files as for GOOS=darwin
+in addition to ios tags and files.
+
 To keep a file from being considered for the build:
 
        // +build ignore
index eb070eef4c1bede105ba2f45675b259afe681840..50aeabc578c93094ce776e99d25d0612e7397bbc 100644 (file)
@@ -141,6 +141,9 @@ func matchTag(name string, tags map[string]bool, want bool) bool {
        if name == "solaris" {
                have = have || tags["illumos"]
        }
+       if name == "darwin" {
+               have = have || tags["ios"]
+       }
        return have == want
 }
 
@@ -158,6 +161,7 @@ func matchTag(name string, tags map[string]bool, want bool) bool {
 // Exceptions:
 //     if GOOS=android, then files with GOOS=linux are also matched.
 //     if GOOS=illumos, then files with GOOS=solaris are also matched.
+//     if GOOS=ios, then files with GOOS=darwin are also matched.
 //
 // If tags["*"] is true, then MatchFile will consider all possible
 // GOOS and GOARCH to be available and will consequently
@@ -208,6 +212,7 @@ var KnownOS = map[string]bool{
        "freebsd":   true,
        "hurd":      true,
        "illumos":   true,
+       "ios":       true,
        "js":        true,
        "linux":     true,
        "nacl":      true, // legacy; don't remove
index 1cbd7962e789fa2618ec047cc75883f5fabd8bf4..5cc77915e7c23154bab8c812ef4914ec4a212371 100644 (file)
@@ -1950,7 +1950,7 @@ func externalLinkingForced(p *Package) bool {
                if cfg.BuildContext.GOARCH != "arm64" {
                        return true
                }
-       case "darwin":
+       case "darwin", "ios":
                if cfg.BuildContext.GOARCH == "arm64" {
                        return true
                }
index c33de2635dc34f536421f8efeebd6aabe48e3a24..afed0fba723ed34a8fcbadfb911f1638b655cc00 100644 (file)
@@ -221,7 +221,7 @@ func pkgImportPath(pkgpath string) *load.Package {
 // See https://golang.org/issue/18878.
 func TestRespectSetgidDir(t *testing.T) {
        switch runtime.GOOS {
-       case "darwin":
+       case "darwin", "ios":
                if runtime.GOARCH == "arm64" {
                        t.Skip("can't set SetGID bit with chmod on iOS")
                }
index afd6fd6d3fbf4176827fd8edb1643a4f47828be8..51fc2b588df2808c7de3c12dcfc042b0e10d5570 100644 (file)
@@ -2424,7 +2424,7 @@ func (b *Builder) compilerCmd(compiler []string, incdir, workdir string) []strin
        // On OS X, some of the compilers behave as if -fno-common
        // is always set, and the Mach-O linker in 6l/8l assumes this.
        // See https://golang.org/issue/3253.
-       if cfg.Goos == "darwin" {
+       if cfg.Goos == "darwin" || cfg.Goos == "ios" {
                a = append(a, "-fno-common")
        }
 
index 42692acd3b3eb9b748fb8ea0c1ea9f3b984d9180..b0d6133768f66686204b123bfc47e1c9452123a5 100644 (file)
@@ -121,7 +121,7 @@ func buildModeInit() {
                        codegenArg = "-fPIC"
                } else {
                        switch cfg.Goos {
-                       case "darwin":
+                       case "darwin", "ios":
                                switch cfg.Goarch {
                                case "arm64":
                                        codegenArg = "-shared"
@@ -157,7 +157,7 @@ func buildModeInit() {
                        ldBuildmode = "pie"
                case "windows":
                        ldBuildmode = "pie"
-               case "darwin":
+               case "darwin", "ios":
                        switch cfg.Goarch {
                        case "arm64":
                                codegenArg = "-shared"
index 1468a582105c6ba63e5ebd69536d107d59a76d8e..cb4eb842b452572102d7ff99c8c07d802be518b0 100644 (file)
@@ -243,7 +243,7 @@ func TestParseCGOArchive(t *testing.T) {
        c1 := "c1"
        c2 := "c2"
        switch runtime.GOOS {
-       case "darwin":
+       case "darwin", "ios":
                c1 = "_" + c1
                c2 = "_" + c2
        case "windows":
@@ -275,7 +275,7 @@ func TestParseCGOArchive(t *testing.T) {
 
                obj := io.NewSectionReader(f, e.Offset, e.Size)
                switch runtime.GOOS {
-               case "darwin":
+               case "darwin", "ios":
                        mf, err := macho.NewFile(obj)
                        if err != nil {
                                t.Fatal(err)
index 6ab83639acef3cd8e49117e6c8cfc6edc34f20e4..b2fd5262bb02bbc0824f9696ca6590817e6590ac 100644 (file)
@@ -378,7 +378,7 @@ func expandPseudoForm(form uint8) uint8 {
                return form
        }
        expandedForm := DW_FORM_udata
-       if objabi.GOOS == "darwin" {
+       if objabi.GOOS == "darwin" || objabi.GOOS == "ios" {
                expandedForm = DW_FORM_data4
        }
        return uint8(expandedForm)
index 95b8db3809b520e98b23b6cfff18e45e47a3d19a..48ff292307f477a24c8fd88d21b0aaca55960191 100644 (file)
@@ -54,7 +54,7 @@ func (h *HeadType) Set(s string) error {
        switch s {
        case "aix":
                *h = Haix
-       case "darwin":
+       case "darwin", "ios":
                *h = Hdarwin
        case "dragonfly":
                *h = Hdragonfly
index d2d6fdbda8d75ce038832c56fb44cd454bbd020d..b81b73a02234947d6080eb652efa84c48ac377f7 100644 (file)
@@ -139,7 +139,7 @@ func init() {
 }
 
 // Note: must agree with runtime.framepointer_enabled.
-var Framepointer_enabled = GOARCH == "amd64" || GOARCH == "arm64" && (GOOS == "linux" || GOOS == "darwin")
+var Framepointer_enabled = GOARCH == "amd64" || GOARCH == "arm64" && (GOOS == "linux" || GOOS == "darwin" || GOOS == "ios")
 
 func addexp(s string) {
        // Could do general integer parsing here, but the runtime copy doesn't yet.
index c27b3b986d8b8169102dde85e0706f7b05115bee..b2b3b02bf6e9b9444e5760b619b208a3f9b11698 100644 (file)
@@ -38,7 +38,7 @@ func MustLinkExternal(goos, goarch string) bool {
                if goarch != "arm64" {
                        return true
                }
-       case "darwin":
+       case "darwin", "ios":
                if goarch == "arm64" {
                        return true
                }
index 52adbc3bab5af734aae091672e091fe8132eeb1b..e4fd591676626ce56a6213a66b67274361c97d6c 100644 (file)
@@ -170,7 +170,7 @@ func readArmap(filename string, f *bio.Reader, arhdr ArHdr) archiveMap {
 
                // For Mach-O and PE/386 files we strip a leading
                // underscore from the symbol name.
-               if objabi.GOOS == "darwin" || (objabi.GOOS == "windows" && objabi.GOARCH == "386") {
+               if objabi.GOOS == "darwin" || objabi.GOOS == "ios" || (objabi.GOOS == "windows" && objabi.GOARCH == "386") {
                        if name[0] == '_' && len(name) > 1 {
                                name = name[1:]
                        }
index 2373b500e3aae1b879470e66cf8ececc16ec793f..9aa59fa3e37e50333da0f803f8bd069328a43aad 100644 (file)
@@ -51,7 +51,7 @@ func (mode *BuildMode) Set(s string) error {
                *mode = BuildModePIE
        case "c-archive":
                switch objabi.GOOS {
-               case "aix", "darwin", "linux":
+               case "aix", "darwin", "ios", "linux":
                case "freebsd":
                        switch objabi.GOARCH {
                        case "amd64":
index db0a92485ea961b53143768d08219769fbab73f1..e6643da396e4972cb332009f43e2833ad2c4b8f4 100644 (file)
@@ -17,7 +17,7 @@ func TestMMap(t *testing.T) {
        switch runtime.GOOS {
        default:
                t.Skip("unsupported OS")
-       case "aix", "darwin", "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "windows":
+       case "aix", "darwin", "ios", "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "windows":
        }
        dir, err := ioutil.TempDir("", "TestMMap")
        if err != nil {
index 5d7fff0f99ebad8346fa90943cb1c0a53981b24e..413a4eb06f34b45ec26f38d75fba5992dc5b764d 100644 (file)
@@ -283,7 +283,7 @@ func testGoLib(t *testing.T, iscgo bool) {
        if iscgo {
                syms = append(syms, symType{"B", "mylib.TestCgodata", false, false})
                syms = append(syms, symType{"T", "mylib.TestCgofunc", false, false})
-               if runtime.GOOS == "darwin" || (runtime.GOOS == "windows" && runtime.GOARCH == "386") {
+               if runtime.GOOS == "darwin" || runtime.GOOS == "ios" || (runtime.GOOS == "windows" && runtime.GOARCH == "386") {
                        syms = append(syms, symType{"D", "_cgodata", true, false})
                        syms = append(syms, symType{"T", "_cgofunc", true, false})
                } else if runtime.GOOS == "aix" {
index 7a42466e5f0a1cd36a64ad6d05842fb0b2396809..61152b4d112640f901fa67d23af1d13fc1628ab3 100644 (file)
@@ -4,7 +4,7 @@
 
 // +build ignore
 
-// Generates root_darwin_ios.go.
+// Generates root_darwin_iosx.go.
 //
 // As of iOS 13, there is no API for querying the system trusted X.509 root
 // certificates.
@@ -37,7 +37,10 @@ import (
 )
 
 func main() {
-       var output = flag.String("output", "root_darwin_ios.go", "file name to write")
+       // Temporarily name the file _iosx.go, to avoid restricting it to GOOS=ios,
+       // as this is also used for darwin/arm64 (macOS).
+       // TODO: maybe use darwin/amd64 implementation on macOS arm64?
+       var output = flag.String("output", "root_darwin_iosx.go", "file name to write")
        var version = flag.String("version", "", "security_certificates version")
        flag.Parse()
        if *version == "" {
index 24948e696ae39396e8ddd91afa76b25192724c25..4c6fdeece9c941bed02b6b4493bfc67787611657 100644 (file)
@@ -899,7 +899,7 @@ func TestCompressedSection(t *testing.T) {
 func TestNoSectionOverlaps(t *testing.T) {
        // Ensure cmd/link outputs sections without overlaps.
        switch runtime.GOOS {
-       case "aix", "android", "darwin", "js", "plan9", "windows":
+       case "aix", "android", "darwin", "ios", "js", "plan9", "windows":
                t.Skipf("cmd/link doesn't produce ELF binaries on %s", runtime.GOOS)
        }
        _ = net.ResolveIPAddr // force dynamic linkage
index 6b75aad9cf6df223e344132b8505c99e96b2010e..5c3d8761305974fe04290fdb9253843c0bd6424d 100644 (file)
@@ -1754,6 +1754,9 @@ func (ctxt *Context) match(name string, allTags map[string]bool) bool {
        if ctxt.GOOS == "illumos" && name == "solaris" {
                return true
        }
+       if ctxt.GOOS == "ios" && name == "darwin" {
+               return true
+       }
 
        // other tags
        for _, tag := range ctxt.BuildTags {
@@ -1781,7 +1784,10 @@ func (ctxt *Context) match(name string, allTags map[string]bool) bool {
 //     name_$(GOARCH)_test.*
 //     name_$(GOOS)_$(GOARCH)_test.*
 //
-// An exception: if GOOS=android, then files with GOOS=linux are also matched.
+// Exceptions:
+// if GOOS=android, then files with GOOS=linux are also matched.
+// if GOOS=illumos, then files with GOOS=solaris are also matched.
+// if GOOS=ios, then files with GOOS=darwin are also matched.
 func (ctxt *Context) goodOSArchFile(name string, allTags map[string]bool) bool {
        if dot := strings.Index(name, "."); dot != -1 {
                name = name[:dot]
index a7f2a3e9028f4b37e9d702a2700f0e6f4ad99dbc..22c62ce87db029e02863b2f27348560a61f80235 100644 (file)
@@ -120,7 +120,7 @@ func TestMultiplePackageImport(t *testing.T) {
 }
 
 func TestLocalDirectory(t *testing.T) {
-       if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
+       if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && runtime.GOARCH == "arm64" {
                t.Skipf("skipping on %s/%s, no valid GOROOT", runtime.GOOS, runtime.GOARCH)
        }
 
@@ -250,7 +250,7 @@ func TestMatchFile(t *testing.T) {
 }
 
 func TestImportCmd(t *testing.T) {
-       if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
+       if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && runtime.GOARCH == "arm64" {
                t.Skipf("skipping on %s/%s, no valid GOROOT", runtime.GOOS, runtime.GOARCH)
        }
 
index fbfe4c46779ae2603f8b88837507af4f0f13fae0..1275f7c986d36799a8022139fa694861a5ef340d 100644 (file)
@@ -7,5 +7,5 @@ package build
 // List of past, present, and future known GOOS and GOARCH values.
 // Do not remove from this list, as these are used for go/build filename matching.
 
-const goosList = "aix android darwin dragonfly freebsd hurd illumos js linux nacl netbsd openbsd plan9 solaris windows zos "
+const goosList = "aix android darwin dragonfly freebsd hurd illumos ios js linux nacl netbsd openbsd plan9 solaris windows zos "
 const goarchList = "386 amd64 amd64p32 arm armbe arm64 arm64be ppc64 ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le ppc riscv riscv64 s390 s390x sparc sparc64 wasm "
index 7973ff4ee5f0caee4db24b87def3ed1df01c956b..2b7b4c71aaabfb8d376b0faafa131a2159e02a8f 100644 (file)
@@ -17,7 +17,7 @@ var (
 )
 
 func anotherOS() string {
-       if thisOS != "darwin" {
+       if thisOS != "darwin" && thisOS != "ios" {
                return "darwin"
        }
        return "linux"
index b4f5236d3eaa3ac78158d1fd215f5fea8d7ffdf0..2d4ef97da03261bd945fe0173cac43cb094d7f45 100644 (file)
@@ -38,7 +38,7 @@ func TestRead(t *testing.T) {
 func specialFiles() []string {
        var ps []string
        switch runtime.GOOS {
-       case "darwin", "dragonfly", "freebsd", "netbsd", "openbsd":
+       case "darwin", "ios", "dragonfly", "freebsd", "netbsd", "openbsd":
                ps = []string{
                        "/dev/null",
                }
index 309b2702ed5f183fe9cdce2403908cfe9f15140b..cfb033b2a2c04fec5980aac7c351c96db09f67c4 100644 (file)
@@ -45,7 +45,7 @@ func HasGoBuild() bool {
        switch runtime.GOOS {
        case "android", "js":
                return false
-       case "darwin":
+       case "darwin", "ios":
                if runtime.GOARCH == "arm64" {
                        return false
                }
@@ -124,7 +124,7 @@ func HasExec() bool {
        switch runtime.GOOS {
        case "js":
                return false
-       case "darwin":
+       case "darwin", "ios":
                if runtime.GOARCH == "arm64" {
                        return false
                }
@@ -135,7 +135,7 @@ func HasExec() bool {
 // HasSrc reports whether the entire source tree is available under GOROOT.
 func HasSrc() bool {
        switch runtime.GOOS {
-       case "darwin":
+       case "darwin", "ios":
                if runtime.GOARCH == "arm64" {
                        return false
                }
index f778e965f3b2c7104f9fd2b219fb970a1eab6ab3..dd2f83e04f4c4eddb28c4e2cd5872e7b167dab91 100644 (file)
@@ -51,7 +51,7 @@ func testableNetwork(network string) bool {
        switch network {
        case "unix", "unixgram":
                switch runtime.GOOS {
-               case "darwin":
+               case "darwin", "ios":
                        switch runtime.GOARCH {
                        case "arm64":
                                return false
index 971b1a399a1bb842c89deb90c13932b8be790caa..5340847123ce675eeccadefca3a025c262caadf7 100644 (file)
@@ -69,7 +69,7 @@ func initConfVal() {
        // Darwin pops up annoying dialog boxes if programs try to do
        // their own DNS requests. So always use cgo instead, which
        // avoids that.
-       if runtime.GOOS == "darwin" {
+       if runtime.GOOS == "darwin" || runtime.GOOS == "ios" {
                confVal.forceCgoLookupHost = true
                return
        }
index 01582489de12af4e64eb02c37b56c5c4a37411d1..2706de44429277f86f30aa47f43e881cd90221f9 100644 (file)
@@ -160,7 +160,7 @@ func dialClosedPort(t *testing.T) (actual, expected time.Duration) {
        // but other platforms should be instantaneous.
        if runtime.GOOS == "windows" {
                expected = 1500 * time.Millisecond
-       } else if runtime.GOOS == "darwin" {
+       } else if runtime.GOOS == "darwin" || runtime.GOOS == "ios" {
                expected = 150 * time.Millisecond
        } else {
                expected = 95 * time.Millisecond
@@ -990,7 +990,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 == "arm64"
+       mobile := runtime.GOOS == "android" || (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && runtime.GOARCH == "arm64"
        if testenv.Builder() == "" || mobile {
                testenv.MustHaveExternalNetwork(t)
        }
index 863f40638ab3412b218c09ef0c4b407c0fe065ff..624044aa09231fde75fc683e6c29439fadc77f65 100644 (file)
@@ -37,7 +37,7 @@ var trailingPort = regexp.MustCompile(`:([0-9]+)$`)
 
 var osDefaultInheritEnv = func() []string {
        switch runtime.GOOS {
-       case "darwin":
+       case "darwin", "ios":
                return []string{"DYLD_LIBRARY_PATH"}
        case "linux", "freebsd", "openbsd":
                return []string{"LD_LIBRARY_PATH"}
index 6a2b7f1a88b2051d29be1d9d7bb3210c20699e9a..bf41a0fb82de3a8b98ba6610f8550b1d0c5382f5 100644 (file)
@@ -46,7 +46,7 @@ func TestPointToPointInterface(t *testing.T) {
        if testing.Short() {
                t.Skip("avoid external network")
        }
-       if runtime.GOOS == "darwin" {
+       if runtime.GOOS == "darwin" || runtime.GOOS == "ios" {
                t.Skipf("not supported on %s", runtime.GOOS)
        }
        if os.Getuid() != 0 {
index 68bffcab8fb5baa280e2ef69762ababa14483521..32a0d377da3ed4b13b9a93c276eec625d9ee3436 100644 (file)
@@ -511,7 +511,7 @@ func TestDNSFlood(t *testing.T) {
        defer dnsWaitGroup.Wait()
 
        var N = 5000
-       if runtime.GOOS == "darwin" {
+       if runtime.GOOS == "darwin" || runtime.GOOS == "ios" {
                // On Darwin this test consumes kernel threads much
                // than other platforms for some reason.
                // When we monitor the number of allocated Ms by
@@ -628,7 +628,7 @@ func TestLookupDotsWithLocalSource(t *testing.T) {
 }
 
 func TestLookupDotsWithRemoteSource(t *testing.T) {
-       if runtime.GOOS == "darwin" {
+       if runtime.GOOS == "darwin" || runtime.GOOS == "ios" {
                testenv.SkipFlaky(t, 27992)
        }
        mustHaveExternalNetwork(t)
index 85a269d0f4de103b8283f6bf5978a5bff32f837e..2d5be2ee5f81c1b634b84b0ce002306252e3d5e5 100644 (file)
@@ -133,7 +133,7 @@ func setupTestData() {
                        {"udp6", "[" + addr + "%" + ifi.Name + "]:0", false},
                }...)
                switch runtime.GOOS {
-               case "darwin", "dragonfly", "freebsd", "openbsd", "netbsd":
+               case "darwin", "ios", "dragonfly", "freebsd", "openbsd", "netbsd":
                        ipv6LinkLocalUnicastTCPTests = append(ipv6LinkLocalUnicastTCPTests, []ipv6LinkLocalUnicastTest{
                                {"tcp", "[localhost%" + ifi.Name + "]:0", true},
                                {"tcp6", "[localhost%" + ifi.Name + "]:0", true},
index d3bb918edbf9662d223055988f9ef87f9e8390fe..4b92bb6df00e20f87466cd4ac1bc7d1b8f696808 100644 (file)
@@ -59,7 +59,7 @@ func testableNetwork(network string) bool {
                }
        case "unixpacket":
                switch runtime.GOOS {
-               case "aix", "android", "darwin", "plan9", "windows":
+               case "aix", "android", "darwin", "ios", "plan9", "windows":
                        return false
                case "netbsd":
                        // It passes on amd64 at least. 386 fails (Issue 22927). arm is unknown.
@@ -82,7 +82,7 @@ func testableNetwork(network string) bool {
 }
 
 func iOS() bool {
-       return runtime.GOOS == "darwin" && runtime.GOARCH == "arm64"
+       return (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && runtime.GOARCH == "arm64"
 }
 
 // testableAddress reports whether address of network is testable on
index 516e557cfd29816ac1904dc577bbd5bec9ec22d9..73fb6be814eb8acfcdf20599a516703fae9d2ea7 100644 (file)
@@ -17,7 +17,7 @@ func maxListenerBacklog() int {
                err error
        )
        switch runtime.GOOS {
-       case "darwin":
+       case "darwin", "ios":
                n, err = syscall.SysctlUint32("kern.ipc.somaxconn")
        case "freebsd":
                n, err = syscall.SysctlUint32("kern.ipc.soacceptqueue")
index 8a704966931d062cdab82622494278c81a19ea30..6e905aa0914b397f2c7c00a6f0a747579a28d204 100644 (file)
@@ -647,7 +647,7 @@ func TestTCPSelfConnect(t *testing.T) {
                n = 1000
        }
        switch runtime.GOOS {
-       case "darwin", "dragonfly", "freebsd", "netbsd", "openbsd", "plan9", "illumos", "solaris", "windows":
+       case "darwin", "ios", "dragonfly", "freebsd", "netbsd", "openbsd", "plan9", "illumos", "solaris", "windows":
                // Non-Linux systems take a long time to figure
                // out that there is nothing listening on localhost.
                n = 100
index 947381a57b0ba0d274e275732c93832955dc085f..327eba65412d9b9770da9b40330264bfa8d38eb4 100644 (file)
@@ -327,7 +327,7 @@ func TestUDPZeroBytePayload(t *testing.T) {
        switch runtime.GOOS {
        case "plan9":
                t.Skipf("not supported on %s", runtime.GOOS)
-       case "darwin":
+       case "darwin", "ios":
                testenv.SkipFlaky(t, 29225)
        }
 
index d6dce3cc6954a83ef25089ede626bf86f4ed3cdf..a6b3285e5705b7d4f7fbcb6b51bcf0aec0ce9d25 100644 (file)
@@ -154,7 +154,7 @@ func testBuffer_writeTo(t *testing.T, chunks int, useCopy bool) {
 
                var wantSum int
                switch runtime.GOOS {
-               case "android", "darwin", "dragonfly", "freebsd", "illumos", "linux", "netbsd", "openbsd":
+               case "android", "darwin", "ios", "dragonfly", "freebsd", "illumos", "linux", "netbsd", "openbsd":
                        var wantMinCalls int
                        wantSum = want.Len()
                        v := chunks
index 5446dd500357791cfe9712efb7c899f0373083c8..dc7d868a32bed7ed672d4b0b7e55c65b46a9bd9a 100644 (file)
@@ -129,7 +129,7 @@ func newFile(fd uintptr, name string, kind newFileKind) *File {
        // used with kqueue.
        if kind == kindOpenFile {
                switch runtime.GOOS {
-               case "darwin", "dragonfly", "freebsd", "netbsd", "openbsd":
+               case "darwin", "ios", "dragonfly", "freebsd", "netbsd", "openbsd":
                        var st syscall.Stat_t
                        err := ignoringEINTR(func() error {
                                return syscall.Fstat(fdi, &st)
@@ -150,7 +150,7 @@ func newFile(fd uintptr, name string, kind newFileKind) *File {
                        // on Darwin, kqueue does not work properly with fifos:
                        // closing the last writer does not cause a kqueue event
                        // for any readers. See issue #24164.
-                       if runtime.GOOS == "darwin" && typ == syscall.S_IFIFO {
+                       if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && typ == syscall.S_IFIFO {
                                pollable = false
                        }
                }
index 3359301316e479f2bd6e0e502d224a31ddfdbb5a..2bb57d866ff37da34a2526fb01eba00ba161d435 100644 (file)
@@ -52,7 +52,7 @@ var sysdir = func() *sysDir {
                                "libpowermanager.so",
                        },
                }
-       case "darwin":
+       case "darwin", "ios":
                switch runtime.GOARCH {
                case "arm64":
                        wd, err := syscall.Getwd()
@@ -144,7 +144,7 @@ func localTmp() string {
        switch runtime.GOOS {
        case "android", "windows":
                return TempDir()
-       case "darwin":
+       case "darwin", "ios":
                switch runtime.GOARCH {
                case "arm64":
                        return TempDir()
@@ -481,7 +481,7 @@ func TestReaddirnamesOneAtATime(t *testing.T) {
        switch runtime.GOOS {
        case "android":
                dir = "/system/bin"
-       case "darwin":
+       case "darwin", "ios":
                switch runtime.GOARCH {
                case "arm64":
                        wd, err := Getwd()
@@ -1304,7 +1304,7 @@ func TestChdirAndGetwd(t *testing.T) {
                dirs = []string{"/system/bin"}
        case "plan9":
                dirs = []string{"/", "/usr"}
-       case "darwin":
+       case "darwin", "ios":
                switch runtime.GOARCH {
                case "arm64":
                        dirs = nil
index d586daf936e918a0a1c1ebe26d1cab6c4f98c183..3fe9c5ffa36d335794cfc2e21d49115011a75ad5 100644 (file)
@@ -107,7 +107,7 @@ func TestMkdirAllAtSlash(t *testing.T) {
        switch runtime.GOOS {
        case "android", "plan9", "windows":
                t.Skipf("skipping on %s", runtime.GOOS)
-       case "darwin":
+       case "darwin", "ios":
                switch runtime.GOARCH {
                case "arm64":
                        t.Skipf("skipping on darwin/arm64, mkdir returns EPERM")
index 8a71f687ed0d7ccfe30885c33fe2eb97e81d2d02..1e5c650fe1a807d65ca0c4fcfcfe8155d5be0f0c 100644 (file)
@@ -158,7 +158,7 @@ func TestRemoveAllLarge(t *testing.T) {
 
 func TestRemoveAllLongPath(t *testing.T) {
        switch runtime.GOOS {
-       case "aix", "darwin", "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "illumos", "solaris":
+       case "aix", "darwin", "ios", "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "illumos", "solaris":
                break
        default:
                t.Skip("skipping for not implemented platforms")
index d6f680556c9bc72d76f2b91cbe7777e572fdd22d..ca100ff071c0472b22caa762a1fa56299baee103 100644 (file)
@@ -431,7 +431,7 @@ func chtmpdir(t *testing.T) (restore func()) {
 }
 
 func TestWalk(t *testing.T) {
-       if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
+       if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && runtime.GOARCH == "arm64" {
                restore := chtmpdir(t)
                defer restore()
        }
@@ -1278,7 +1278,7 @@ func TestDriveLetterInEvalSymlinks(t *testing.T) {
 }
 
 func TestBug3486(t *testing.T) { // https://golang.org/issue/3486
-       if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
+       if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && runtime.GOARCH == "arm64" {
                t.Skipf("skipping on %s/%s", runtime.GOOS, runtime.GOARCH)
        }
        root, err := filepath.EvalSymlinks(runtime.GOROOT() + "/test")
index 4b7830e10051240a7e312082819fcd520df07aed..93be216985f48d5ebe572787d102baac3e8fe127 100644 (file)
@@ -20,7 +20,7 @@ func TestPanicOnFault(t *testing.T) {
        if runtime.GOARCH == "s390x" {
                t.Skip("s390x fault addresses are missing the low order bits")
        }
-       if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
+       if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && runtime.GOARCH == "arm64" {
                t.Skip("darwin/arm64 doesn't provide fault addresses")
        }
        m, err := syscall.Mmap(-1, 0, 0x1000, syscall.PROT_READ /* Note: no PROT_WRITE */, syscall.MAP_SHARED|syscall.MAP_ANON)
index 952b13649d64321e0a2725f0d9ab6caa85597cf3..2a4bf0c3b4b30bd76ccfcfdacf3c398bf3380ebe 100644 (file)
@@ -44,6 +44,9 @@ func main() {
        }
 
        for _, target := range gooses {
+               if target == "nacl" {
+                       continue
+               }
                var buf bytes.Buffer
                fmt.Fprintf(&buf, "// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.\n\n")
                if target == "linux" {
@@ -52,6 +55,9 @@ func main() {
                if target == "solaris" {
                        fmt.Fprintf(&buf, "// +build !illumos\n") // must explicitly exclude illumos for solaris
                }
+               if target == "darwin" {
+                       fmt.Fprintf(&buf, "// +build !ios\n") // must explicitly exclude ios for darwin
+               }
                fmt.Fprintf(&buf, "// +build %s\n\n", target) // must explicitly include target for bootstrapping purposes
                fmt.Fprintf(&buf, "package sys\n\n")
                fmt.Fprintf(&buf, "const GOOS = `%s`\n\n", target)
@@ -69,6 +75,9 @@ func main() {
        }
 
        for _, target := range goarches {
+               if target == "amd64p32" {
+                       continue
+               }
                var buf bytes.Buffer
                fmt.Fprintf(&buf, "// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.\n\n")
                fmt.Fprintf(&buf, "// +build %s\n\n", target) // must explicitly include target for bootstrapping purposes
index d97485c43cb4f0a34104cf21cb28451a43b3e07d..0631d02aa55a43cfd1fe6ec4a3325a7ded166e84 100644 (file)
@@ -13,6 +13,7 @@ const GoosDragonfly = 0
 const GoosFreebsd = 0
 const GoosHurd = 0
 const GoosIllumos = 0
+const GoosIos = 0
 const GoosJs = 0
 const GoosLinux = 0
 const GoosNacl = 0
index eec970b0647f609dd8e85f014b4414d1e709fbce..d356a40bec65ec2482436188c8c0a8c337447231 100644 (file)
@@ -13,6 +13,7 @@ const GoosDragonfly = 0
 const GoosFreebsd = 0
 const GoosHurd = 0
 const GoosIllumos = 0
+const GoosIos = 0
 const GoosJs = 0
 const GoosLinux = 0
 const GoosNacl = 0
index c40819ee559d559ea171e98c18fb3f0a35772c62..6aa2db7e3a753fb1010b17a0265a4cec486468b9 100644 (file)
@@ -1,5 +1,6 @@
 // Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
 
+// +build !ios
 // +build darwin
 
 package sys
@@ -13,6 +14,7 @@ const GoosDragonfly = 0
 const GoosFreebsd = 0
 const GoosHurd = 0
 const GoosIllumos = 0
+const GoosIos = 0
 const GoosJs = 0
 const GoosLinux = 0
 const GoosNacl = 0
index 3dc4edcc31b7771fc95a30e4a09648589ac690a1..88ee1174f1efe45cbfba026da7d0bc89271b5734 100644 (file)
@@ -13,6 +13,7 @@ const GoosDragonfly = 1
 const GoosFreebsd = 0
 const GoosHurd = 0
 const GoosIllumos = 0
+const GoosIos = 0
 const GoosJs = 0
 const GoosLinux = 0
 const GoosNacl = 0
index 6c98b342f9ceb39a1b60e8cbdc6aa3b103f6c21d..8de2ec0559ee152814d24d2ad936d77742227a24 100644 (file)
@@ -13,6 +13,7 @@ const GoosDragonfly = 0
 const GoosFreebsd = 1
 const GoosHurd = 0
 const GoosIllumos = 0
+const GoosIos = 0
 const GoosJs = 0
 const GoosLinux = 0
 const GoosNacl = 0
index d6dcc7bad456b5a0dbe186951a8126be73e82b6a..183ccb02a1ea793f86d6e22f8c3ae1ed6c3c48a8 100644 (file)
@@ -13,6 +13,7 @@ const GoosDragonfly = 0
 const GoosFreebsd = 0
 const GoosHurd = 1
 const GoosIllumos = 0
+const GoosIos = 0
 const GoosJs = 0
 const GoosLinux = 0
 const GoosNacl = 0
index 17f4ecc34edc3d1cedef54d33b04e3e7c9520bed..d04134e1df52d74019aaf2d1afecf833ced15c01 100644 (file)
@@ -13,6 +13,7 @@ const GoosDragonfly = 0
 const GoosFreebsd = 0
 const GoosHurd = 0
 const GoosIllumos = 1
+const GoosIos = 0
 const GoosJs = 0
 const GoosLinux = 0
 const GoosNacl = 0
diff --git a/src/runtime/internal/sys/zgoos_ios.go b/src/runtime/internal/sys/zgoos_ios.go
new file mode 100644 (file)
index 0000000..cf6e9d6
--- /dev/null
@@ -0,0 +1,25 @@
+// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+
+// +build ios
+
+package sys
+
+const GOOS = `ios`
+
+const GoosAix = 0
+const GoosAndroid = 0
+const GoosDarwin = 0
+const GoosDragonfly = 0
+const GoosFreebsd = 0
+const GoosHurd = 0
+const GoosIllumos = 0
+const GoosIos = 1
+const GoosJs = 0
+const GoosLinux = 0
+const GoosNacl = 0
+const GoosNetbsd = 0
+const GoosOpenbsd = 0
+const GoosPlan9 = 0
+const GoosSolaris = 0
+const GoosWindows = 0
+const GoosZos = 0
index 74c9943d9bf2522e332861930d57691043c9bf4c..1d9279ab389ba56cb1eb7785be8ff07495f00c40 100644 (file)
@@ -13,6 +13,7 @@ const GoosDragonfly = 0
 const GoosFreebsd = 0
 const GoosHurd = 0
 const GoosIllumos = 0
+const GoosIos = 0
 const GoosJs = 1
 const GoosLinux = 0
 const GoosNacl = 0
index 1d5fcb06856a47b768bb13d45fd92282b6713d5b..0f718d704ff66260a9916a81eb090e858b9e978b 100644 (file)
@@ -14,6 +14,7 @@ const GoosDragonfly = 0
 const GoosFreebsd = 0
 const GoosHurd = 0
 const GoosIllumos = 0
+const GoosIos = 0
 const GoosJs = 0
 const GoosLinux = 1
 const GoosNacl = 0
index 194fa6e4326efe423c746a586a289ef0710dbef0..2ae149ff13c78342307bd77897d314335ca81602 100644 (file)
@@ -13,6 +13,7 @@ const GoosDragonfly = 0
 const GoosFreebsd = 0
 const GoosHurd = 0
 const GoosIllumos = 0
+const GoosIos = 0
 const GoosJs = 0
 const GoosLinux = 0
 const GoosNacl = 0
index 210869167999db56bf4532928747f39c4ae30f01..7d4d61e4ca33b6d9d6cf792e46eb2db8bcfc746f 100644 (file)
@@ -13,6 +13,7 @@ const GoosDragonfly = 0
 const GoosFreebsd = 0
 const GoosHurd = 0
 const GoosIllumos = 0
+const GoosIos = 0
 const GoosJs = 0
 const GoosLinux = 0
 const GoosNacl = 0
index e632a90b2e01bd2de5e62f7d6ddea77cae76ca0d..30aec46df33e39ed43943a14fe21af672dfcadaa 100644 (file)
@@ -13,6 +13,7 @@ const GoosDragonfly = 0
 const GoosFreebsd = 0
 const GoosHurd = 0
 const GoosIllumos = 0
+const GoosIos = 0
 const GoosJs = 0
 const GoosLinux = 0
 const GoosNacl = 0
index 67b2ffbfcd9501af0ef479b184c9014d5bcf7f13..4bb8c99bce0ab26a21bc71d8f28d5c0f3280c748 100644 (file)
@@ -14,6 +14,7 @@ const GoosDragonfly = 0
 const GoosFreebsd = 0
 const GoosHurd = 0
 const GoosIllumos = 0
+const GoosIos = 0
 const GoosJs = 0
 const GoosLinux = 0
 const GoosNacl = 0
index cf2d6f4fb08f15d8dd5256e701507efe6a1e6464..d1f4290204683f3dda3ddabed03c10aab867293e 100644 (file)
@@ -13,6 +13,7 @@ const GoosDragonfly = 0
 const GoosFreebsd = 0
 const GoosHurd = 0
 const GoosIllumos = 0
+const GoosIos = 0
 const GoosJs = 0
 const GoosLinux = 0
 const GoosNacl = 0
index e5d79accb4c5158778e73ecb6ae805374250918b..d22be46fc028997aef28e3d6259a920a482862ee 100644 (file)
@@ -13,6 +13,7 @@ const GoosDragonfly = 0
 const GoosFreebsd = 0
 const GoosHurd = 0
 const GoosIllumos = 0
+const GoosIos = 0
 const GoosJs = 0
 const GoosLinux = 0
 const GoosNacl = 0
index e46327f9ce4b857ddb8d1001a7f43d2a6c495313..4fa14996c2e47aaedbe6f338b18d18dda5c3482a 100644 (file)
@@ -207,7 +207,7 @@ const (
        // arenaBaseOffset to offset into the top 4 GiB.
        //
        // WebAssembly currently has a limit of 4GB linear memory.
-       heapAddrBits = (_64bit*(1-sys.GoarchWasm)*(1-sys.GoosDarwin*sys.GoarchArm64))*48 + (1-_64bit+sys.GoarchWasm)*(32-(sys.GoarchMips+sys.GoarchMipsle)) + 33*sys.GoosDarwin*sys.GoarchArm64
+       heapAddrBits = (_64bit*(1-sys.GoarchWasm)*(1-(sys.GoosDarwin+sys.GoosIos)*sys.GoarchArm64))*48 + (1-_64bit+sys.GoarchWasm)*(32-(sys.GoarchMips+sys.GoarchMipsle)) + 33*(sys.GoosDarwin+sys.GoosIos)*sys.GoarchArm64
 
        // maxAlloc is the maximum size of an allocation. On 64-bit,
        // it's theoretically possible to allocate 1<<heapAddrBits bytes. On
@@ -521,7 +521,7 @@ func mallocinit() {
                for i := 0x7f; i >= 0; i-- {
                        var p uintptr
                        switch {
-                       case GOARCH == "arm64" && GOOS == "darwin":
+                       case GOARCH == "arm64" && (GOOS == "darwin" || GOOS == "ios"):
                                p = uintptr(i)<<40 | uintptrMask&(0x0013<<28)
                        case GOARCH == "arm64":
                                p = uintptr(i)<<40 | uintptrMask&(0x0040<<32)
index b74da1057aa18a561f974dd096fa1e5ecfb9ad29..9d6f5517682fece1142bb526f4c35b108b8b5a3d 100644 (file)
@@ -90,7 +90,7 @@ const (
        //
        // This ratio is used as part of multiplicative factor to help the scavenger account
        // for the additional costs of using scavenged memory in its pacing.
-       scavengeCostRatio = 0.7 * sys.GoosDarwin
+       scavengeCostRatio = 0.7 * (sys.GoosDarwin + sys.GoosIos)
 
        // scavengeReservationShards determines the amount of memory the scavenger
        // should reserve for scavenging at a time. Specifically, the amount of
index 44dea22ef300056e619590c116eb96322bf4c7f5..c2e14cdcd638ad7f4ba8c6adc39b3189448cdecd 100644 (file)
@@ -361,6 +361,9 @@ func genARM64() {
        p("#ifdef GOOS_darwin")
        p("MOVD R30, (RSP)")
        p("#endif")
+       p("#ifdef GOOS_ios")
+       p("MOVD R30, (RSP)")
+       p("#endif")
 
        l.save()
        p("CALL ·asyncPreempt2(SB)")
index d42e6ed4737cb6689b79a7f30947de674286f09b..79546738119abe3be39f8fb06b614a7f05001a97 100644 (file)
@@ -19,7 +19,7 @@ func addMaxRSS(w io.Writer) {
        switch runtime.GOOS {
        case "linux", "android":
                rssToBytes = 1024
-       case "darwin":
+       case "darwin", "ios":
                rssToBytes = 1
        default:
                panic("unsupported OS")
index 7149bfb31f0247f6e5f78cf7f42a7c3c7ce2060a..43307aeab9cfac7e30a218d5f1708ce20cd1d1bd 100644 (file)
@@ -262,7 +262,7 @@ func parseProfile(t *testing.T, valBytes []byte, f func(uintptr, []*profile.Loca
 // as interpreted by matches, and returns the parsed profile.
 func testCPUProfile(t *testing.T, matches matchFunc, need []string, avoid []string, f func(dur time.Duration)) *profile.Profile {
        switch runtime.GOOS {
-       case "darwin":
+       case "darwin", "ios":
                switch runtime.GOARCH {
                case "arm64":
                        // nothing
@@ -280,7 +280,7 @@ func testCPUProfile(t *testing.T, matches matchFunc, need []string, avoid []stri
 
        broken := false
        switch runtime.GOOS {
-       case "darwin", "dragonfly", "netbsd", "illumos", "solaris":
+       case "darwin", "ios", "dragonfly", "netbsd", "illumos", "solaris":
                broken = true
        case "openbsd":
                if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" {
index 3c27b52de13b7507ee00139b87ede13c272a1c0e..d0e77659c36cf061f7b7a2a99cef38e81f63011e 100644 (file)
@@ -13,6 +13,9 @@ TEXT ·asyncPreempt(SB),NOSPLIT|NOFRAME,$0-0
        #ifdef GOOS_darwin
        MOVD R30, (RSP)
        #endif
+       #ifdef GOOS_ios
+       MOVD R30, (RSP)
+       #endif
        MOVD R0, 8(RSP)
        MOVD R1, 16(RSP)
        MOVD R2, 24(RSP)
index 5b6a30d40bc884a6bfe85ef79ecc8c2dd9b602d9..a1e2ed068037775ed912bc9f9892ae3cb8cc59fb 100644 (file)
@@ -503,7 +503,7 @@ func cpuinit() {
        var env string
 
        switch GOOS {
-       case "aix", "darwin", "dragonfly", "freebsd", "netbsd", "openbsd", "illumos", "solaris", "linux":
+       case "aix", "darwin", "ios", "dragonfly", "freebsd", "netbsd", "openbsd", "illumos", "solaris", "linux":
                cpu.DebugOptions = true
 
                // Similar to goenv_unix but extracts the environment value for
@@ -1158,7 +1158,7 @@ func mstart() {
 
        // Exit this thread.
        switch GOOS {
-       case "windows", "solaris", "illumos", "plan9", "darwin", "aix":
+       case "windows", "solaris", "illumos", "plan9", "darwin", "ios", "aix":
                // Windows, Solaris, illumos, Darwin, AIX and Plan 9 always system-allocate
                // the stack, but put it in _g_.stack before mstart,
                // so the logic above hasn't set osStack yet.
@@ -1487,7 +1487,7 @@ func allocm(_p_ *p, fn func(), id int64) *m {
 
        // In case of cgo or Solaris or illumos or Darwin, pthread_create will make us a stack.
        // Windows and Plan 9 will layout sched stack on OS stack.
-       if iscgo || GOOS == "solaris" || GOOS == "illumos" || GOOS == "windows" || GOOS == "plan9" || GOOS == "darwin" {
+       if iscgo || GOOS == "solaris" || GOOS == "illumos" || GOOS == "windows" || GOOS == "plan9" || GOOS == "darwin" || GOOS == "ios" {
                mp.g0 = malg(-1)
        } else {
                mp.g0 = malg(8192 * sys.StackGuardMultiplier)
@@ -4077,7 +4077,7 @@ func sigprof(pc, sp, lr uintptr, gp *g, mp *m) {
                // Normal traceback is impossible or has failed.
                // See if it falls into several common cases.
                n = 0
-               if (GOOS == "windows" || GOOS == "solaris" || GOOS == "illumos" || GOOS == "darwin" || GOOS == "aix") && mp.libcallg != 0 && mp.libcallpc != 0 && mp.libcallsp != 0 {
+               if (GOOS == "windows" || GOOS == "solaris" || GOOS == "illumos" || GOOS == "darwin" || GOOS == "ios" || GOOS == "aix") && mp.libcallg != 0 && mp.libcallpc != 0 && mp.libcallsp != 0 {
                        // Libcall, i.e. runtime syscall on windows.
                        // Collect Go stack that leads to the call.
                        n = gentraceback(mp.libcallpc, mp.libcallsp, 0, mp.libcallg.ptr(), 0, &stk[0], len(stk), nil, nil, 0)
index 9652b6a5a4e532b048db7debcc3eaeb81ffea2f0..48e07f789b2206946c22e9af645327b1e7bdae01 100644 (file)
@@ -1060,4 +1060,4 @@ var (
 )
 
 // Must agree with cmd/internal/objabi.Framepointer_enabled.
-const framepointer_enabled = GOARCH == "amd64" || GOARCH == "arm64" && (GOOS == "linux" || GOOS == "darwin")
+const framepointer_enabled = GOARCH == "amd64" || GOARCH == "arm64" && (GOOS == "linux" || GOOS == "darwin" || GOOS == "ios")
index bbfc18e37b3bfce60d40f58692216edd04c865b7..a3d6f34c88f1a78b6399fd825b011d6501017c3e 100644 (file)
@@ -346,7 +346,7 @@ const preemptMSupported = true
 // safe-point, it will preempt the goroutine. It always atomically
 // increments mp.preemptGen after handling a preemption request.
 func preemptM(mp *m) {
-       if GOOS == "darwin" && GOARCH == "arm64" && !iscgo {
+       if (GOOS == "darwin" || GOOS == "ios") && 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
@@ -975,7 +975,7 @@ func sigfwdgo(sig uint32, info *siginfo, ctx unsafe.Pointer) bool {
        // This function and its caller sigtrampgo assumes SIGPIPE is delivered on the
        // originating thread. This property does not hold on macOS (golang.org/issue/33384),
        // so we have no choice but to ignore SIGPIPE.
-       if GOOS == "darwin" && sig == _SIGPIPE {
+       if (GOOS == "darwin" || GOOS == "ios") && sig == _SIGPIPE {
                return true
        }
 
index 3bf07cb5a6c42f5c6ff820cbba4b57a230f70ba9..0605f5da803b2e651e3017c7d93d2f79abe9d004 100644 (file)
@@ -105,7 +105,7 @@ Send:
                        break Send
                case sigReceiving:
                        if atomic.Cas(&sig.state, sigReceiving, sigIdle) {
-                               if GOOS == "darwin" {
+                               if GOOS == "darwin" || GOOS == "ios" {
                                        sigNoteWakeup(&sig.note)
                                        break Send
                                }
@@ -140,7 +140,7 @@ func signal_recv() uint32 {
                                throw("signal_recv: inconsistent state")
                        case sigIdle:
                                if atomic.Cas(&sig.state, sigIdle, sigReceiving) {
-                                       if GOOS == "darwin" {
+                                       if GOOS == "darwin" || GOOS == "ios" {
                                                sigNoteSleep(&sig.note)
                                                break Receive
                                        }
@@ -194,7 +194,7 @@ func signal_enable(s uint32) {
        if !sig.inuse {
                // This is the first call to signal_enable. Initialize.
                sig.inuse = true // enable reception of signals; cannot disable
-               if GOOS == "darwin" {
+               if GOOS == "darwin" || GOOS == "ios" {
                        sigNoteSetup(&sig.note)
                } else {
                        noteclear(&sig.note)
index adcef071da066d92b35f44f36a945d0b1aca1a0b..3802cd049e87ea35d82cdda09d1d16b6c3f2004d 100644 (file)
@@ -66,7 +66,7 @@ const (
        // to each stack below the usual guard area for OS-specific
        // purposes like signal handling. Used on Windows, Plan 9,
        // and iOS because they do not use a separate stack.
-       _StackSystem = sys.GoosWindows*512*sys.PtrSize + sys.GoosPlan9*512 + sys.GoosDarwin*sys.GoarchArm64*1024
+       _StackSystem = sys.GoosWindows*512*sys.PtrSize + sys.GoosPlan9*512 + (sys.GoosDarwin+sys.GoosIos)*sys.GoarchArm64*1024
 
        // The minimum size of stack used by Go code
        _StackMin = 2048
index f60f4f6d5b9ff104395504c720568a1d711e5627..0804fa35026fc3b9326e227f22a408634e9045c8 100644 (file)
 #endif
 
 #ifdef GOOS_darwin
+#define TLS_darwin
+#endif
+#ifdef GOOS_ios
+#define TLS_darwin
+#endif
+#ifdef TLS_darwin
 #define TPIDR TPIDRRO_EL0
 #define TLSG_IS_VARIABLE
 #define MRS_TPIDR_R0 WORD $0xd53bd060 // MRS TPIDRRO_EL0, R0
index 999914d6550ad5b74c99211f9eeac5a9f6f12d25..7846fac6c5cf837d10996812cd1e94041e3c3ab7 100644 (file)
@@ -13,7 +13,7 @@ TEXT runtime·load_g(SB),NOSPLIT,$0
        CBZ     R0, nocgo
 
        MRS_TPIDR_R0
-#ifdef GOOS_darwin
+#ifdef TLS_darwin
        // Darwin sometimes returns unaligned pointers
        AND     $0xfffffffffffffff8, R0
 #endif
@@ -29,7 +29,7 @@ TEXT runtime·save_g(SB),NOSPLIT,$0
        CBZ     R0, nocgo
 
        MRS_TPIDR_R0
-#ifdef GOOS_darwin
+#ifdef TLS_darwin
        // Darwin sometimes returns unaligned pointers
        AND     $0xfffffffffffffff8, R0
 #endif
index cb08b7084cbf0b2f82e4df8eba4265296fb92a3c..725c2bc1f92195252f056c47c98c55da7eb144fa 100644 (file)
@@ -296,7 +296,7 @@ func Exec(argv0 string, argv []string, envv []string) (err error) {
                        uintptr(unsafe.Pointer(argv0p)),
                        uintptr(unsafe.Pointer(&argvp[0])),
                        uintptr(unsafe.Pointer(&envvp[0])))
-       } else if runtime.GOOS == "darwin" {
+       } else if runtime.GOOS == "darwin" || runtime.GOOS == "ios" {
                // Similarly on Darwin.
                err1 = execveDarwin(argv0p, &argvp[0], &envvp[0])
        } else {
index fbafbf8341014b85f30d7ffba00d7c7e71121c69..3aaf7c3616c6331aa936b155754f41447c8360d0 100644 (file)
@@ -20,7 +20,7 @@ func cmsgAlignOf(salen int) int {
        case "aix":
                // There is no alignment on AIX.
                salign = 1
-       case "darwin", "illumos", "solaris":
+       case "darwin", "ios", "illumos", "solaris":
                // NOTE: It seems like 64-bit Darwin, Illumos and Solaris
                // kernels still require 32-bit aligned access to network
                // subsystem.
index fda9d613d3b77383e192adf407564a8d49013312..b52de7450ff1df3a1e091328d19a79ddd81f8025 100644 (file)
@@ -277,7 +277,7 @@ func Accept(fd int) (nfd int, sa Sockaddr, err error) {
        if err != nil {
                return
        }
-       if runtime.GOOS == "darwin" && len == 0 {
+       if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && len == 0 {
                // Accepted socket has no address.
                // This is likely due to a bug in xnu kernels,
                // where instead of ECONNABORTED error socket
index 56abce19cd2cbccc7974b833fbc3d1b07fc126a3..91c939e0ea7c779dc9b91dda35b2665625efab27 100644 (file)
@@ -22,7 +22,7 @@ var (
 )
 
 const (
-       darwin64Bit = runtime.GOOS == "darwin" && sizeofPtr == 8
+       darwin64Bit = (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && sizeofPtr == 8
        netbsd32Bit = runtime.GOOS == "netbsd" && sizeofPtr == 4
 )
 
index 3c7982eefec80c47da144c28f5b5ec9c6ade452a..7e9bb0c3ac3b50812087a370086a3390fae15adc 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 == "arm64" {
+       if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && runtime.GOARCH == "arm64" {
                t.Skip("skipping; no child processes allowed on iOS")
        }
        flock := syscall.Flock_t{
@@ -336,7 +336,7 @@ func TestRlimit(t *testing.T) {
        }
        set := rlimit
        set.Cur = set.Max - 1
-       if runtime.GOOS == "darwin" && set.Cur > 4096 {
+       if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && set.Cur > 4096 {
                // rlim_min for RLIMIT_NOFILE should be equal to
                // or lower than kern.maxfilesperproc, which on
                // some machines are 4096. See #40564.
@@ -353,7 +353,7 @@ func TestRlimit(t *testing.T) {
        }
        set = rlimit
        set.Cur = set.Max - 1
-       if runtime.GOOS == "darwin" && set.Cur > 4096 {
+       if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && set.Cur > 4096 {
                set.Cur = 4096
        }
        if set != get {
index c0c6e76b53f733fb7306d179d9d192d4dcc0ec2e..9a1cdf9ab2eaa57b619a6e697767c2cb98c32a51 100644 (file)
@@ -21,7 +21,7 @@ func TestTicker(t *testing.T) {
        delta := 20 * Millisecond
 
        // On Darwin ARM64 the tick frequency seems limited. Issue 35692.
-       if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
+       if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && runtime.GOARCH == "arm64" {
                // The following test will run ticker count/2 times then reset
                // the ticker to double the duration for the rest of count/2.
                // Since tick frequency is limited on Darwin ARM64, use even
similarity index 96%
rename from src/time/zoneinfo_ios.go
rename to src/time/zoneinfo_darwin_arm64.go
index 6016a7925a7307e04a2f9347b127ef44ddcd53b9..65feb847114c3f412a7d0938ec0d551c63352ab1 100644 (file)
@@ -2,9 +2,6 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build darwin
-// +build arm64
-
 package time
 
 import (