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

gccgo: Can't use golang.org/x/sys/unix #42683

Closed
WinLinux1028 opened this issue Nov 17, 2020 · 5 comments
Closed

gccgo: Can't use golang.org/x/sys/unix #42683

WinLinux1028 opened this issue Nov 17, 2020 · 5 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@WinLinux1028
Copy link

WinLinux1028 commented Nov 17, 2020

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

$ go version
go version go1.15.5 linux/amd64

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/yjsnpi/.cache/go-build"
GOENV="/home/yjsnpi/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/yjsnpi/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/yjsnpi/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="/usr/bin/gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/yjsnpi/go/src/golang.org/x/sys/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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build182228207=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I tryed to compile Discord bot in gccgo. (It can build on gc)
But gccgo errors.

What did you see instead?

/home/yjsnpi/go/src/golang.org/x/sys/unix/gccgo.go:21: error: undefined reference to 'golang.x2eorg..z2fx..z2fsys..z2funix.realSyscallNoError'
/home/yjsnpi/go/src/golang.org/x/sys/unix/gccgo.go:28: error: undefined reference to 'golang.x2eorg..z2fx..z2fsys..z2funix.realSyscall'
/home/yjsnpi/go/src/golang.org/x/sys/unix/gccgo.go:35: error: undefined reference to 'golang.x2eorg..z2fx..z2fsys..z2funix.realSyscall'
/home/yjsnpi/go/src/golang.org/x/sys/unix/gccgo.go:42: error: undefined reference to 'golang.x2eorg..z2fx..z2fsys..z2funix.realSyscall'
/home/yjsnpi/go/src/golang.org/x/sys/unix/gccgo.go:48: error: undefined reference to 'golang.x2eorg..z2fx..z2fsys..z2funix.realSyscallNoError'
/home/yjsnpi/go/src/golang.org/x/sys/unix/gccgo.go:53: error: undefined reference to 'golang.x2eorg..z2fx..z2fsys..z2funix.realSyscall'
collect2: error: ld returned 1 exit status

@gopherbot gopherbot added this to the Gccgo milestone Nov 17, 2020
@ianlancetaylor
Copy link
Contributor

What version of gccgo are you using?

Have you tried building using the version of the go tool that comes with gccgo, rather than the version of the go tool distributed with the gc toolchain?

@WinLinux1028
Copy link
Author

@ianlancetaylor
Copy link
Contributor

To use tip gccgo you'll need to use the version of the go tool that comes with gccgo, not the version from the Go 1.15.5 release. (The tip gc release should work also.)

@WinLinux1028
Copy link
Author

Thank you, I'll try it.

@ianlancetaylor ianlancetaylor added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Nov 18, 2020
@WinLinux1028
Copy link
Author

The probrem was fixed.
Thank you to answer the question!

@golang golang locked and limited conversation to collaborators Nov 18, 2021
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