]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.20] cmd/link: disable DWARF by default in c-shared mode on darwin
authorCherry Mui <cherryyz@google.com>
Tue, 12 Sep 2023 19:42:29 +0000 (15:42 -0400)
committerCherry Mui <cherryyz@google.com>
Thu, 21 Sep 2023 22:20:27 +0000 (22:20 +0000)
commit08c544db98da4292edfc5da7ceca17808fd41168
treec11ee3b0c2d4bcfe089c913f4ff577825f444050
parent071f03a8e59fc404a823e547fa566983c60f1f07
[release-branch.go1.20] cmd/link: disable DWARF by default in c-shared mode on darwin

[This is a (manual) backport of CL 527415 to Go 1.20.]

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 #62597.

Change-Id: I313349f71296d6d7025db28469593825ce9f1866
Reviewed-on: https://go-review.googlesource.com/c/go/+/527819
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
src/cmd/link/internal/ld/main.go