]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: skip darwin osinit_hack on ios
authorRuss Cox <rsc@golang.org>
Wed, 8 Feb 2023 19:02:55 +0000 (14:02 -0500)
committerGopher Robot <gobot@golang.org>
Fri, 10 Feb 2023 16:28:15 +0000 (16:28 +0000)
Darwin needs the osinit_hack call to fix some bugs in the Apple libc
that surface when Go programs call exec. On iOS, the functions that
osinit_hack uses are not available, so signing fails. But on iOS exec
is also unavailable, so the hack is not needed. Disable it there,
which makes signing work again.

Fixes #58323.

Change-Id: I3f1472f852bb36c06854fe1f14aa27ad450c5945
Reviewed-on: https://go-review.googlesource.com/c/go/+/466516
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Dave Anderson <danderson@tailscale.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
src/runtime/sys_darwin.go

index 8bff695f5729d8d29459bf4772615f8768967260..5ba697e3047f467a64a05372afe500b6c09b7f28 100644 (file)
@@ -213,7 +213,9 @@ func pthread_kill_trampoline()
 //
 //go:nosplit
 func osinit_hack() {
-       libcCall(unsafe.Pointer(abi.FuncPCABI0(osinit_hack_trampoline)), nil)
+       if GOOS == "darwin" { // not ios
+               libcCall(unsafe.Pointer(abi.FuncPCABI0(osinit_hack_trampoline)), nil)
+       }
        return
 }
 func osinit_hack_trampoline()