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/compile: wrapper methods are not PIC-safe on ppc64le #15886

Closed
mwhudson opened this issue May 30, 2016 · 2 comments
Closed

cmd/compile: wrapper methods are not PIC-safe on ppc64le #15886

mwhudson opened this issue May 30, 2016 · 2 comments
Milestone

Comments

@mwhudson
Copy link
Contributor

If you try to build a package into a shared library on ppc64le and that package defines a type that embeds a type from another package that's in another shared library, you get errors like:

/usr/lib/gcc-cross/powerpc64le-linux-gnu/5/../../../../powerpc64le-linux-gnu/bin/ld: /tmp/go-link-803871634/go.o: In function `local.github.com/godbus/dbus.(*unixTransport).CloseRead':
go.go:(.text+0x32690): call to `net.(*UnixConn).CloseRead' lacks nop, can't restore toc; recompile with -fPIC
/usr/lib/gcc-cross/powerpc64le-linux-gnu/5/../../../../powerpc64le-linux-gnu/bin/ld: go.go:(.text+0x32690): unresolvable R_PPC64_REL24 against `net.(*UnixConn).CloseRead'

This is because the tail call in the generated method is not PIC according to the platform rules. The fix is easy -- do not generate tail calls in dynlink code on ppc64le -- so I'm going to add this issue to the Go 1.7 milestone for a decision. (I can keep it Ubuntu-specific if the decision is not to accept it for 1.7).

@mwhudson mwhudson added this to the Go1.7 milestone May 30, 2016
@gopherbot
Copy link

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

@mwhudson
Copy link
Contributor Author

mwhudson commented Jun 7, 2016

Closed by the mentioned cl, I managed to lose the "fixes #xxxx" line from the commit though.

@mwhudson mwhudson closed this as completed Jun 7, 2016
@golang golang locked and limited conversation to collaborators Jun 7, 2017
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

2 participants