From 35c5deb1d43b245c19059d1532929ee087e44a84 Mon Sep 17 00:00:00 2001 From: Paul Murphy Date: Wed, 7 Jan 2026 13:48:53 -0600 Subject: all: switch linux-ppc64 target to ELFv2 ABI Go is only capable of producing internally linked, static binaries on linux-ppc64. As such, binaries should run in either ELFv1 or ELFv2 ppc64 userspaces today. This opens the door to enabling cgo and external linking which will require ELFv2 support and userspace, eventually. Fixes #76244 Change-Id: I5ca15037cbe546f352e8693dcf14da51a308b8ca Reviewed-on: https://go-review.googlesource.com/c/go/+/734540 LUCI-TryBot-Result: Go LUCI Reviewed-by: Cherry Mui Reviewed-by: Dmitri Shuralyov --- src/runtime/sys_linux_ppc64x.s | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/runtime/sys_linux_ppc64x.s') diff --git a/src/runtime/sys_linux_ppc64x.s b/src/runtime/sys_linux_ppc64x.s index 8735b932ed..5ecfb0ec62 100644 --- a/src/runtime/sys_linux_ppc64x.s +++ b/src/runtime/sys_linux_ppc64x.s @@ -447,13 +447,12 @@ TEXT runtime·sigfwd(SB),NOSPLIT,$0-32 MOVD 24(R1), R2 RET -#ifdef GO_PPC64X_HAS_FUNCDESC -DEFINE_PPC64X_FUNCDESC(runtime·sigtramp, sigtramp<>) +#ifdef GOARCH_ppc64 // cgo isn't supported on ppc64, but we need to supply a cgoSigTramp function. -DEFINE_PPC64X_FUNCDESC(runtime·cgoSigtramp, sigtramp<>) -TEXT sigtramp<>(SB),NOSPLIT|NOFRAME|TOPFRAME,$0 -#else -// ppc64le doesn't need function descriptors +TEXT runtime·cgoSigtramp(SB),NOSPLIT|NOFRAME,$0 + BR runtime·sigtramp(SB) +#endif + // Save callee-save registers in the case of signal forwarding. // Same as on ARM64 https://golang.org/issue/31827 . // @@ -461,7 +460,6 @@ TEXT sigtramp<>(SB),NOSPLIT|NOFRAME|TOPFRAME,$0 // a function pointer) as R2 may not be preserved when calling this // function. In those cases, the caller preserves their R2. TEXT runtime·sigtramp(SB),NOSPLIT|NOFRAME,$0 -#endif // This is called with ELF calling conventions. Convert to Go. // Allocate space for argument storage to call runtime.sigtrampgo. STACK_AND_SAVE_HOST_TO_GO_ABI(32) -- cgit v1.3