Skip to content

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

@Jagmn

Description

@Jagmn

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions