-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/link: relocation truncated to fit: R_ARM_CALL against `runtime.duffcopy' #58425
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
Comments
Copying from kubernetes/kubernetes#115605 (comment) Reproducer with a Dockerfile, on kubernetes/kubernetes@b7ad179: FROM debian:latest
RUN apt-get update && \
apt-get install -y \
gcc-arm-linux-gnueabihf \
wget
RUN wget https://go.dev/dl/go1.20.linux-amd64.tar.gz && \
tar xf *.tar.gz && \
mv go /usr/local
ENV PATH=$PATH:/usr/local/go/bin
ENV GOARCH=arm
ENV CGO_ENABLED=1
ENV CC=arm-linux-gnueabihf-gcc
COPY . /work
WORKDIR /work
RUN go test -o e2e_node.test k8s.io/kubernetes/test/e2e_node
|
We're also having this issue when cross-compiling the Grafana Agent on ARMv6/ARMv7. I've posted some details on #58428 |
@golang/compiler |
I'll take a look. |
I bisected to 833367e:
Notes:
Reproducer: # checkout of https://github.com/golang/go
pushd go
git checkout 833367e98af838a2511ee7e4e19dc8f1da7b8ed7
git cherry-pick 00bee6d9a4c3ed6168350fc6551043ff7a1895f2
pushd src
./make.bash
popd
popd
export GOROOT=$PWD/go
export GOPATH=$PWD/emptydir
export PATH=$PWD/go/bin:$PATH
# checkout of https://github.com/kubernetes/kubernetes/
pushd kubernetes
git checkout b7ad17978eaba508c560f81bab2fb9d0b256e469
GOARCH=arm CGO_ENABLED=1 CC=arm-linux-gnueabihf-gcc go test -c k8s.io/kubernetes/test/e2e_node
popd Output is:
That commit defaulted |
Building go1.19.5 with |
cc @mdempsky |
until this issue is fixed, I was able to build with |
@liggitt thanks for the bisect. In this case my guess would be that the bug is not actually due to the introduction of unified IR, but rather that the switch to unified IR makes the binary in question a bit bigger, which triggers the need for trampoline insertion. I am testing a CL with a fix, I'll post it shortly. |
Change https://go.dev/cl/467715 mentions this issue: |
@liggitt if you are able to test with my CL to see if the tests run cleanly on ARM that would be great. I verified that with the CL I can link the |
I don't actually have an arm test machine, all I could do was reproduce / verify the cross-compile/link worked. I'll see if I can track down an env to run the resulting binary. I'd be curious if the CL also resolves #58428 ... the reporters of that issue might have an env to exercise their resulting binary as well |
OK thanks. Yes, I verified that the fix also takes care of #58428. I am planning on duping that bug against this one. I'll on that issue about testing. |
This reverts commit 8a7ed5c.
👋 We've tested your CL against the resulting binary for #58428 and verified that everything still works. Thank you! |
Thanks for the quick turnaround. Could this be backported to 1.20, since it resolves a compiler issue that doesn't have a workaround (#58428)? |
I will indeed look into backports. |
We just updated to go1.20.3, and our 32-bit ARM builds seem to be working again 🎉 Thanks @thanm! |
@thanm Unfortunately I spoke too soon. grafana/agent#3485 just ran into the issue again after removing some code, with two different errors for two different commands (both ARMv6):
This can be validated by checking out |
Thanks for the update. This bug seems to be the "gift that keeps giving", apparently. I will take another look. |
Hey @thanm, doing a sweep of the Go 1.21 milestone. Any updates here? Should this go to Backlog? Thanks. |
Should still be in 1.21 I think (just got a bit lost in the sauce). I will take another look. |
This strangely started showing up in Grafana. We bisected to a seemingly benign commit, though it is consistently failing in a function in a specific dependency. Based on what I'm seeing in this thread, the dependency is unrelated. We are seeing this on
|
This failure is very sensitive to binary size and and code layout. A seemingly unrelated change may change the code layout just slightly to go over or under the limit. |
Change https://go.dev/cl/531795 mentions this issue: |
Change https://go.dev/cl/532096 mentions this issue: |
Change https://go.dev/cl/532097 mentions this issue: |
This CL is a roll-forward (tweaked slightly) of CL 467715, which turned on text section splitting for GOARCH=arm. The intent is to avoid recurrent problems with external linking where there is a disagreement between the Go linker and the external linker over whether a given branch will reach. In the past our approach has been to tweak the reachability calculations slightly to try to work around potential linker problems, but this hasn't proven to be very robust; section splitting seems to offer a better long term fix. Updates #58425. Fixes #63317. Change-Id: I7372d41abce84097906a3d0805b6b9c486f345d6 Reviewed-on: https://go-review.googlesource.com/c/go/+/531795 Reviewed-by: Cherry Mui <[email protected]> Run-TryBot: Than McIntosh <[email protected]> TryBot-Result: Gopher Robot <[email protected]> (cherry picked from commit 1e69040) Reviewed-on: https://go-review.googlesource.com/c/go/+/532096 Auto-Submit: Dmitri Shuralyov <[email protected]>
This CL is a roll-forward (tweaked slightly) of CL 467715, which turned on text section splitting for GOARCH=arm. The intent is to avoid recurrent problems with external linking where there is a disagreement between the Go linker and the external linker over whether a given branch will reach. In the past our approach has been to tweak the reachability calculations slightly to try to work around potential linker problems, but this hasn't proven to be very robust; section splitting seems to offer a better long term fix. Updates #58425. Fixes #63316. Change-Id: I7372d41abce84097906a3d0805b6b9c486f345d6 Reviewed-on: https://go-review.googlesource.com/c/go/+/531795 Reviewed-by: Cherry Mui <[email protected]> Run-TryBot: Than McIntosh <[email protected]> TryBot-Result: Gopher Robot <[email protected]> (cherry picked from commit 1e69040) Reviewed-on: https://go-review.googlesource.com/c/go/+/532097 Auto-Submit: Dmitri Shuralyov <[email protected]>
…hange drone to fix ARM rpm build and Update Swagger) (#81396) - Feature Toggle is `promQLScope`. - Query property is: "scope": { "matchers": "{job=~\".*\"}" } Misc: - Also updates drone GO version to address ARM bug golang/go#58425 - Also updates Swagger defs that were causing builds to fail --------- Co-authored-by: Kevin Minehart <[email protected]>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, by cross compiling kubernetes/kubernetes@b7ad179 to the
linux/arm
platform.What operating system and processor architecture are you using (
go env
)?We build in a custom container image registry.k8s.io/build-image/kube-cross
go env
OutputWhat did you do?
Running
make release
in the root of the Kubernetes repository. Everything gets built successfully, except thek8s.io/kubernetes/test/e2e_node.test
, which fails with:A small patch can be applied to make it fail faster for reproduction:
Setting
CGO_CFLAGS=-mlong-calls
does not help, disabling CGO does provide a workaround.Source code changes seem to have impact on the issue, because the build works with the next commit kubernetes/kubernetes@b0171f7
Ref: kubernetes/kubernetes#115613, kubernetes/kubernetes#115605
What did you expect to see?
That the test binary compiles correctly with CGO enabled.
What did you see instead?
The link failure.
The text was updated successfully, but these errors were encountered: