From 6a914ee26f5954a4c561c853cc7d3f24e545477a Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 20 Mar 2023 14:39:05 -0700 Subject: [PATCH] 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 --- src/cmd/go/internal/load/pkg.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go index 07a53ff3501..e8201efe9cb 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 }