From: Ian Lance Taylor Date: Mon, 20 Mar 2023 21:39:05 +0000 (-0700) Subject: cmd/go: use platform.MustLinkExternal in externalLinkingForced X-Git-Tag: go1.21rc1~1215 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=6a914ee26f5954a4c561c853cc7d3f24e545477a;p=gostls13.git cmd/go: use platform.MustLinkExternal in externalLinkingForced This is a roll-forward of CL 477395 which was rolled back in CL 477736. The earlier CL failed because we didn't account for the fact that on some targets PIE is the default. That is now fixed. Change-Id: I3e93faa9506033d27040cc9920836f010e05cd26 Reviewed-on: https://go-review.googlesource.com/c/go/+/477919 Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor Auto-Submit: Ian Lance Taylor Reviewed-by: Bryan Mills TryBot-Result: Gopher Robot --- diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go index 07a53ff350..e8201efe9c 100644 --- a/src/cmd/go/internal/load/pkg.go +++ b/src/cmd/go/internal/load/pkg.go @@ -2627,12 +2627,7 @@ func externalLinkingForced(p *Package) bool { } // Some targets must use external linking even inside GOROOT. - switch cfg.BuildContext.GOOS { - case "android": - if cfg.BuildContext.GOARCH != "arm64" { - return true - } - case "ios": + if platform.MustLinkExternal(cfg.BuildContext.GOOS, cfg.BuildContext.GOARCH, false) { return true }