diff options
| author | Cherry Zhang <cherryyz@google.com> | 2020-10-11 16:27:25 -0400 |
|---|---|---|
| committer | Cherry Zhang <cherryyz@google.com> | 2020-10-12 22:37:15 +0000 |
| commit | 6c0135d3772e710328c751fbc704927931f129ca (patch) | |
| tree | 4d3a5ca816d1a853ef86b10894ad3943a1e48d38 /src/cmd/internal/sys | |
| parent | 027367ac50be74ea6237ef88188365125acec8d7 (diff) | |
| download | go-6c0135d3772e710328c751fbc704927931f129ca.tar.xz | |
cmd/go: don't always link in cgo for PIE
Internal linking for PIE is now supported and enabled by default
on some platforms, for which cgo is not needed. Don't always
bring in cgo.
Change-Id: I043ed436f0e6a3acbcc53ec543f06e193d614b36
Reviewed-on: https://go-review.googlesource.com/c/go/+/261498
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <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.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/cmd/internal/sys/supported.go b/src/cmd/internal/sys/supported.go index 41e5ec1432..55709f3915 100644 --- a/src/cmd/internal/sys/supported.go +++ b/src/cmd/internal/sys/supported.go @@ -115,3 +115,13 @@ func BuildModeSupported(compiler, buildmode, goos, goarch string) bool { return false } } + +func InternalLinkPIESupported(goos, goarch string) bool { + switch goos + "/" + goarch { + case "linux/amd64", "linux/arm64", + "android/arm64", + "windows-amd64", "windows-386", "windows-arm": + return true + } + return false +} |
