diff options
| author | Austin Clements <austin@google.com> | 2020-04-03 12:22:27 -0400 |
|---|---|---|
| committer | Austin Clements <austin@google.com> | 2020-04-08 18:35:49 +0000 |
| commit | f7e6ab44b410ef56bb89da182948a451d3cca34c (patch) | |
| tree | 9d49b461aff716c2d398e720c9bee93c20e1898e /src/runtime | |
| parent | da8591b61c141ca58e4b3eae382d2827006344fd (diff) | |
| download | go-f7e6ab44b410ef56bb89da182948a451d3cca34c.tar.xz | |
all: remove scattered remnants of darwin/arm
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>
Diffstat (limited to 'src/runtime')
| -rw-r--r-- | src/runtime/cgo/cgo.go | 3 | ||||
| -rw-r--r-- | src/runtime/cgo/gcc_darwin_arm64.c | 2 | ||||
| -rw-r--r-- | src/runtime/os_darwin.go | 8 | ||||
| -rw-r--r-- | src/runtime/pprof/pprof_test.go | 2 | ||||
| -rw-r--r-- | src/runtime/signal_arm.go | 4 | ||||
| -rw-r--r-- | src/runtime/signal_unix.go | 6 | ||||
| -rw-r--r-- | src/runtime/tls_arm.s | 5 | ||||
| -rw-r--r-- | src/runtime/vlrt.go | 2 |
8 files changed, 13 insertions, 19 deletions
diff --git a/src/runtime/cgo/cgo.go b/src/runtime/cgo/cgo.go index 5b3c701309..c02b837978 100644 --- a/src/runtime/cgo/cgo.go +++ b/src/runtime/cgo/cgo.go @@ -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 diff --git a/src/runtime/cgo/gcc_darwin_arm64.c b/src/runtime/cgo/gcc_darwin_arm64.c index e6e305789f..fd7d4084c9 100644 --- a/src/runtime/cgo/gcc_darwin_arm64.c +++ b/src/runtime/cgo/gcc_darwin_arm64.c @@ -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() { diff --git a/src/runtime/os_darwin.go b/src/runtime/os_darwin.go index c11fbec0a5..01c40b4813 100644 --- a/src/runtime/os_darwin.go +++ b/src/runtime/os_darwin.go @@ -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() } } diff --git a/src/runtime/pprof/pprof_test.go b/src/runtime/pprof/pprof_test.go index 83b3152d68..e78f1a4938 100644 --- a/src/runtime/pprof/pprof_test.go +++ b/src/runtime/pprof/pprof_test.go @@ -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() diff --git a/src/runtime/signal_arm.go b/src/runtime/signal_arm.go index 1663d913c3..e1d19244a9 100644 --- a/src/runtime/signal_arm.go +++ b/src/runtime/signal_arm.go @@ -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 diff --git a/src/runtime/signal_unix.go b/src/runtime/signal_unix.go index b8f27d1147..5dbfbaf4b1 100644 --- a/src/runtime/signal_unix.go +++ b/src/runtime/signal_unix.go @@ -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. // diff --git a/src/runtime/tls_arm.s b/src/runtime/tls_arm.s index bed7891368..e42de8deb4 100644 --- a/src/runtime/tls_arm.s +++ b/src/runtime/tls_arm.s @@ -17,14 +17,11 @@ // 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 diff --git a/src/runtime/vlrt.go b/src/runtime/vlrt.go index f790d3b17f..e4d1be5d8a 100644 --- a/src/runtime/vlrt.go +++ b/src/runtime/vlrt.go @@ -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 { |
