Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/sys/unix: __sysctl is used on iOS instead of sysctl #35103

Closed
zx2c4 opened this issue Oct 23, 2019 · 7 comments
Closed

x/sys/unix: __sysctl is used on iOS instead of sysctl #35103

zx2c4 opened this issue Oct 23, 2019 · 7 comments

Comments

@zx2c4
Copy link
Contributor

zx2c4 commented Oct 23, 2019

In issue #34133, @mmaxim reported that the app store was rejecting his app due to the use of __sysctl, which he ascribed to the Go runtime. However, it turns out that the Go runtime uses sysctl, whereas it was x/sys/unix using __sysctl. So, x/sys/unix should be adjusted to use sysctl instead of __sysctl.

CC @eliasnaur

@gopherbot gopherbot added this to the Unreleased milestone Oct 23, 2019
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/202778 mentions this issue: syscall: reenable sysctl on iOS

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/202837 mentions this issue: unix: __sysctl is sysctl on darwin

@eliasnaur
Copy link
Contributor

Thank you. I'm sorry that I wasn't more thorough. Is this a backport candidate?

@zx2c4
Copy link
Contributor Author

zx2c4 commented Oct 23, 2019

Thank you. I'm sorry that I wasn't more thorough. Is this a backport candidate?

x/sys/unix is not relevant for backports. Perhaps you meant to chime in on #35101 for which there is already a backport candidate in #35105

Or are you thinking that we should update the vendored x/sys/unix and backport that?

gopherbot pushed a commit that referenced this issue Oct 23, 2019
This was disabled due to a report that the App Store rejects the symbol
__sysctl. However, we use the sysctl symbol, which is fine. The __sysctl
symbol is used by x/sys/unix, which needs fixing instead. So, this
commit reenables sysctl on iOS, so that things like net.InterfaceByName
can work again.

This reverts CL 193843, CL 193844, CL 193845, and CL 193846.

Fixes #35101
Updates #34133
Updates #35103

Change-Id: Ib8eb9f87b81db24965b0de29d99eb52887c7c60a
Reviewed-on: https://go-review.googlesource.com/c/go/+/202778
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/202779 mentions this issue: [release-branch.go1.13] syscall: reenable sysctl on iOS

@alexaliu
Copy link

The change fails for me on macOS 10.14.6 (mojave) with

vendor/golang.org/x/sys/unix.libc_sysctl_trampoline·f: relocation target vendor/golang.org/x/sys/unix.libc_sysctl_trampoline not defined

I think the issue is that the assembly files still refer to
libc___sysctl_trampoline and libc___sysctl instead of libc_sysctl. Changing it to lib_sysctl fixes the issue for me, at least for amd64.

These files look like they're generated though, so I'm not sure if this analysis is correct.

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/202958 mentions this issue: unix: regenerate darwin libc trampolines after CL 202837

gopherbot pushed a commit to golang/sys that referenced this issue Oct 24, 2019
CL 202837 forgot to properly re-generate
zsyscall_darwin_{386,amd64,arm64}.s with the correct trampoline name.

Updates golang/go#35103
Updates golang/go#34133
Updates golang/go#35101

Change-Id: I98805988f97c7ff51da858fdc36c436aa680c8c7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/202958
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
gopherbot pushed a commit that referenced this issue Oct 25, 2019
This was disabled due to a report that the App Store rejects the symbol
__sysctl. However, we use the sysctl symbol, which is fine. The __sysctl
symbol is used by x/sys/unix, which needs fixing instead. So, this
commit reenables sysctl on iOS, so that things like net.InterfaceByName
can work again.

This reverts CL 193843, CL 193844, CL 193845, and CL 193846.

Fixes #35105
Updates #35101
Updates #34133
Updates #35103

Change-Id: Ib8eb9f87b81db24965b0de29d99eb52887c7c60a
Reviewed-on: https://go-review.googlesource.com/c/go/+/202778
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/c/go/+/202779
Reviewed-by: Elias Naur <mail@eliasnaur.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
@golang golang locked and limited conversation to collaborators Oct 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants