]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: use platform.MustLinkExternal in externalLinkingForced
authorIan Lance Taylor <iant@golang.org>
Mon, 20 Mar 2023 21:39:05 +0000 (14:39 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 21 Mar 2023 02:19:56 +0000 (02:19 +0000)
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>

src/cmd/go/internal/load/pkg.go

index 07a53ff3501a15f1a39118f0915f9aa284dbe726..e8201efe9cbdc078e76f660c66117dc251229fed 100644 (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
        }