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
cmd/go: building cgo, "unknown relocation type 42; compiled without -fpic?" #13896
Comments
I believe this is a binutils bug, it was reported recently by a fedora user and has been escalated to binutils.
|
Thanks a lot, do you know if there is any workaround in the meantime? maybe another version of binutils? |
Which version are you building? If it's not the thing Dave's talking about, 1.5.2 and tip should build OK. |
I tried 1.5.2 and 1.5.3 and had the same issue in both so it seems to be that binutils bug, will wait for debian to get an update |
@ianlancetaylor, ring any bells? Also, are we missing builder coverage that we missed this? @KALRONG, what version of binutils do you have? |
This is a bug in the version of the GNU binutils used on some very up to date Debian systems. Relocation type 42 is being generated by the C assembler but is not being recognized by the C linker. There is nothing that Go can do to fix this. |
http://linux.debian.bugs.dist.narkive.com/koUKCmST/bug-807136-golang-ftbfs-due-to-new-binutils-relocations suggests this was fixed in Go 1.5.2 via git rev 914db9f? But @KALRONG reports otherwise? Anyway, I'm happy if @ianlancetaylor is happy. |
This has been fixed. I installed a new Debian scratch system in a VM and reproduced the failure with Go 1.5.1, then updated to Go 1.5.2 and it worked fine. @KALRONG, just use Go 1.5.2+ (1.5.3 is recommended). You must have had a confused path/environment to Go 1.5.n. |
Hi, Sorry for the delay on replying as I was on vacation and didn't get to check this. I have done and upgrade on my debian (strecth) and tried compiling again and this time no errors appeared and everything is working as it should with 1.5.3. I didn't change anything else, just updated the debian and then compile from sources. The only thing I saw is that one of the packages updated was the debian package for go, my guess is that this package in debian (being testing) still had this bug and while I tried to compile from source (needed to add more options than the ones in the debian package) this error showed. This seems to have been fixed on the debian side and now Im able to compile go from source without issues. Thanks everybody for looking in to this, and sorry for the trouble. |
hi,
While trying to build go from sources on Debian 8 Stretch I keep getting the following error and the build fails:
/usr/src/go/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic?
So far I couldn't find any workaround for this issue.
The text was updated successfully, but these errors were encountered: