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

cmd/go: 1.9.4 can't build x/sys/unix with GOOS=solaris #23939

Closed
ncw opened this issue Feb 20, 2018 · 7 comments
Closed

cmd/go: 1.9.4 can't build x/sys/unix with GOOS=solaris #23939

ncw opened this issue Feb 20, 2018 · 7 comments
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge release-blocker
Milestone

Comments

@ncw
Copy link
Contributor

ncw commented Feb 20, 2018

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

go version go1.9.4 linux/amd64

Does this issue reproduce with the latest release?

No, go1.10 is fine.

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

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/ncw/go"
GORACE=""
GOROOT="/opt/go/go1.9"
GOTOOLDIR="/opt/go/go1.9/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build113110457=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

What did you do?

$ go version
go version go1.9.4 linux/amd64
$ rm -rf /tmp/goroot ; mkdir /tmp/goroot ; export GOPATH=/tmp/goroot
$ go get golang.org/x/sys/unix
$ GOOS=solaris GOARCH=amd64 go install golang.org/x/sys/unix
# golang.org/x/sys/unix
goroot/src/golang.org/x/sys/unix/zsyscall_solaris_amd64.go:13:3: //go:cgo_import_dynamic libc_pipe pipe "libc.so" only allowed in cgo-generated code
goroot/src/golang.org/x/sys/unix/zsyscall_solaris_amd64.go:14:3: //go:cgo_import_dynamic libc_getsockname getsockname "libsocket.so" only allowed in cgo-generated code
goroot/src/golang.org/x/sys/unix/zsyscall_solaris_amd64.go:15:3: //go:cgo_import_dynamic libc_getcwd getcwd "libc.so" only allowed in cgo-generated code
goroot/src/golang.org/x/sys/unix/zsyscall_solaris_amd64.go:16:3: //go:cgo_import_dynamic libc_getgroups getgroups "libc.so" only allowed in cgo-generated code
goroot/src/golang.org/x/sys/unix/zsyscall_solaris_amd64.go:17:3: //go:cgo_import_dynamic libc_setgroups setgroups "libc.so" only allowed in cgo-generated code
goroot/src/golang.org/x/sys/unix/zsyscall_solaris_amd64.go:18:3: //go:cgo_import_dynamic libc_wait4 wait4 "libc.so" only allowed in cgo-generated code
goroot/src/golang.org/x/sys/unix/zsyscall_solaris_amd64.go:19:3: //go:cgo_import_dynamic libc_gethostname gethostname "libc.so" only allowed in cgo-generated code
goroot/src/golang.org/x/sys/unix/zsyscall_solaris_amd64.go:20:3: //go:cgo_import_dynamic libc_utimes utimes "libc.so" only allowed in cgo-generated code
goroot/src/golang.org/x/sys/unix/zsyscall_solaris_amd64.go:21:3: //go:cgo_import_dynamic libc_utimensat utimensat "libc.so" only allowed in cgo-generated code
goroot/src/golang.org/x/sys/unix/zsyscall_solaris_amd64.go:22:3: //go:cgo_import_dynamic libc_fcntl fcntl "libc.so" only allowed in cgo-generated code
goroot/src/golang.org/x/sys/unix/zsyscall_solaris_amd64.go:22:3: too many errors

Note that with go1.10 it works correctly.

$ go version
go version go1.10 linux/amd64
$ rm -rf /tmp/goroot ; mkdir /tmp/goroot ; export GOPATH=/tmp/goroot
$ go get golang.org/x/sys/unix
$ GOOS=solaris GOARCH=amd64 go install golang.org/x/sys/unix

I suspect this might need d1fbe07 from the 1.10 branch.

@gopherbot gopherbot added this to the Unreleased milestone Feb 20, 2018
@ianlancetaylor ianlancetaylor modified the milestones: Unreleased, Go1.9.5 Feb 20, 2018
@ianlancetaylor ianlancetaylor changed the title x/sys/unix: doesn't build with GOOS=solaris and go1.9.4 cmd/go: 1.9.4 can't build x/sys/unix with GOOS=solaris Feb 20, 2018
@ianlancetaylor
Copy link
Contributor

Fix is already on tip in CL 93836 and CL 94896.

@andybons
Copy link
Member

andybons commented Mar 27, 2018

CL 103135 OK for Go 1.9.5
CL 103155 OK for Go 1.9.5

@andybons andybons added the CherryPickApproved Used during the release process for point releases label Mar 27, 2018
@ncw
Copy link
Contributor Author

ncw commented Apr 6, 2018

This doesn't appear to be fixed in go1.9.5 :-(

@andybons Can we re-open?

$ go version
go version go1.9.5 linux/amd64
$ rm -rf /tmp/goroot ; mkdir /tmp/goroot ; export GOPATH=/tmp/goroot
$ go get golang.org/x/sys/unix
$ GOOS=solaris GOARCH=amd64 go install golang.org/x/sys/unix
# golang.org/x/sys/unix
goroot/src/golang.org/x/sys/unix/zsyscall_solaris_amd64.go:13:3: //go:cgo_import_dynamic libc_pipe pipe "libc.so" only allowed in cgo-generated code
goroot/src/golang.org/x/sys/unix/zsyscall_solaris_amd64.go:14:3: //go:cgo_import_dynamic libc_getsockname getsockname "libsocket.so" only allowed in cgo-generated code
goroot/src/golang.org/x/sys/unix/zsyscall_solaris_amd64.go:15:3: //go:cgo_import_dynamic libc_getcwd getcwd "libc.so" only allowed in cgo-generated code
goroot/src/golang.org/x/sys/unix/zsyscall_solaris_amd64.go:16:3: //go:cgo_import_dynamic libc_getgroups getgroups "libc.so" only allowed in cgo-generated code
goroot/src/golang.org/x/sys/unix/zsyscall_solaris_amd64.go:17:3: //go:cgo_import_dynamic libc_setgroups setgroups "libc.so" only allowed in cgo-generated code
goroot/src/golang.org/x/sys/unix/zsyscall_solaris_amd64.go:18:3: //go:cgo_import_dynamic libc_wait4 wait4 "libc.so" only allowed in cgo-generated code
goroot/src/golang.org/x/sys/unix/zsyscall_solaris_amd64.go:19:3: //go:cgo_import_dynamic libc_gethostname gethostname "libc.so" only allowed in cgo-generated code
goroot/src/golang.org/x/sys/unix/zsyscall_solaris_amd64.go:20:3: //go:cgo_import_dynamic libc_utimes utimes "libc.so" only allowed in cgo-generated code
goroot/src/golang.org/x/sys/unix/zsyscall_solaris_amd64.go:21:3: //go:cgo_import_dynamic libc_utimensat utimensat "libc.so" only allowed in cgo-generated code
goroot/src/golang.org/x/sys/unix/zsyscall_solaris_amd64.go:22:3: //go:cgo_import_dynamic libc_fcntl fcntl "libc.so" only allowed in cgo-generated code
goroot/src/golang.org/x/sys/unix/zsyscall_solaris_amd64.go:22:3: too many errors

@ianlancetaylor
Copy link
Contributor

We would need to also backport CL 94018. Sorry for forgetting about that one.

@ianlancetaylor
Copy link
Contributor

I don't know whether we are doing a 1.9.6 release or not. @andybons

@andybons
Copy link
Member

I have no issue with doing a 1.9.6 release

@andybons andybons modified the milestones: Go1.9.5, Go1.9.6 Apr 11, 2018
@gopherbot
Copy link

Change https://golang.org/cl/110077 mentions this issue: [release-branch.go1.9] cmd/compile: permit go:cgo_import_dynamic anywhere

gopherbot pushed a commit that referenced this issue Apr 30, 2018
…here

It's used on Solaris to import symbols from shared libraries, e.g., in
golang.org/x/sys/unix and golang.org/x/net/internal/socket.
We could use a different directive but that would require build tags
in all the places that use it.

Fixes #23939

Change-Id: I47fcf72a6d2862e304204705979c2056c2f78ec5
Reviewed-on: https://go-review.googlesource.com/94018
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 41d3d15)
Reviewed-on: https://go-review.googlesource.com/110077
Reviewed-by: Ian Lance Taylor <iant@golang.org>
@golang golang locked and limited conversation to collaborators Apr 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge release-blocker
Projects
None yet
Development

No branches or pull requests

4 participants