From d4972f6295aede2ddc35bcb1da5f6351623e9e4d Mon Sep 17 00:00:00 2001 From: "khr@golang.org" Date: Mon, 8 Dec 2025 09:21:39 -0500 Subject: [PATCH] runtime: mark getfp as nosplit When compiling with -l, we can't take a stack split here. Fixes #76702 Change-Id: Ieab1225c6259c7f16bb5188aa84bff615d9db2e5 Reviewed-on: https://go-review.googlesource.com/c/go/+/728060 LUCI-TryBot-Result: Go LUCI Auto-Submit: Keith Randall Reviewed-by: Cherry Mui Reviewed-by: Keith Randall --- src/runtime/os_wasm.go | 2 ++ src/runtime/stubs_386.go | 2 ++ src/runtime/stubs_arm.go | 2 ++ src/runtime/stubs_loong64.go | 2 ++ src/runtime/stubs_mips64x.go | 2 ++ src/runtime/stubs_mipsx.go | 2 ++ src/runtime/stubs_ppc64x.go | 2 ++ src/runtime/stubs_riscv64.go | 2 ++ src/runtime/stubs_s390x.go | 2 ++ 9 files changed, 18 insertions(+) diff --git a/src/runtime/os_wasm.go b/src/runtime/os_wasm.go index 15137cc13f..e7a9a13d29 100644 --- a/src/runtime/os_wasm.go +++ b/src/runtime/os_wasm.go @@ -142,6 +142,8 @@ func preemptM(mp *m) { // getfp returns the frame pointer register of its caller or 0 if not implemented. // TODO: Make this a compiler intrinsic +// +//go:nosplit func getfp() uintptr { return 0 } func setProcessCPUProfiler(hz int32) {} diff --git a/src/runtime/stubs_386.go b/src/runtime/stubs_386.go index a1dd023974..7db27cce87 100644 --- a/src/runtime/stubs_386.go +++ b/src/runtime/stubs_386.go @@ -21,4 +21,6 @@ func asmcgocall_no_g(fn, arg unsafe.Pointer) // getfp returns the frame pointer register of its caller or 0 if not implemented. // TODO: Make this a compiler intrinsic +// +//go:nosplit func getfp() uintptr { return 0 } diff --git a/src/runtime/stubs_arm.go b/src/runtime/stubs_arm.go index e19f1a87b2..49bfd9ef04 100644 --- a/src/runtime/stubs_arm.go +++ b/src/runtime/stubs_arm.go @@ -26,4 +26,6 @@ func asmcgocall_no_g(fn, arg unsafe.Pointer) // getfp returns the frame pointer register of its caller or 0 if not implemented. // TODO: Make this a compiler intrinsic +// +//go:nosplit func getfp() uintptr { return 0 } diff --git a/src/runtime/stubs_loong64.go b/src/runtime/stubs_loong64.go index 4576089b0b..88d5985db0 100644 --- a/src/runtime/stubs_loong64.go +++ b/src/runtime/stubs_loong64.go @@ -19,4 +19,6 @@ func unspillArgs() // getfp returns the frame pointer register of its caller or 0 if not implemented. // TODO: Make this a compiler intrinsic +// +//go:nosplit func getfp() uintptr { return 0 } diff --git a/src/runtime/stubs_mips64x.go b/src/runtime/stubs_mips64x.go index f0cf088620..fb5220b0de 100644 --- a/src/runtime/stubs_mips64x.go +++ b/src/runtime/stubs_mips64x.go @@ -17,4 +17,6 @@ func asmcgocall_no_g(fn, arg unsafe.Pointer) // getfp returns the frame pointer register of its caller or 0 if not implemented. // TODO: Make this a compiler intrinsic +// +//go:nosplit func getfp() uintptr { return 0 } diff --git a/src/runtime/stubs_mipsx.go b/src/runtime/stubs_mipsx.go index 84ba147b85..175d4f9741 100644 --- a/src/runtime/stubs_mipsx.go +++ b/src/runtime/stubs_mipsx.go @@ -12,4 +12,6 @@ func save_g() // getfp returns the frame pointer register of its caller or 0 if not implemented. // TODO: Make this a compiler intrinsic +// +//go:nosplit func getfp() uintptr { return 0 } diff --git a/src/runtime/stubs_ppc64x.go b/src/runtime/stubs_ppc64x.go index 36b01a72b1..dbc82c8453 100644 --- a/src/runtime/stubs_ppc64x.go +++ b/src/runtime/stubs_ppc64x.go @@ -23,4 +23,6 @@ func unspillArgs() // getfp returns the frame pointer register of its caller or 0 if not implemented. // TODO: Make this a compiler intrinsic +// +//go:nosplit func getfp() uintptr { return 0 } diff --git a/src/runtime/stubs_riscv64.go b/src/runtime/stubs_riscv64.go index 61a6e33bd4..2306ba878b 100644 --- a/src/runtime/stubs_riscv64.go +++ b/src/runtime/stubs_riscv64.go @@ -22,4 +22,6 @@ func unspillArgs() // getfp returns the frame pointer register of its caller or 0 if not implemented. // TODO: Make this a compiler intrinsic +// +//go:nosplit func getfp() uintptr { return 0 } diff --git a/src/runtime/stubs_s390x.go b/src/runtime/stubs_s390x.go index 6d704e8200..144e3cdf91 100644 --- a/src/runtime/stubs_s390x.go +++ b/src/runtime/stubs_s390x.go @@ -17,4 +17,6 @@ func unspillArgs() // getfp returns the frame pointer register of its caller or 0 if not implemented. // TODO: Make this a compiler intrinsic +// +//go:nosplit func getfp() uintptr { return 0 } -- 2.52.0