go: x/sys: Commit bc7efcf introduced a compilation error

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

$ go version
go version go1.12.14 linux/arm 

Does this issue reproduce with the latest release?

Not sure

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

go env Output
$ go env

GOARCH=“arm” GOBIN=“” GOCACHE=“/home/simon/.cache/go-build” GOEXE=“” GOFLAGS=“” GOHOSTARCH=“arm” GOHOSTOS=“linux” GOOS=“linux” GOPATH=“/home/simon/code” GOPROXY=“” GORACE=“” GOROOT=“/usr/lib/go” GOTMPDIR=“” GOTOOLDIR=“/usr/lib/go/pkg/tool/linux_arm” GCCGO=“gccgo” GOARM=“6” CC=“gcc” CXX=“g++” CGO_ENABLED=“1” GOMOD=“” CGO_CFLAGS=“-g -O2” CGO_CPPFLAGS=“” CGO_CXXFLAGS=“-g -O2” CGO_FFLAGS=“-g -O2” CGO_LDFLAGS=“-g -O2” PKG_CONFIG=“pkg-config” GOGCCFLAGS=“-fPIC -marm -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build242404953=/tmp/go-build -gno-record-gcc-switches”

What did you do?

go build on any binary

What did you expect to see?

Compilation

What did you see instead?

golang.org/x/sys/unix

/home/simon/code/src/golang.org/x/sys/unix/zptrace_armnn_linux.go:45:57: cannot use uint64(unsafe.Sizeof(*regsout)) (type uint64) as type uint32 in field value /home/simon/code/src/golang.org/x/sys/unix/zptrace_armnn_linux.go:51:54: cannot use uint64(unsafe.Sizeof(*regs)) (type uint64) as type uint32 in field value

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 10
  • Comments: 18 (7 by maintainers)

Commits related to this issue

Most upvoted comments

I have sent out a fix (https://go-review.googlesource.com/c/sys/+/210322) but the page did not refresh.

A band-aid for beginners like me, pick an older version in the go.mod like this:

golang.org/x/sys v0.0.0-20191126131656-8a8471f7e56d // indirect

Also running into this error. Getting this lately:

env CC=arm-linux-gnueabi-gcc CGO_ENABLED=1 GOOS=linux GOARCH=arm GOARM=5 go build -trimpath -ldflags="-s -w -X main.commit=$COMMIT" github.com/probonopd/go-appimage/src/appimaged

# golang.org/x/sys/unix

../../../go/src/golang.org/x/sys/unix/zptrace_armnn_linux.go:45:57: cannot use uint64(unsafe.Sizeof(*regsout)) (type uint64) as type uint32 in field value

../../../go/src/golang.org/x/sys/unix/zptrace_armnn_linux.go:51:54: cannot use uint64(unsafe.Sizeof(*regs)) (type uint64) as type uint32 in field value

https://travis-ci.com/probonopd/go-appimage/jobs/264315306#L297-L300

It the bug related to this change? https://go-review.googlesource.com/c/sys/+/204418