Skip to content

Commit

Permalink
runtime: skip darwin osinit_hack on ios
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Dave Anderson <[email protected]>
Reviewed-by: Michael Knyszek <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Auto-Submit: Russ Cox <[email protected]>
Reviewed-by: Bryan Mills <[email protected]>
Reviewed-by: Than McIntosh <[email protected]>
  • Loading branch information
rsc authored and gopherbot committed Feb 10, 2023
1 parent 79e01ab commit f7b32f5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/runtime/sys_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit f7b32f5

Please sign in to comment.