Skip to content

Commit e602625

Browse files
ianlancetaylorgopherbot
authored andcommitted
cmd/go: pass -Wl,-z,nodelete for c-shared mode with gccgo
This is the gccgo version of CL 15605. For https://gcc.gnu.org/PR114699 For #11100 For #12582 For #12873 Change-Id: I30e23130737022d772971f0bd629b57269174886 Reviewed-on: https://go-review.googlesource.com/c/go/+/582975 Reviewed-by: Than McIntosh <[email protected]> Commit-Queue: Ian Lance Taylor <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]>
1 parent b64e5e3 commit e602625

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/cmd/go/internal/work/gccgo.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,9 @@ func (tools gccgoToolchain) link(b *Builder, root *Action, out, importcfg string
484484

485485
case "c-shared":
486486
ldflags = append(ldflags, "-shared", "-nostdlib")
487+
if cfg.Goos != "windows" {
488+
ldflags = append(ldflags, "-Wl,-z,nodelete")
489+
}
487490
ldflags = append(ldflags, goLibBegin...)
488491
ldflags = append(ldflags, "-lgo", "-lgcc_s", "-lgcc", "-lc", "-lgcc")
489492

0 commit comments

Comments
 (0)