Skip to content

cmd/link: openshift build fails due to another problem with too far branches on ppc64le #20497

Closed
@laboger

Description

@laboger

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go 1.9

What operating system and processor architecture are you using (go env)?

Ubuntu 16.04

What did you do?

Built upstream openshift binaries, which builds using packages from Kubernetes.

What did you expect to see?

Binaries built that work.

What did you see instead?

Some binaries now fail due to a new linker limit being exceeded, which causes the GNU linker to generate plt stubs for long calls. The stub generated in this case by the GNU linker expects that R2 contains the address of the TOC (according to the PPC64LE v2 ABI) but code generated by golang in this case does not maintain that value in R2. As a result the generated address is bad and attempts to branch to a bad address.

I know trying to set up and maintain R2 in this case is not the best solution. I believe the solution as requested here #17917 is the right answer but I need to test it out more. (I had some concerns about this solution which is why I wasn't able to get it into go 1.9).

To reproduce this, clone the repo from here:
https://github.com/openshift/origin.git
cd origin; make all

Try to run one of the tests in:
_output/local/bin/linux/ppc64le with the -h option and the result is a SEGV.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions