Skip to content

x/sys: Commit bc7efcf introduced a compilation error #36032

Closed

Description

@brotherlogic

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

Activity

  1. added this to the Unreleased milestone on Dec 7, 2019
  2. stgraber commented on Dec 7, 2019

    @stgraber

    I was literally writing the exact same report.

    root@go-armhf:~# go get golang.org/x/sys/unix
    # 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
    root@go-armhf:~# go version
    go version go1.13.5 linux/arm
    
  3. stgraber commented on Dec 7, 2019

    @stgraber

    bc7efcf is the commit modifying zptrace_armnn_linux.go and introducing the issue.

  4. stgraber commented on Dec 7, 2019

    @stgraber
  5. added
    NeedsFixThe path to resolution is known, but the work has not been done.
    on Dec 7, 2019
  6. ianlancetaylor commented on Dec 7, 2019

    @ianlancetaylor
    Contributor

    I can't think of any approach we can use here other than generating yet another zptrace file.

  7. happyEgg commented on Dec 7, 2019

    @happyEgg

    I had the same problem, when i execute gomobile build -target=android
    go version go1.13.5 darwin/amd64
    gomobile is latest
    gomobile log:
    commit 5c0e7e404af8b014d8b7de89f9522bc92463f3cb (HEAD -> master, origin/master, origin/HEAD)
    Author: Hajime Hoshi hajimehoshi@gmail.com
    Date: Wed Nov 27 22:57:30 2019 +0900

  8. probonopd commented on Dec 7, 2019

    @probonopd

    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

  9. changed the title [-]x/sys: Commit eeba5f6 introduced a compilation error[/-] [+]x/sys: Commit bc7efcf introduced a compilation error[/+] on Dec 7, 2019
  10. MarcelEeken commented on Dec 7, 2019

    @MarcelEeken

    Also just ran into this issue

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

    $ go version
    go version go1.13.5 darwin/amd64
    

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

    go env Output
    $ go env
    GO111MODULE=""
    GOARCH="amd64"
    GOBIN=""
    GOCACHE="/Users/marcel/Library/Caches/go-build"
    GOENV="/Users/marcel/Library/Application Support/go/env"
    GOEXE=""
    GOFLAGS=""
    GOHOSTARCH="amd64"
    GOHOSTOS="darwin"
    GONOPROXY=""
    GONOSUMDB=""
    GOOS="darwin"
    GOPATH="/Users/marcel/go"
    GOPRIVATE=""
    GOPROXY="https://proxy.golang.org,direct"
    GOROOT="/usr/local/go"
    GOSUMDB="sum.golang.org"
    GOTMPDIR=""
    GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
    GCCGO="gccgo"
    AR="ar"
    CC="clang"
    CXX="clang++"
    CGO_ENABLED="1"
    GOMOD="/Users/marcel/prive/enmon/go.mod"
    CGO_CFLAGS="-g -O2"
    CGO_CPPFLAGS=""
    CGO_CXXFLAGS="-g -O2"
    CGO_FFLAGS="-g -O2"
    CGO_LDFLAGS="-g -O2"
    PKG_CONFIG="pkg-config"
    GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/0s/tlwngfxs4l76lnlk8j3z0s2h0000gn/T/go-build442831853=/tmp/go-build -gno-record-gcc-switches -fno-common"
    

    What did you do?

    Trying to cross compile for ARM target

    $ GOOS=linux GOARCH=arm GOARM=6 go build -o build/enmon_arm
    # golang.org/x/sys/unix
    ../../go/pkg/mod/golang.org/x/sys@v0.0.0-20191206220618-eeba5f6aabab/unix/zptrace_armnn_linux.go:45:57: cannot use uint64(unsafe.Sizeof(*regsout)) (type uint64) as type uint32 in field value
    ../../go/pkg/mod/golang.org/x/sys@v0.0.0-20191206220618-eeba5f6aabab/unix/zptrace_armnn_linux.go:51:54: cannot use uint64(unsafe.Sizeof(*regs)) (type uint64) as type uint32 in field value
    
  11. ianlancetaylor commented on Dec 7, 2019

    @ianlancetaylor
    Contributor

    No need to keep reporting the problem. https://golang.org/wiki/NoPlusOne. Thanks.

    We know there is a problem and we will either roll back the change or add a fix.

  12. self-assigned this
    on Dec 9, 2019
  13. erifan commented on Dec 9, 2019

    @erifan

    Sorry for the trouble. I'll fix it as soon as possible.

  14. bus710 commented on Dec 9, 2019

    @bus710

    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
    
  15. erifan commented on Dec 9, 2019

    @erifan

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

  16. zikaeroh commented on Dec 9, 2019

    @zikaeroh
    Contributor

    You have to write Fixes golang/go#36032, not Fixes #36032 to get gopherbot to recognize the issue when working from a repo other than the main Go repo.

  17. gopherbot commented on Dec 9, 2019

    @gopherbot
    Contributor

    Change https://golang.org/cl/210322 mentions this issue: unix: move functions Ptrace{Get|Set}RegSetArm64 to a separate file

  18. erifan commented on Dec 9, 2019

    @erifan

    @zikaeroh Thanks.

  19. fangzhang-dev commented on Dec 9, 2019

    @fangzhang-dev

    @ianlancetaylor What about redefining Iovec{} struct as IovecArm64{] struct in unix/zptrace_armnn_linux.go file?

  20. sigkill commented on Dec 9, 2019

    @sigkill

    Also breaking P4wnP1_aloa too...

  21. probonopd commented on Dec 9, 2019

    @probonopd

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

    What if one doesn't use modules?

  22. bus710 commented on Dec 9, 2019

    @bus710

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

    What if one doesn't use modules?

    Not sure how many of package managers out there but for Go Dep at least:

  23. added a commit that references this issue on Sep 17, 2020
  24. added a commit that references this issue on Sep 17, 2020
  25. locked and limited conversation to collaborators on Dec 9, 2020
  26. added a commit that references this issue on Jun 7, 2024
    ac6580d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions