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: go build fail on powerPC64 using gccgo #33057

Closed
wj36604 opened this issue Jul 11, 2019 · 5 comments
Closed

x/sys: go build fail on powerPC64 using gccgo #33057

wj36604 opened this issue Jul 11, 2019 · 5 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@wj36604
Copy link

wj36604 commented Jul 11, 2019

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

$ go version
go version go1.12.2 gccgo (GCC) 9.1.0 linux/ppc64

Does this issue reproduce with the latest release?

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

go env Output
$ go env
GOARCH="ppc64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="ppc64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/opt/golang"
GOPROXY=""
GORACE=""
GOROOT="/opt/gcc-9.1.0"
GOTMPDIR=""
GOTOOLDIR="/opt/gcc-9.1.0/libexec/gcc/powerpc64-unknown-linux-gnu/9.1.0"
GCCGO="/opt/gcc-9.1.0/bin/gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="0"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build451740613=/tmp/go-build -gno-record-gcc-switches -funwind-tables"

What did you do?

cat /proc/version
Linux version 4.1.35-g2019-05-20-637432e (houzp@dev) (gcc version 4.9.2 (GCC) ) #118 SMP Mon May 20 12:59:31 CST 2019

go build

What did you expect to see?

compile success

What did you see instead?

usb_client

/root/.cache/go-build/09/09c966f52bbded84a8ec71e8ff39f8486d6c851665f52cc7420a13ecb26bdaf5-d(go.o): In function unix.realSyscallNoError': /opt/golang/src/usb_client/vendor/golang.org/x/sys/unix/gccgo.go:22: undefined reference to gccgoRealSyscall'
/root/.cache/go-build/09/09c966f52bbded84a8ec71e8ff39f8486d6c851665f52cc7420a13ecb26bdaf5-d(go.o): In function usb_client..z2fvendor..z2fgolang.org..z2fx..z2fsys..z2funix.RawSyscallNoError': affinity_linux.go:(.text+0x6168): undefined reference to gccgoRealSyscall'
/root/.cache/go-build/09/09c966f52bbded84a8ec71e8ff39f8486d6c851665f52cc7420a13ecb26bdaf5-d(go.o): In function usb_client..z2fvendor..z2fgolang.org..z2fx..z2fsys..z2funix.Syscall': affinity_linux.go:(.text+0x6498): undefined reference to gccgoRealSyscall'
/root/.cache/go-build/09/09c966f52bbded84a8ec71e8ff39f8486d6c851665f52cc7420a13ecb26bdaf5-d(go.o): In function usb_client..z2fvendor..z2fgolang.org..z2fx..z2fsys..z2funix.Syscall6': affinity_linux.go:(.text+0x6704): undefined reference to gccgoRealSyscall'
/root/.cache/go-build/09/09c966f52bbded84a8ec71e8ff39f8486d6c851665f52cc7420a13ecb26bdaf5-d(go.o): In function usb_client..z2fvendor..z2fgolang.org..z2fx..z2fsys..z2funix.Syscall9': affinity_linux.go:(.text+0x68c8): undefined reference to gccgoRealSyscall'
/root/.cache/go-build/09/09c966f52bbded84a8ec71e8ff39f8486d6c851665f52cc7420a13ecb26bdaf5-d(go.o):affinity_linux.go:(.text+0x6958): more undefined references to `gccgoRealSyscall' follow
collect2: error: ld returned 1 exit status

@gopherbot gopherbot added this to the Unreleased milestone Jul 11, 2019
@ianlancetaylor
Copy link
Contributor

This looks like a problem with usb_client, not with x/sys. You are building a vendored version of golang.org/x/sys/unix. You didn't say which version is vendored. The first thing to try is updating to the current version of golang.org/x/sys/unix.

@ianlancetaylor ianlancetaylor added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jul 11, 2019
@ianlancetaylor ianlancetaylor changed the title x/sys:go build fail on powerPC64 x/sys: go build fail on powerPC64 using gccgo Jul 11, 2019
@wj36604
Copy link
Author

wj36604 commented Jul 15, 2019

I'm sorry for the late reply firstly. If go build on powerPC64 will use gccgo?
When the a package is not used in the program,go build success and the program is running normally.

@ianlancetaylor
Copy link
Contributor

If you use the go tool that is distributed with gccgo, then running go build will use gccgo.

If you use the go tool that is distributed with the gc toolchain, which is the version that you can fetch from https://golang.org, then running go build will not use gccgo.

In the comment above you are using the go tool that is distributed with gccgo. I can tell because the output of go version says "gccgo".

@wj36604
Copy link
Author

wj36604 commented Jul 17, 2019

Thanks for your reply.There is a problem with the "gccgo" compilation environment.
Compiling on another host is fine, will reinstall the build tool。

@ianlancetaylor
Copy link
Contributor

Thanks for following up.

@golang golang locked and limited conversation to collaborators Jul 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants