1 // Copyright 2011 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 import "internal/buildcfg"
9 // For the linkers. Must match Go definitions.
13 StackSystem = STACKSYSTEM
18 // Initialize StackGuard and StackLimit according to target system.
19 var StackGuard = 928*stackGuardMultiplier() + StackSystem
20 var StackLimit = StackGuard - StackSystem - StackSmall
22 // stackGuardMultiplier returns a multiplier to apply to the default
23 // stack guard size. Larger multipliers are used for non-optimized
24 // builds that have larger stack frames or for specific targets.
25 func stackGuardMultiplier() int {
26 // On AIX, a larger stack is needed for syscalls.
27 if buildcfg.GOOS == "aix" {
30 return stackGuardMultiplierDefault