From 91c2318e67da2e5948cd8ed0420863af69142c3d Mon Sep 17 00:00:00 2001 From: Cherry Mui Date: Wed, 22 Sep 2021 10:16:06 -0400 Subject: [PATCH] runtime: call cgocallbackg indirectly on PPC64 This is CL 312669, for PPC64. cgocallback calls cgocallbackg after switching the stack. Call it indirectly to bypass the linker's nosplit check. The nosplit check fails after CL 351271, which removes ABI aliases. It would have been failing before but the linker's nosplit check didn't resolve ABI alias (it should) so it didn't catch that. Removing the ABI aliases exposes it. For this partuclar case it is benign as there is actually a stack switch in between. Should fix PPC64 build. Change-Id: I49617aea55270663a9ee4692c54c070c5ab85470 Reviewed-on: https://go-review.googlesource.com/c/go/+/351469 Trust: Cherry Mui Run-TryBot: Cherry Mui Reviewed-by: Than McIntosh Reviewed-by: Michael Knyszek --- src/runtime/asm_ppc64x.s | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/runtime/asm_ppc64x.s b/src/runtime/asm_ppc64x.s index 7270abbdee..18edb67988 100644 --- a/src/runtime/asm_ppc64x.s +++ b/src/runtime/asm_ppc64x.s @@ -688,7 +688,10 @@ havem: MOVD R5, FIXED_FRAME+0(R1) MOVD R6, FIXED_FRAME+8(R1) MOVD R7, FIXED_FRAME+16(R1) - BL runtime·cgocallbackg(SB) + + MOVD $runtime·cgocallbackg(SB), R12 + MOVD R12, CTR + CALL (CTR) // indirect call to bypass nosplit check. We're on a different stack now. // Restore g->sched (== m->curg->sched) from saved values. MOVD 0(R1), R5 -- 2.50.0