-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
x/text: building as a plugin failure on darwin/arm64 #58826
Comments
CC @mpvl, @golang/runtime. |
This looks like some issue in the assembler. I can look into that. |
We are seeing the same issue on linux/arm64 (RHEL8, RHEL9, SLES15) when building a plugin with go 1.20.1
The build completes without errors on linux/amd64, and on arm64 with go 1.19.5 |
I think this is due to CL https://golang.org/cl/445535 . The CL description says
The question is what is Rt? It cannot use REGTMP. Maybe it can use Ry but currently it doesn't do so. Also, Ry only works for load, not store. cc @golang/arm @erifan |
Change https://go.dev/cl/474175 mentions this issue: |
@gopherbot please backport this to Go 1.20. This can cause code failing to build. Thanks. |
Backport issue(s) opened: #58920 (for 1.20). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
Change https://go.dev/cl/474235 mentions this issue: |
Change https://go.dev/cl/473999 mentions this issue: |
The culprit CL is reverted. I sent CL 473999 to re-enable the optimization but not in |
…ynlink mode On ARM64, in -dynlink mode (building a shared library or a plugin), accessing global variable is made using the GOT. Currently, the GOT accessing instruction sequence our assembler generates doesn't handle large offset well, so we don't fold the offset into loads and stores in the compiler. Currently, the rewrite rules are guarded with the -shared flag. However, the GOT access instructions are only generated in the -dynlink mode (which implies -shared, but not the other direction). CL 445535 attempted to remove the guard althgether. But that causes build failure for -dynlink mode for the reason above. This CL changes it to guard specifically on -dynlink mode, allowing the optimization in more cases (-shared but not -dynlink build modes). Updates #58826. Change-Id: I1391db6a33e8d0455a304e7cae7fcfdeb49bfdab Reviewed-on: https://go-review.googlesource.com/c/go/+/473999 Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
I confirmed |
I'm sorry to introduce this bug, and thanks @cherrymui for taking care of this. |
…or global symbols of shared library" This reverts CL 445535. Reason for revert: see issue #58826. It doesn't handle large offset well. Updates #58826. Fixes #58920. Change-Id: Ic4a33f4c510c88628ea7e16207a60977a04cf798 Reviewed-on: https://go-review.googlesource.com/c/go/+/474175 Reviewed-by: Heschi Kreinick <heschi@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@google.com> (cherry picked from commit a4cf4fd) Reviewed-on: https://go-review.googlesource.com/c/go/+/474235 Reviewed-by: Keith Randall <khr@golang.org>
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?
go build
fails with-buildmode=plugin
flag on darwin/arm64 if the code importsgolang.org/x/text
.The complete reproducing code is here.
What did you expect to see?
go build
succeeds without error.What did you see instead?
I have confirmed that it builds correctly on linux/amd64.
The text was updated successfully, but these errors were encountered: