go: cmd/link: fails on Ubuntu Xenial due to unsupported relocations on 386, amd64
I am on the devel
(xenial) channel now, but the error started popping up before the 15.10 release. Standard Linux AMD64 build. Building from master
with the most recent binary release (1.5.1) as GOROOT_BOOTSTRAP
.
git reset --hard origin/master
git clean -fxd
GOROOT_BOOTSTRAP=$HOME/tmp/go ./all.bash
...
many lines of successful build steps
...
# cmd/trace
/home/jaccarmac/local/golang/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic?
/home/jaccarmac/local/golang/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic?
/home/jaccarmac/local/golang/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic?
/home/jaccarmac/local/golang/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic?
/home/jaccarmac/local/golang/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic?
runtime/cgo(.text): unexpected relocation type 298
runtime/cgo(.text): unexpected relocation type 298
runtime/cgo(.text): unexpected relocation type 298
runtime/cgo(.text): unexpected relocation type 298
runtime/cgo(.text): unexpected relocation type 298
# cmd/pprof
/home/jaccarmac/local/golang/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic?
/home/jaccarmac/local/golang/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic?
/home/jaccarmac/local/golang/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic?
/home/jaccarmac/local/golang/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic?
/home/jaccarmac/local/golang/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic?
runtime/cgo(.text): unexpected relocation type 298
runtime/cgo(.text): unexpected relocation type 298
runtime/cgo(.text): unexpected relocation type 298
runtime/cgo(.text): unexpected relocation type 298
runtime/cgo(.text): unexpected relocation type 298
# cmd/go
/home/jaccarmac/local/golang/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic?
/home/jaccarmac/local/golang/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic?
/home/jaccarmac/local/golang/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic?
/home/jaccarmac/local/golang/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic?
/home/jaccarmac/local/golang/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic?
runtime/cgo(.text): unexpected relocation type 298
runtime/cgo(.text): unexpected relocation type 298
runtime/cgo(.text): unexpected relocation type 298
runtime/cgo(.text): unexpected relocation type 298
runtime/cgo(.text): unexpected relocation type 298
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 31 (19 by maintainers)
Commits related to this issue
- [release-branch.go1.5] cmd/link: support new 386/amd64 relocations The GNU binutils recently picked up support for new 386/amd64 relocations. Add support for them in the Go linker when doing an inte... — committed to golang/go by ianlancetaylor 9 years ago
- Merge remote-tracking branch 'upstream/master' into merge Merge the latest upstream Go master. The main reason for this merge is to get https://go-review.googlesource.com/#/c/16529/, which is require... — committed to riscvarchive/riscv-go by prattmic 8 years ago
- Backport fix for new binutils to make go14 compile under NetBSD-current. Patch from Ryo Onodera in PR pkg/50777. The upstream bug report is https://github.com/golang/go/issues/13114. Bump PKGREVISIO... — committed to jsonn/pkgsrc by deleted user 8 years ago
- go-1.4: Fix build against binutils 2.26 The go linker barfed on the new relocation types emitted by binutils 2.26. https://github.com/golang/go/issues/13114 http://hydra.nixos.org/build/32554876 — committed to NixOS/nixpkgs by edolstra 8 years ago
- go-1.4: Fix build against binutils 2.26 The go linker barfed on the new relocation types emitted by binutils 2.26. https://github.com/golang/go/issues/13114 http://hydra.nixos.org/build/32554876 (ch... — committed to NixOS/nixpkgs by edolstra 8 years ago
- golang-native: disable CGO_ENABLED when building go1.4 bootstrap To avoid this issue: https://github.com/golang/go/issues/13114 — committed to madisongh/meta-golang by madisongh 8 years ago
- community/go-bootstrap: fix build against binutils-2.26 Upstream: https://github.com/golang/go/issues/13114 — committed to alpinelinux/aports by ncopa 8 years ago
- Add libcap-dev and disbable cgo on go1.4 bootstrap. * libcap-dev is needed for acmetool. * for cgo see https://github.com/golang/go/issues/13114 — committed to jwkohnen/dkr-gopherbase by wjkohnen 8 years ago
- Bug 18333: Upgrade go to 1.6.2. It now requires an installation of go 1.4.x to bootstrap the build. We set CGO_ENABLED=0 when building the bootstrap go compiler because go 1.4.3 won't build with a n... — committed to arlolra/tor-browser-bundle by deleted user 8 years ago
- Upgrade go to 1.6.2. It now requires an installation of go 1.4.x to bootstrap the build. We set CGO_ENABLED=0 when building the bootstrap go compiler because go 1.4.3 won't build with a newer GNU to... — committed to arlolra/tor-browser-bundle by deleted user 8 years ago
@bsiegert and anybody else reading this issue: what @minux is saying is: arrange to build lang/go14 with CGO_ENABLED=0 set in the environment. Then you won’t run into this bug.
Yes, if we do have to make a 1.4.4 release, we should include this fix. But this by itself does not seem to me like a sufficient reason to make 1.4.4 release.
If we just need to keep Go 1.4 available as bootstrap compiler for newer versions, we can just support CGO_ENABLED=0 build of Go 1.4.