From ef8e9c6e8bdc0a995ae37bda5d15dc77f83f0d31 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 7 Jan 2026 19:23:22 -0800 Subject: [PATCH] fix compilation under MIPS and newer binutils addu needs 3 parameters, not two. Also, this function fundamentally does not support MIPS16. Signed-off-by: Rosen Penev --- src/greenlet/platform/switch_mips_unix.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/greenlet/platform/switch_mips_unix.h b/src/greenlet/platform/switch_mips_unix.h index b9003e94..50e70c45 100644 --- a/src/greenlet/platform/switch_mips_unix.h +++ b/src/greenlet/platform/switch_mips_unix.h @@ -16,6 +16,7 @@ #define REGS_TO_SAVE "$16", "$17", "$18", "$19", "$20", "$21", "$22", \ "$23", "$30" +__attribute__((nomips16)) static int slp_switch(void) { @@ -33,9 +34,9 @@ slp_switch(void) SLP_SAVE_STATE(stackref, stsizediff); __asm__ __volatile__ ( #ifdef __mips64 - "daddu $29, %0\n" + "daddu $29, $29, %0\n" #else - "addu $29, %0\n" + "addu $29, $29, %0\n" #endif : /* no outputs */ : "r" (stsizediff)