aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/sys/supported.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/internal/sys/supported.go')
-rw-r--r--src/cmd/internal/sys/supported.go25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/cmd/internal/sys/supported.go b/src/cmd/internal/sys/supported.go
index b2b3b02bf6..1d813bbb47 100644
--- a/src/cmd/internal/sys/supported.go
+++ b/src/cmd/internal/sys/supported.go
@@ -32,6 +32,7 @@ func MSanSupported(goos, goarch string) bool {
}
// MustLinkExternal reports whether goos/goarch requires external linking.
+// (This is the opposite of internal/testenv.CanInternalLink. Keep them in sync.)
func MustLinkExternal(goos, goarch string) bool {
switch goos {
case "android":
@@ -66,10 +67,10 @@ func BuildModeSupported(compiler, buildmode, goos, goarch string) bool {
case "c-shared":
switch platform {
- case "linux/amd64", "linux/arm", "linux/arm64", "linux/386", "linux/ppc64le", "linux/s390x",
+ case "linux/amd64", "linux/arm", "linux/arm64", "linux/386", "linux/ppc64le", "linux/riscv64", "linux/s390x",
"android/amd64", "android/arm", "android/arm64", "android/386",
"freebsd/amd64",
- "darwin/amd64",
+ "darwin/amd64", "darwin/arm64",
"windows/amd64", "windows/386":
return true
}
@@ -83,10 +84,11 @@ func BuildModeSupported(compiler, buildmode, goos, goarch string) bool {
case "pie":
switch platform {
- case "linux/386", "linux/amd64", "linux/arm", "linux/arm64", "linux/ppc64le", "linux/s390x",
+ case "linux/386", "linux/amd64", "linux/arm", "linux/arm64", "linux/ppc64le", "linux/riscv64", "linux/s390x",
"android/amd64", "android/arm", "android/arm64", "android/386",
"freebsd/amd64",
- "darwin/amd64",
+ "darwin/amd64", "darwin/arm64",
+ "ios/amd64", "ios/arm64",
"aix/ppc64",
"windows/386", "windows/amd64", "windows/arm":
return true
@@ -95,7 +97,7 @@ func BuildModeSupported(compiler, buildmode, goos, goarch string) bool {
case "shared":
switch platform {
- case "linux/386", "linux/amd64", "linux/arm", "linux/arm64", "linux/ppc64le", "linux/s390x":
+ case "linux/386", "linux/amd64", "linux/arm", "linux/arm64", "linux/ppc64le", "linux/riscv64", "linux/s390x":
return true
}
return false
@@ -104,7 +106,7 @@ func BuildModeSupported(compiler, buildmode, goos, goarch string) bool {
switch platform {
case "linux/amd64", "linux/arm", "linux/arm64", "linux/386", "linux/s390x", "linux/ppc64le",
"android/amd64", "android/arm", "android/arm64", "android/386",
- "darwin/amd64",
+ "darwin/amd64", "darwin/arm64",
"freebsd/amd64":
return true
}
@@ -114,3 +116,14 @@ func BuildModeSupported(compiler, buildmode, goos, goarch string) bool {
return false
}
}
+
+func InternalLinkPIESupported(goos, goarch string) bool {
+ switch goos + "/" + goarch {
+ case "darwin/amd64", "darwin/arm64",
+ "linux/amd64", "linux/arm64",
+ "android/arm64",
+ "windows-amd64", "windows-386", "windows-arm":
+ return true
+ }
+ return false
+}