-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/link: runtime.mach_vm_region_trampoline: unsupported dynamic relocation for symbol libc_mach_task_self_ (type=29 (R_GOTPCREL) stype=46 (SDYNIMPORT)) #67976
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
Similar Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
Change https://go.dev/cl/592499 mentions this issue: |
@gopherbot please backport this to Go 1.22. This can cause build failure for plugins on darwin/amd64 without workaround. Thanks. |
Backport issue(s) opened: #68122 (for 1.22). 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/595175 mentions this issue: |
…Darwin in plugin mode CL 501855 added support for cgo_dynamic_import variables on Darwin. But it didn't support the plugin build mode on amd64, where the assembler turns a direct load (R_PCREL) to a load via GOT (R_GOTPCREL). This CL adds the support. We just need to handle external linking mode, as this can only occur in plugin or shared build mode, which requires external linking. Fixes #68122. Updates #67976. Updates #50891. Change-Id: I0f56265d50bfcb36047fa5538ad7a5ec77e7ef96 Reviewed-on: https://go-review.googlesource.com/c/go/+/592499 Reviewed-by: David Chase <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> (cherry picked from commit 44f1870) Reviewed-on: https://go-review.googlesource.com/c/go/+/595175 Reviewed-by: Joedian Reid <[email protected]> Reviewed-by: Than McIntosh <[email protected]>
CL 501855 added support for cgo_dynamic_import variables on Darwin. But it didn't support the plugin build mode on amd64, where the assembler turns a direct load (R_PCREL) to a load via GOT (R_GOTPCREL). This CL adds the support. We just need to handle external linking mode, as this can only occur in plugin or shared build mode, which requires external linking. Fixes golang#67976. Updates golang#50891. Change-Id: I0f56265d50bfcb36047fa5538ad7a5ec77e7ef96 Reviewed-on: https://go-review.googlesource.com/c/go/+/592499 Reviewed-by: David Chase <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
Go version
go version go1.22.4 darwin/amd64
Output of
go env
in your module/workspace:What did you do?
I'm trying to compile a plugin.
The plugin code shares the model code from the main code, so I'm using the
import "myprog/model"
to get the common code.
If I leave this import out, the compilation works fine, but when I include it, I get the error shown in the title.
The same code compiles fine on darwin/arm64, linux/arm64, and linux/amd64.
go build -o plugin.so -buildmode=plugin plugin.go
MacBook Pro 2018 Sonoma 14.5
What did you see happen?
runtime.mach_vm_region_trampoline: unsupported dynamic relocation for symbol libc_mach_task_self_ (type=29 (R_GOTPCREL) stype=46 (SDYNIMPORT))
What did you expect to see?
compile ok
The text was updated successfully, but these errors were encountered: