From d11ff3f08155b7614485d9b555e97f7a9555ede5 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Thu, 20 Apr 2023 16:09:48 +0000 Subject: Revert "runtime, cmd: rationalize StackLimit and StackGuard" This reverts commit CL 486380. Submitted out of order and breaks bootstrap. Change-Id: I67bd225094b5c9713b97f70feba04d2c99b7da76 Reviewed-on: https://go-review.googlesource.com/c/go/+/486916 Reviewed-by: David Chase TryBot-Bypass: Austin Clements --- src/cmd/internal/objabi/stack.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/cmd/internal/objabi/stack.go') diff --git a/src/cmd/internal/objabi/stack.go b/src/cmd/internal/objabi/stack.go index 7c7ff4e058..5a2f641a75 100644 --- a/src/cmd/internal/objabi/stack.go +++ b/src/cmd/internal/objabi/stack.go @@ -9,9 +9,18 @@ import ( "internal/buildcfg" ) -func StackNosplit(race bool) int { - // This arithmetic must match that in runtime/stack.go:stackNosplit. - return abi.StackNosplitBase * stackGuardMultiplier(race) +// For the linkers. Must match Go definitions. + +const ( + STACKSYSTEM = 0 + StackSystem = STACKSYSTEM +) + +func StackLimit(race bool) int { + // This arithmetic must match that in runtime/stack.go:{_StackGuard,_StackLimit}. + stackGuard := 928*stackGuardMultiplier(race) + StackSystem + stackLimit := stackGuard - StackSystem - abi.StackSmall + return stackLimit } // stackGuardMultiplier returns a multiplier to apply to the default -- cgit v1.3-5-g9baa