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

cmd/link: cgo test errors when building golang master on RHEL 7.2 and SLES 12 SP1 #13375

Closed
laboger opened this issue Nov 23, 2015 · 8 comments
Closed
Milestone

Comments

@laboger
Copy link
Contributor

laboger commented Nov 23, 2015

When building golang from master on a RHEL 7.2 or SLES12 SP1 distro, the cgo/test testcase fails with errors like this:

ok _/home/boger/golang/gitsrc/latest/go/misc/cgo/test 1.783s

testmain

/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/libgcc.a(_muldc3.o/): unknown relocation type 26; compiled without -fpic?
/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/libgcc.a(_absvsi2.o/): unknown relocation type 26; compiled without -fpic?
/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/libgcc.a(_absvsi2.o/): unknown relocation type 26; compiled without -fpic?
/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/libgcc.a(_mulsc3.o/): unknown relocation type 26; compiled without -fpic?
FAIL _/home/boger/golang/gitsrc/latest/go/misc/cgo/test [build failed]
2015/11/23 12:33:59 Failed: exit status 2

Note that I have to remove the test exec_linux_test.go on RHEL 7.2 due to errors reported in #13312, or it will fail before it gets to this point.

It appears that the failures are dependent on the gcc version that is used with the build. When it fails the gcc version is 4.8.x. I've tried some newer gcc versions and for some the errors don't occur. I am still experimenting with newer variations and will post that information to determine if some gcc versions other than 4.8.x also cause this failure

@ianlancetaylor
Copy link
Contributor

Reloc 26 is R_POWERPC_REL32. Looking at libgcc.a on a PPC64 machine, this appears as a reloc in the .eh_frame section.

Can you try https://golang.org/cl/17173?

@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Nov 23, 2015
@gopherbot
Copy link

CL https://golang.org/cl/17173 mentions this issue.

@mwhudson
Copy link
Contributor

@laboger
Copy link
Contributor Author

laboger commented Nov 23, 2015

Yes I will try the CL on both systems.

@laboger
Copy link
Contributor Author

laboger commented Nov 23, 2015

Yes, CL 17173 fixes the unknown relocation errors when building golang for both SLES12 SP1 and RHEL 7.2 on ppc64le. Thanks.

@mwhudson
Copy link
Contributor

On thinking about it, I think that build failure is really just "go 1.5 doesn't support external linking on ppc64", even if it does happen to be fixed by this change.

@laboger
Copy link
Contributor Author

laboger commented Nov 24, 2015

Don't understand Michael's comment. I was building from golang master, not the go 1.5 branch?

@mwhudson
Copy link
Contributor

Yes sorry, I was confused. Feel free to ignore me.

@golang golang locked and limited conversation to collaborators Nov 27, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants