]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/internal/objabi, internal/runtime: increase nosplit limit on OpenBSD
authorDamien Neil <dneil@google.com>
Mon, 2 Dec 2024 20:45:55 +0000 (12:45 -0800)
committerGopher Robot <gobot@golang.org>
Fri, 6 Dec 2024 00:35:41 +0000 (00:35 +0000)
OpenBSD is bumping up against the nosplit limit, and openbsd/ppc64
is over it. Increase StackGuardMultiplier on OpenBSD, matching AIX.

Change-Id: I61e17c99ce77e1fd3f368159dc4615aeae99e913
Reviewed-on: https://go-review.googlesource.com/c/go/+/632996
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/cmd/internal/objabi/stack.go
src/internal/runtime/sys/consts.go
test/nosplit.go

index d50a7c1afd82b3ed503151e4f3ff0493dd32c85b..6a1edd46c80598899330e26e0a87d8b54876a8c9 100644 (file)
@@ -20,8 +20,8 @@ func StackNosplit(race bool) int {
 func stackGuardMultiplier(race bool) int {
        // This arithmetic must match that in internal/runtime/sys/consts.go:StackGuardMultiplier.
        n := 1
-       // On AIX, a larger stack is needed for syscalls.
-       if buildcfg.GOOS == "aix" {
+       // On AIX and OpenBSD, a larger stack is needed for syscalls.
+       if buildcfg.GOOS == "aix" || buildcfg.GOOS == "openbsd" {
                n += 1
        }
        // The race build also needs more stack.
index 98c0f09ef163d1de56a9f0074716daed180e1929..96e630ed1c3e77a1258f8dec76e9e3649de30df4 100644 (file)
@@ -9,10 +9,10 @@ import (
        "internal/goos"
 )
 
-// AIX requires a larger stack for syscalls.
+// AIX and OpenBSD require a larger stack for syscalls.
 // The race build also needs more stack. See issue 54291.
 // This arithmetic must match that in cmd/internal/objabi/stack.go:stackGuardMultiplier.
-const StackGuardMultiplier = 1 + goos.IsAix + isRace
+const StackGuardMultiplier = 1 + goos.IsAix + goos.IsOpenbsd + isRace
 
 // DefaultPhysPageSize is the default physical page size.
 const DefaultPhysPageSize = goarch.DefaultPhysPageSize
index e171d1da6618ec649274f36d5fed8d76ebb4a38f..4b4c93b1d067c5a4520be675f1ca9190cdec65cc 100644 (file)
@@ -1,6 +1,6 @@
 // run
 
-//go:build !nacl && !js && !aix && !wasip1 && !gcflags_noopt && gc
+//go:build !nacl && !js && !aix && !openbsd && !wasip1 && !gcflags_noopt && gc
 
 // Copyright 2014 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style