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: unexpected trampoline when cross-compiling to ppc64le #45564
Comments
It is on my plan to rework trampoline insertion in the linker, that should address this. Hopefully I can get it in for 1.17. |
Thanks for the quick feedback! I'm curious if there might be also a possibility for an interim patch to 1.16 in the meantime. One thing that does seem to get the linker past the issue is adjusting this condition to check for |
@dbenoit17 thanks for the comment. I'll take a careful look. |
Recent versions of Go have had issues statically linking some ppc64le binaries: golang/go#45564
@dbenoit17 sorry for the delay. As you said, I don't think we use internal linking for any of those configurations. I.e. IsExternal should always be true at that point. Could you share how the "go" command or the linker is invoked in your build process, and what build mode are you building for? Thanks. |
This seems to be caused by the combination of: Given that plugins are effectively disabled in the above case, shouldn't |
Change https://golang.org/cl/314449 mentions this issue: |
To hit the issue,
I think this is using using buildmode=default since there is no buildmode specified. As a follow-up, I've had a chance to test https://golang.org/cl/314449 and can confirm it resolves the issue. |
It was originally thought that the messages about dynamic linking were due to a buildmode setting, but that turned out not to be the case. Code that uses plugins is usually compiled as PIC (i.e., like shared or dynamic linking) but if CGO_ENABLED=0 then plugins are disabled and then not compiled as PIC so that led to confusion in the linker and the errors. |
@gopherbot please consider a backport to 1.16. This seems to a be a regression from go 1.16.1 to 1.16.2. I don't think a backport to earlier versions is necessary since the issue likely affects all 1.15 releases. It might be possible to workaround by not disabling cgo, or using external linking. |
Backport issue(s) opened: Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
Recent versions of Go have had issues statically linking some ppc64le binaries: golang/go#45564
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Cross compile OpenShift's
oc
command from x86_64 to ppc64le.What did you expect to see?
Program builds.
What did you see instead?
Linker error at
go/src/cmd/link/internal/ppc64/asm.go
Line 708 in f12cf76
Additional Notes
oc
functions in Go 1.15 vs. Go 1.16.The text was updated successfully, but these errors were encountered: