-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: issues with Apple's new linker in Xcode 15 beta [1.21 backport] #62598
Comments
Xcode 15 (to be released some time soon) will include Apple's new linker, enabled by default. Go 1.21 already includes some fixes/workarounds, so it mostly runs okay with new Apple linker. But it is not complete. There are a few more fixes/workarounds included in tip but not in Go 1.21. A major failure is plugin mode doesn't work. There are two options to fix plugin:
I prefer option 2, which is safer and simpler. It is very likely that the old Apple linker will be around for long enough time to cover the lifetime of Go 1.21. If it turns out not true, we can include other fixes/workarounds later. We also want to backport CL https://go.dev/cl/527415, to disable DWARF by default for c-shared mode (otherwise the new Apple linker doesn't accept the c-shared object). We also want to backport CL https://go.dev/cl/508696, which suppresses a warning. Specifically, CLs to be included in Go 1.21 branch:
|
Change https://go.dev/cl/527816 mentions this issue: |
Change https://go.dev/cl/527815 mentions this issue: |
Change https://go.dev/cl/527817 mentions this issue: |
There are some bugs in Apple's new linker that causes plugins to be built incorrectly. And the bugs probably will not be fixed when Xcode 15 is released (some time soon). Force old Apple linker to work around. Updates #61229. For #62598. Change-Id: I01ba5caadec6dc14f8c85dd02f78c1ed2e8b7d4d Reviewed-on: https://go-review.googlesource.com/c/go/+/527815 Run-TryBot: Cherry Mui <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Than McIntosh <[email protected]>
…d mode on darwin [This is a (manual) backport of CL 527415 to Go 1.21.] Currently, linking a Go c-shared object with C code using Apple's new linker, it fails with % cc a.c go.so ld: segment '__DWARF' filesize exceeds vmsize in 'go.so' Apple's new linker has more checks for unmapped segments. It is very hard to make it accept a Mach-O shared object with an additional DWARF segment. We may want to stop combinding DWARF into the shared object (see also #62577). For now, disable DWARF by default in c-shared mode on darwin. Updates #61229. For #62598. Change-Id: I525987b7fe1a4e64571327cb4696f98cc7b419a1 Reviewed-on: https://go-review.googlesource.com/c/go/+/527816 Reviewed-by: Than McIntosh <[email protected]> Run-TryBot: Cherry Mui <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
Closed by merging 9bec49c to release-branch.go1.21. |
Closed by merging fc57cc3 to release-branch.go1.21. |
Closed by merging 3ef4f93 to release-branch.go1.21. |
…warning for ld-prime ld-prime emits a deprecation warning for -bind_at_load. The flag is needed for plugins to not deadlock (#38824) when linking with older darwin linker. It is supposedly not needed with newer linker when chained fixups are used. For now, we always pass it, and suppress the warning. Updates #61229. For #62598. Change-Id: I4b8a6f864a460c40dc38adbb533f664f7fd5343c Reviewed-on: https://go-review.googlesource.com/c/go/+/508696 Reviewed-by: Than McIntosh <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Cherry Mui <[email protected]> (cherry picked from commit 040dbf9) Reviewed-on: https://go-review.googlesource.com/c/go/+/527817
There are some bugs in Apple's new linker that causes plugins to be built incorrectly. And the bugs probably will not be fixed when Xcode 15 is released (some time soon). Force old Apple linker to work around. Updates golang#61229. For golang#62598. Change-Id: I01ba5caadec6dc14f8c85dd02f78c1ed2e8b7d4d Reviewed-on: https://go-review.googlesource.com/c/go/+/527815 Run-TryBot: Cherry Mui <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Than McIntosh <[email protected]>
…d mode on darwin [This is a (manual) backport of CL 527415 to Go 1.21.] Currently, linking a Go c-shared object with C code using Apple's new linker, it fails with % cc a.c go.so ld: segment '__DWARF' filesize exceeds vmsize in 'go.so' Apple's new linker has more checks for unmapped segments. It is very hard to make it accept a Mach-O shared object with an additional DWARF segment. We may want to stop combinding DWARF into the shared object (see also golang#62577). For now, disable DWARF by default in c-shared mode on darwin. Updates golang#61229. For golang#62598. Change-Id: I525987b7fe1a4e64571327cb4696f98cc7b419a1 Reviewed-on: https://go-review.googlesource.com/c/go/+/527816 Reviewed-by: Than McIntosh <[email protected]> Run-TryBot: Cherry Mui <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
…warning for ld-prime ld-prime emits a deprecation warning for -bind_at_load. The flag is needed for plugins to not deadlock (golang#38824) when linking with older darwin linker. It is supposedly not needed with newer linker when chained fixups are used. For now, we always pass it, and suppress the warning. Updates golang#61229. For golang#62598. Change-Id: I4b8a6f864a460c40dc38adbb533f664f7fd5343c Reviewed-on: https://go-review.googlesource.com/c/go/+/508696 Reviewed-by: Than McIntosh <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Cherry Mui <[email protected]> (cherry picked from commit 040dbf9) Reviewed-on: https://go-review.googlesource.com/c/go/+/527817
There are some bugs in Apple's new linker that causes plugins to be built incorrectly. And the bugs probably will not be fixed when Xcode 15 is released (some time soon). Force old Apple linker to work around. Updates golang#61229. For golang#62598. Change-Id: I01ba5caadec6dc14f8c85dd02f78c1ed2e8b7d4d Reviewed-on: https://go-review.googlesource.com/c/go/+/527815 Run-TryBot: Cherry Mui <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Than McIntosh <[email protected]>
There are some bugs in Apple's new linker that causes plugins to be built incorrectly. And the bugs probably will not be fixed when Xcode 15 is released (some time soon). Force old Apple linker to work around. Updates golang#61229. For golang#62598. Change-Id: I01ba5caadec6dc14f8c85dd02f78c1ed2e8b7d4d Reviewed-on: https://go-review.googlesource.com/c/go/+/527815 Run-TryBot: Cherry Mui <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Than McIntosh <[email protected]>
@cherrymui requested issue #61229 to be considered for backport to the next 1.21 minor release.
The text was updated successfully, but these errors were encountered: