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: go get golang.org/x/sys/unix (still) broken on arm64 #16065

Closed
Jagmn opened this issue Jun 14, 2016 · 10 comments
Closed

x/sys/unix: go get golang.org/x/sys/unix (still) broken on arm64 #16065

Jagmn opened this issue Jun 14, 2016 · 10 comments

Comments

@Jagmn
Copy link

Jagmn commented Jun 14, 2016

Thanks for the ppoll fix! Unfortunately:

  1. What version of Go are you using (go version)?
    go 1.6.1
  2. What operating system and processor architecture are you using (go env)?
    GOARCH="arm64"
    GOHOSTARCH="arm64"
    GOHOSTOS="linux"
    GOOS="linux"
    GO15VENDOREXPERIMENT="1"
    CC="gcc"
    CGO_ENABLED="1"
  3. What did you do?
    go get golang.org/x/sys/unix
  4. What did you expect to see?
    Successful completion
  5. What did you see instead?

# golang.org/x/sys/unix
src/golang.org/x/sys/unix/syscall_linux_arm64.go:185: cannot use new(*Timespec) (type **Timespec) as type *Timespec in assignment
src/golang.org/x/sys/unix/syscall_linux_arm64.go:186: cannot use timeout * 1e+06 (type int) as type int64 in argument to NsecToTimespec

I can get it to build with the following patch:

diff --git a/unix/syscall_linux_arm64.go b/unix/syscall_linux_arm64.go
index 4211cf6..4b6ff2a 100644
--- a/unix/syscall_linux_arm64.go
+++ b/unix/syscall_linux_arm64.go
@@ -182,8 +182,8 @@ const (
func Poll(fds []PollFd, timeout int) (n int, err error) {
var ts *Timespec
if timeout >= 0 {
- ts = new(*Timespec)
- *ts = NsecToTimespec(timeout * 1e6)
+ ts = new(Timespec)
+ *ts = NsecToTimespec(int64(timeout) * 1e6)
}
if len(fds) == 0 {
return ppoll(nil, 0, ts, nil)

Does the gopherbot not do compile tests for each GOARCH?

@ianlancetaylor
Copy link
Contributor

CC @kortschak

I actually do not know what tests are done on the subrepos.

@kortschak You can build yourself for a different architecture by simply typing

GOARCH=amd64 go build

When I do that on my amd64 system I do indeed see

./syscall_linux_arm64.go:185: cannot use new(*Timespec) (type **Timespec) as type *Timespec in assignment
./syscall_linux_arm64.go:186: cannot use timeout * 1e+06 (type int) as type int64 in argument to NsecToTimespec

@ianlancetaylor ianlancetaylor added this to the Unreleased milestone Jun 14, 2016
@ianlancetaylor ianlancetaylor changed the title go get golang.org/x/sys/unix (still) broken on arm64 x/sys/unix: go get golang.org/x/sys/unix (still) broken on arm64 Jun 14, 2016
@kortschak
Copy link
Contributor

@iant, Ugh. I am mortified, this is what you get for almost never using the new built-in.

Thanks for the tip. CL sent.

@kortschak
Copy link
Contributor

kortschak commented Jun 14, 2016

Unfortunately, that would not have picked up the error though - I'm building on 1.6.2 here, which does not recognise the arm64 GOARCH.

@gopherbot
Copy link

CL https://golang.org/cl/24120 mentions this issue.

@kortschak
Copy link
Contributor

Unfortunately, that would not have picked up the error though - I'm building on 1.6.2 here, which does not recognise the arm64 GOARCH.

No, just a typo. Sorry.

@gopherbot
Copy link

CL https://golang.org/cl/24121 mentions this issue.

@narJH27
Copy link

narJH27 commented Jan 23, 2017

@kortschak ,

I am running the go1.7.4 with the following env settings, and I still see the above issue:

GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
CC="gcc"
CGO_ENABLED="1"

Any idea if this fix has been included in the 1.7.4 build, because the current status of this issue is still Unreleased ?

@bradfitz
Copy link
Contributor

@narJH27, it's Unreleased because golang.org/x/sys/unix does not ship with Go releases. You need to update your copy of golang.org/x/sys/unix on disk.

@narJH27
Copy link

narJH27 commented Jan 23, 2017

@bradfitz I am unsure as to how to go about this update as I am new to Go. Can you please guide me on how to do so?

@bradfitz
Copy link
Contributor

For questions about Go, see https://golang.org/wiki/Questions.

But the short summary is "go get -u golang.org/x/sys/unix". If you have problems, see https://golang.org/wiki/Questions.

@golang golang locked and limited conversation to collaborators Jan 23, 2018
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

6 participants