1 // Copyright 2018 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
7 // RaceDetectorSupported reports whether goos/goarch supports the race
8 // detector. There is a copy of this function in cmd/dist/test.go.
9 // Race detector only supports 48-bit VMA on arm64. But it will always
10 // return true for arm64, because we don't have VMA size information during
12 func RaceDetectorSupported(goos, goarch string) bool {
15 return goarch == "amd64" || goarch == "ppc64le" || goarch == "arm64" || goarch == "s390x"
17 return goarch == "amd64" || goarch == "arm64"
18 case "freebsd", "netbsd", "openbsd", "windows":
19 return goarch == "amd64"
25 // MSanSupported reports whether goos/goarch supports the memory
27 // There is a copy of this function in misc/cgo/testsanitizers/cc_test.go.
28 func MSanSupported(goos, goarch string) bool {
31 return goarch == "amd64" || goarch == "arm64"
37 // ASanSupported reports whether goos/goarch supports the address
39 // There is a copy of this function in misc/cgo/testsanitizers/cc_test.go.
40 func ASanSupported(goos, goarch string) bool {
43 return goarch == "arm64" || goarch == "amd64" || goarch == "riscv64"
49 // FuzzSupported reports whether goos/goarch supports fuzzing
50 // ('go test -fuzz=.').
51 func FuzzSupported(goos, goarch string) bool {
53 case "darwin", "freebsd", "linux", "windows":
60 // FuzzInstrumented reports whether fuzzing on goos/goarch uses coverage
61 // instrumentation. (FuzzInstrumented implies FuzzSupported.)
62 func FuzzInstrumented(goos, goarch string) bool {
64 case "amd64", "arm64":
65 // TODO(#14565): support more architectures.
66 return FuzzSupported(goos, goarch)
72 // MustLinkExternal reports whether goos/goarch requires external linking.
73 // (This is the opposite of internal/testenv.CanInternalLink. Keep them in sync.)
74 func MustLinkExternal(goos, goarch string) bool {
77 if goarch != "arm64" {
81 if goarch == "arm64" {
88 // BuildModeSupported reports whether goos/goarch supports the given build mode
89 // using the given compiler.
90 func BuildModeSupported(compiler, buildmode, goos, goarch string) bool {
91 if compiler == "gccgo" {
95 platform := goos + "/" + goarch
102 // TODO(bcmills): This seems dubious.
103 // Do we really support c-archive mode on js/wasm‽
104 return platform != "linux/ppc64"
108 case "linux/amd64", "linux/arm", "linux/arm64", "linux/386", "linux/ppc64le", "linux/riscv64", "linux/s390x",
109 "android/amd64", "android/arm", "android/arm64", "android/386",
111 "darwin/amd64", "darwin/arm64",
112 "windows/amd64", "windows/386", "windows/arm64":
125 case "linux/386", "linux/amd64", "linux/arm", "linux/arm64", "linux/ppc64le", "linux/riscv64", "linux/s390x",
126 "android/amd64", "android/arm", "android/arm64", "android/386",
128 "darwin/amd64", "darwin/arm64",
129 "ios/amd64", "ios/arm64",
131 "windows/386", "windows/amd64", "windows/arm":
138 case "linux/386", "linux/amd64", "linux/arm", "linux/arm64", "linux/ppc64le", "linux/s390x":
145 case "linux/amd64", "linux/arm", "linux/arm64", "linux/386", "linux/s390x", "linux/ppc64le",
146 "android/amd64", "android/arm", "android/arm64", "android/386",
147 "darwin/amd64", "darwin/arm64",
158 func InternalLinkPIESupported(goos, goarch string) bool {
159 switch goos + "/" + goarch {
160 case "darwin/amd64", "darwin/arm64",
161 "linux/amd64", "linux/arm64", "linux/ppc64le",
163 "windows-amd64", "windows-386", "windows-arm":