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: relocation is too big for binaries built on ppc64le #16665

Closed
laboger opened this issue Aug 10, 2016 · 8 comments

Comments

Projects
None yet
5 participants
@laboger
Copy link
Contributor

commented Aug 10, 2016

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
    go version devel +392bf3a Tue Aug 9 00:43:25 2016 +0000 linux/ppc64le
    fails with go1.7 too
  2. What operating system and processor architecture are you using (go env)?
    ppc64le Ubuntu
  3. What did you do?
    If possible, provide a recipe for reproducing the error.
    A complete runnable program is good.
    A link on play.golang.org is best.
    Try to do the Kubernetes build.
    git clone https://github.com/kubernetes/kubernetes.git
    cd kubernetes
    make
  4. What did you expect to see?
    All binaries built successfully
  5. What did you see instead?
    Failures when linking the kube-abiserver binary:

k8s.io/kubernetes/vendor/k8s.io/client-go/1.4/pkg/apis/extensions.SupplementalGroupsStrategyType.CodecEncodeSelf: relocation for runtime.convT2E+220 is too big: -33556804
k8s.io/kubernetes/vendor/k8s.io/client-go/1.4/pkg/apis/extensions.(_PodSecurityPolicyList).CodecDecodeSelf: relocation for runtime.convI2E+592 is too big: -33557824
k8s.io/kubernetes/vendor/k8s.io/client-go/1.4/pkg/apis/extensions.(_NetworkPolicy).CodecDecodeSelf: relocation for runtime.convI2E+592 is too big: -33564288
k8s.io/kubernetes/vendor/k8s.io/client-go/1.4/pkg/apis/extensions.(_NetworkPolicySpec).CodecDecodeSelf: relocation for runtime.convI2E+592 is too big: -33569896
k8s.io/kubernetes/vendor/k8s.io/client-go/1.4/pkg/apis/extensions.(_NetworkPolicyIngressRule).CodecDecodeSelf: relocation for runtime.convI2E+592 is too big: -33574504
k8s.io/kubernetes/vendor/k8s.io/client-go/1.4/pkg/apis/extensions.(_NetworkPolicyPort).CodecDecodeSelf: relocation for runtime.convI2E+592 is too big: -33579240
k8s.io/kubernetes/vendor/k8s.io/client-go/1.4/pkg/apis/extensions.(_NetworkPolicyPort).codecDecodeSelfFromMap: relocation for runtime.newobject+712 is too big: -33567512
k8s.io/kubernetes/vendor/k8s.io/client-go/1.4/pkg/apis/extensions.(*NetworkPolicyPort).codecDecodeSelfFromMap: relocation for runtime.writebarrierptr+1080 is too big: -33564872
...... lots more

This is similar to but not exactly the same as #15823. In that issue, a different error message occurred and came from the GNU linker during external linking. In this case, the error occurs before the external linker would be invoked.

In both cases the errors occur because the address of the call target is too large for the bl instruction. I created a new issue for this one because the error messages are different, and there is a solution for #15823. However, it's possible there is a single solution that would be best for both.

Time to consider a solution which uses a different code sequence to do the call, such as one of those suggested by @minux.

@quentinmit quentinmit added this to the Go1.8 milestone Aug 26, 2016

@laboger

This comment has been minimized.

Copy link
Contributor Author

commented Oct 4, 2016

I should be able to add ppc64le trampolines to the fix for #17028 to solve this issue.

@luxas

This comment has been minimized.

Copy link

commented Oct 9, 2016

And all this will happen in time for go1.8?

@gopherbot

This comment has been minimized.

Copy link

commented Oct 11, 2016

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

@laboger

This comment has been minimized.

Copy link
Contributor Author

commented Oct 11, 2016

@luxas Yes, the common golang linker change to use trampolines for long calls is now upstream. This morning I submitted the change to add the ppc64x trampolines so the problem will be fixed on ppc64x as well.

@luxas

This comment has been minimized.

Copy link

commented Oct 11, 2016

@laboger Great! Folks are also talking about s390x; does s390x also need this patch?
I suppose so

@laboger

This comment has been minimized.

Copy link
Contributor Author

commented Oct 12, 2016

@mundaym Do you know the answer to @luxas question? I do not know if s390x has an issue with long calls or branches.

@mundaym

This comment has been minimized.

Copy link
Member

commented Oct 12, 2016

s390x uses 32-bit (33-bit really, due to the halfword alignment) relative addressing and I think the tool chain only currently supports offsets of 2GB across all architectures. So no, I don't think it needs this change.

@luxas

This comment has been minimized.

Copy link

commented Oct 12, 2016

@mundaym Yes, but it also happens on arm (which was the original issue), see: #17028
However, if you says so, it's okay.

Just trying to be prepared so I don't add s390x to k8s only to break it on an issue like this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.