Skip to content

Commit

Permalink
[release-branch.go1.20] cmd/link: force old Apple linker in plugin mode
Browse files Browse the repository at this point in the history
There are some bugs in Apple's new linker that probably will not
be fixed when Xcode 15 is released (some time soon). We fix/work
around them but it is too much to backport them all. Force old
Apple linker to work around.

Updates #61229.
For #62597.

Change-Id: Ia5941918e882b22b4dbc41c74764d19d413d0b56
Reviewed-on: https://go-review.googlesource.com/c/go/+/527818
Run-TryBot: Cherry Mui <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Than McIntosh <[email protected]>
  • Loading branch information
cherrymui committed Sep 21, 2023
1 parent d5b8518 commit 071f03a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cmd/link/internal/ld/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -1367,6 +1367,10 @@ func (ctxt *Link) hostlink() {

switch ctxt.HeadType {
case objabi.Hdarwin:
if linkerFlagSupported(ctxt.Arch, argv[0], "", "-Wl,-ld_classic") {
// Force old linker to work around bugs in Apple's new linker.
argv = append(argv, "-Wl,-ld_classic")
}
if combineDwarf {
// Leave room for DWARF combining.
// -headerpad is incompatible with -fembed-bitcode.
Expand Down

0 comments on commit 071f03a

Please sign in to comment.