1
0
mirror of https://github.com/golang/go synced 2024-11-23 10:30:03 -07:00

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 <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
Ian Lance Taylor 2023-03-20 14:39:05 -07:00 committed by Gopher Robot
parent bf1814bc9e
commit 6a914ee26f

View File

@ -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
}