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

syscall: mksyscall.pl broken on Darwin/OS X #42241

Closed
xylo04 opened this issue Oct 28, 2020 · 5 comments
Closed

syscall: mksyscall.pl broken on Darwin/OS X #42241

xylo04 opened this issue Oct 28, 2020 · 5 comments

Comments

@xylo04
Copy link

xylo04 commented Oct 28, 2020

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

$ go version
go version go1.15.3 darwin/amd64

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/chris/Library/Caches/go-build"
GOENV="/Users/chris/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/chris/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/chris/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.15.3/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.15.3/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/chris/git/pat/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/zt/9q4fnj295_x8c94qllxhs34w0000gn/T/go-build329619136=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

la5nta/pat#222 - attempting to update our project's dependencies, but OS X has apparently deprecated the symbol unix.SYS_IOCTL that our serial I/O library uses. The serial library uses the mksyscall.pl to generate its system calls.

git clone --branch update-deps https://github.com/xylo04/pat.git && cd pat
go get -u
./make.bash

What did you expect to see?

Building Pat v0.10.0...
Enjoy!

What did you see instead?

# github.com/albenik/go-serial/v2
../../go/pkg/mod/github.com/albenik/go-serial/v2@v2.0.0/zsyscall_darwin.go:16:27: undefined: unix.SYS_IOCTL
@ianlancetaylor ianlancetaylor changed the title mksyscall.pl broken on Darwin/OS X syscall: mksyscall.pl broken on Darwin/OS X Oct 28, 2020
@ianlancetaylor
Copy link
Contributor

I don't think we ever really intended to support mksyscall.pl for use in anything other than building the syscall or golang.org/x/sys/unix packages themselves.

That said, are you passing the -darwin option?

@xylo04
Copy link
Author

xylo04 commented Oct 28, 2020

I'm not a maintainer of https://github.com/albenik/go-serial so I'm having a tough time deciphering. However, It looks like I can regenerate their file, and passing the -darwin flag to mksyscall.pl does generate different bindings without the SYS_IOCTL naughty word. Let me see if that fixes the compile issue further up the stack.

@xylo04
Copy link
Author

xylo04 commented Oct 28, 2020

Ok, this feels gross but it seems to be working. Does this PR look like what you'd expect to see?

@ianlancetaylor
Copy link
Contributor

Personally I would recommend not running the unsupported mksyscall.pl script, and instead calling the appropriate IoctlNNN function from golang.org/x/sys/unix.

@ianlancetaylor
Copy link
Contributor

Closing this issue because I don't think there is anything to do on the Go side. Please comment if you disagree.

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

3 participants