Description
What version of Go are you using (go version
)?
$ go version go1.16rc1
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (go env
)?
go env
Output
$ go envGO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16rc1"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/shared/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-build704623638=/tmp/go-build -gno-record-gcc-switches"
What did you do?
- Download Go 1.16rc1 linux amd64 release on to a Ubuntu 14.04 Trusty system
- Attempt to link a Go program that uses Cgo.
What did you expect to see?
A correctly linked binary.
What did you see instead?
/usr/local/go/pkg/tool/linux_amd64/link -o $WORK/b001/exe/a.out -importcfg $WORK/b001/importcfg.link -buildmode=exe -buildid=dx0H7nktY5bJLfxiNI0p/uqwImzVISJS7i4MYRZEk/TLUSJTYITbUnYwoTsd1m/dx0H7nktY5bJLfxiNI0p -extld=gcc $WORK/b001/_pkg_.a
# github.com/evanj/linkexample/cgobasic
/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: /tmp/go-link-642826874/000006.o: unrecognized relocation (0x2a) in section `.text'
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
This program builds correctly with Go 1.15.7, or if I run all.bash
to build Go 1.16rc1 locally.
My guess at what is happening
I think this means Go 1.16rc1 was built on a version of Linux with binutils > 2.24, which seems to be what happened with a previous similar issue: #31293
It could be that this is expected: Ubuntu 14.04 Trusty is End of Life and no longer supported, and the workaround is to build your own version of the Go tools. However, if this is expected, a mention in the release notes would be nice, and maybe a mention in the minimum requirements wiki page? https://github.com/golang/go/wiki/MinimumRequirements