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

Go 1.16 beta1: openbsd/mips64 build fails #43442

Closed
marten-seemann opened this issue Dec 31, 2020 · 4 comments
Closed

Go 1.16 beta1: openbsd/mips64 build fails #43442

marten-seemann opened this issue Dec 31, 2020 · 4 comments

Comments

@marten-seemann
Copy link
Contributor

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

$ go version
go version go1.16beta1 darwin/amd64

What did you do?

I have a cross-compilation test which I run on CI. It builds a binary for all supported GOOS / GOARCH combinations (as reported by go tool dist list).

Using Go 1.15.x, GOOS=openbsd GOARCH=mips64 is unsupported:

cmd/go: unsupported GOOS/GOARCH pair openbsd/mips64

Go 1.16 apparently adds support, but building fails:

❯  GOOS=openbsd GOARCH=mips64 go build example/main.go
# golang.org/x/sys/cpu
../../../../pkg/mod/golang.org/x/sys@v0.0.0-20200519105757-fe76b779f299/cpu/cpu_linux_mips64x.go:17:25: undefined: hwCap

Not sure what exactly this means, nor do I particularly care about building for this architecture. However, if go tool dist list lists this as a support combination, I would have expected the build to succeed.

What did you expect to see?

go build should succeed.

What did you see instead?

go build failed, see above.

@mengzhuo
Copy link
Contributor

hwCap only been defined in Linux
https://github.com/golang/sys/blob/0d417f6369309be088e227ead8736fb722d759d3/cpu/hwcap_linux.go#L23

However it's weird that although the build tag strictly on linux but it still runs into it.

@mengzhuo
Copy link
Contributor

CC @4a6f656c

@ianlancetaylor
Copy link
Contributor

You need to update your golang.org/x/sys/cpu package past commit d785dc2 from August 20, 2020.

@marten-seemann
Copy link
Contributor Author

marten-seemann commented Jan 1, 2021

EDIT: It works! Thank you @ianlancetaylor.

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