]> Cypherpunks.ru repositories - gostls13.git/commitdiff
runtime,syscall: invert openbsd architecture tests
authorJoel Sing <joel@sing.id.au>
Fri, 4 Aug 2023 11:27:20 +0000 (21:27 +1000)
committerGopher Robot <gobot@golang.org>
Sat, 5 Aug 2023 18:04:17 +0000 (18:04 +0000)
Rather than testing for architectures that use libc-based system calls,
test that it is not the single architecture that Go is still using direct
system calls. This reduces the number of changes needed for new openbsd
ports.

Updates #36435
Updates #61546

Change-Id: I79c4597c629b8b372e9efcda79e8f6ff778b9e8e
Reviewed-on: https://go-review.googlesource.com/c/go/+/516016
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/runtime/proc.go
src/syscall/exec_unix.go

index 047b359d3df16a86edbabec5011d50fac0121701..fafab7f58c487c6c4c7ab1e2bc3e441483e7c304 100644 (file)
@@ -1497,7 +1497,7 @@ func usesLibcall() bool {
        case "aix", "darwin", "illumos", "ios", "solaris", "windows":
                return true
        case "openbsd":
-               return GOARCH == "386" || GOARCH == "amd64" || GOARCH == "arm" || GOARCH == "arm64"
+               return GOARCH != "mips64"
        }
        return false
 }
@@ -1509,10 +1509,7 @@ func mStackIsSystemAllocated() bool {
        case "aix", "darwin", "plan9", "illumos", "ios", "solaris", "windows":
                return true
        case "openbsd":
-               switch GOARCH {
-               case "386", "amd64", "arm", "arm64":
-                       return true
-               }
+               return GOARCH != "mips64"
        }
        return false
 }
index 9a5f2d3295a3c56ff57baecdadb41253f2edd98a..206c0ab32b5b29bbe4c4b9276d49b43b8437d5d6 100644 (file)
@@ -293,7 +293,7 @@ func Exec(argv0 string, argv []string, envv []string) (err error) {
        } else if runtime.GOOS == "darwin" || runtime.GOOS == "ios" {
                // Similarly on Darwin.
                err1 = execveDarwin(argv0p, &argvp[0], &envvp[0])
-       } else if runtime.GOOS == "openbsd" && (runtime.GOARCH == "386" || runtime.GOARCH == "amd64" || runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
+       } else if runtime.GOOS == "openbsd" && runtime.GOARCH != "mips64" {
                // Similarly on OpenBSD.
                err1 = execveOpenBSD(argv0p, &argvp[0], &envvp[0])
        } else {