Skip to content

affected/package: syscall on darwin amd64 — macOS 13.0 darwin xnu #56861

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

Closed
haraldrudell opened this issue Nov 20, 2022 · 4 comments
Closed
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@haraldrudell
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.19.3 darwin/arm64
# cross-compiling to GOOS=darwin GOARCH=amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

Cross Compiling machine:

go env Output
$ go env
GO111MODULE=""                                                                                                             
GOARCH="arm64"                                                                                                             
GOBIN=""                                                                                                                   
GOCACHE="/Users/foxyboy/Library/Caches/go-build"                                                                           
GOENV="/Users/foxyboy/Library/Application Support/go/env"                                                                  
GOEXE=""                                                                                                                   
GOEXPERIMENT=""                                                                                                            
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/foxyboy/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/foxyboy/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/homebrew/Cellar/go/1.19.3/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/homebrew/Cellar/go/1.19.3/libexec/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.19.3"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/opt/sw/privates/netter/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/sq/0x1_9fyn1bv907s7ypfryt1c0000gn/T/go-build2291873123=/tmp/go-build -gno-record-gcc-switches -fno-common"

Executing machine is MacBook Pro 2015 13” with Intel processor. No go installed

What did you do?

I wrote 3,000 lines of closed-source code wrapping the iffy golang.org/x/net/route.ParseRIB function to consume the mostly undocumented netlink socket output on macOS 13.0+ darwin xnu.

when cross-compiling GOOS=darwin GOARCH=amd64, the following syscall symbols are not defined:

  • AF_UTUN
  • RTF_PROXY
  • RTF_ROUTER

I came up with some silly constructs for this to work transparently

However, when the Wi-Fi interface is turned off on amd64, macOS emits data including RTF_ROUTER

What did you expect to see?

My code to work like on macOS arm64, ie. amd64 to have the symbols present

What did you see instead?

My checkit and checkit again code found undefined bits in rtm_flags: RTF_ROUTER

I think darwin amd64 should include the 3 symbols

RTF_UP: https://github.com/apple/darwin-xnu/blob/main/bsd/net/route.h#L284

rt_msghdr: https://github.com/apple/darwin-xnu/blob/main/bsd/net/route.h#L345

@seankhliao
Copy link
Member

Can you include a minimal reproducer?
And/or point out which places are missing the definitions?

@seankhliao
Copy link
Member

Note the symbols are available in golang.org/x/sys/unix (not syscall, which is deprecated for this purpose.

@seankhliao seankhliao added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Nov 20, 2022
@haraldrudell
Copy link
Author

Thank you, it works when using unix.AF_UTUN instead of syscall.AF_UTUN and so forth

@seankhliao
Copy link
Member

Closing as not a bug.

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Nov 21, 2022
@golang golang locked and limited conversation to collaborators Nov 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants