Skip to content

Commit 4da905b

Browse files
neildgopherbot
authored andcommitted
cmd/internal/objabi, internal/runtime: increase nosplit limit on OpenBSD
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 <[email protected]> Reviewed-by: Keith Randall <[email protected]> Auto-Submit: Damien Neil <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Cherry Mui <[email protected]>
1 parent ea86737 commit 4da905b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/cmd/internal/objabi/stack.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ func StackNosplit(race bool) int {
2020
func stackGuardMultiplier(race bool) int {
2121
// This arithmetic must match that in internal/runtime/sys/consts.go:StackGuardMultiplier.
2222
n := 1
23-
// On AIX, a larger stack is needed for syscalls.
24-
if buildcfg.GOOS == "aix" {
23+
// On AIX and OpenBSD, a larger stack is needed for syscalls.
24+
if buildcfg.GOOS == "aix" || buildcfg.GOOS == "openbsd" {
2525
n += 1
2626
}
2727
// The race build also needs more stack.

src/internal/runtime/sys/consts.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import (
99
"internal/goos"
1010
)
1111

12-
// AIX requires a larger stack for syscalls.
12+
// AIX and OpenBSD require a larger stack for syscalls.
1313
// The race build also needs more stack. See issue 54291.
1414
// This arithmetic must match that in cmd/internal/objabi/stack.go:stackGuardMultiplier.
15-
const StackGuardMultiplier = 1 + goos.IsAix + isRace
15+
const StackGuardMultiplier = 1 + goos.IsAix + goos.IsOpenbsd + isRace
1616

1717
// DefaultPhysPageSize is the default physical page size.
1818
const DefaultPhysPageSize = goarch.DefaultPhysPageSize

test/nosplit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// run
22

3-
//go:build !nacl && !js && !aix && !wasip1 && !gcflags_noopt && gc
3+
//go:build !nacl && !js && !aix && !openbsd && !wasip1 && !gcflags_noopt && gc
44

55
// Copyright 2014 The Go Authors. All rights reserved.
66
// Use of this source code is governed by a BSD-style

0 commit comments

Comments
 (0)