aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/sys
diff options
context:
space:
mode:
authorElias Naur <mail@eliasnaur.com>2019-04-30 20:03:06 +0200
committerElias Naur <mail@eliasnaur.com>2019-04-30 19:38:46 +0000
commit8bde43e0694ed91565c95b286e3d31a2f43d8d80 (patch)
treec9970af77fe19956e51a650943faca629a3c1a10 /src/cmd/internal/sys
parent88548d0211ba64896fa76a5d1818e4422847a879 (diff)
downloadgo-8bde43e0694ed91565c95b286e3d31a2f43d8d80.tar.xz
cmd/go,cmd/internal/sys,cmd/link: skip Go build ids for externally linked tools
cmd/go already skips build ids on Android where buildmode=pie is forced. Expand the check to all externally linked tools. Necessary for self-hosted iOS builds where PIE is not forced but external linking is. Updates #31722 Change-Id: Iad796a9411a37eb0c44d365b70a3c5907537e461 Reviewed-on: https://go-review.googlesource.com/c/go/+/174307 Run-TryBot: Elias Naur <mail@eliasnaur.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/cmd/internal/sys')
-rw-r--r--src/cmd/internal/sys/supported.go17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/cmd/internal/sys/supported.go b/src/cmd/internal/sys/supported.go
index df26f971f8..4162858ac1 100644
--- a/src/cmd/internal/sys/supported.go
+++ b/src/cmd/internal/sys/supported.go
@@ -31,10 +31,15 @@ func MSanSupported(goos, goarch string) bool {
}
}
-// PIEDefaultsToExternalLink reports whether goos/goarch defaults
-// to external linking for buildmode=pie.
-func PIEDefaultsToExternalLink(goos, goarch string) bool {
- // Currently all systems external link PIE binaries.
- // See https://golang.org/issue/18968.
- return true
+// MustLinkExternal reports whether goos/goarch requires external linking.
+func MustLinkExternal(goos, goarch string) bool {
+ switch goos {
+ case "android":
+ return true
+ case "darwin":
+ if goarch == "arm" || goarch == "arm64" {
+ return true
+ }
+ }
+ return false
}