From dbf72e95efd507d5a6255c25aee055a0a3c1350e Mon Sep 17 00:00:00 2001 From: David Guillen Fandos Date: Tue, 22 Jun 2021 00:09:44 +0200 Subject: Fix the no-caller-saves bug for MIPS Seems that ABI mandates that we allocate space for arg0..4 even if we do pass them as registers. For some reason write_io_register<> functions write in that stack area (1 word) corrupting the s0 saved register. This seems to be a new gcc behaviour? --- Makefile | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index d127e92..cf0bfd1 100644 --- a/Makefile +++ b/Makefile @@ -375,7 +375,7 @@ else ifeq ($(platform), mips32) SHARED := -shared -nostdlib -Wl,--version-script=link.T fpic := -fPIC -DPIC CFLAGS += -fomit-frame-pointer -ffast-math -march=mips32 -mtune=mips32r2 -mhard-float - CFLAGS += -fno-caller-saves -DMIPS_HAS_R2_INSTS + CFLAGS += -DMIPS_HAS_R2_INSTS HAVE_DYNAREC := 1 CPU_ARCH := mips @@ -385,7 +385,6 @@ else ifeq ($(platform), mips64n32) SHARED := -shared -nostdlib -Wl,--version-script=link.T fpic := -fPIC -DPIC CFLAGS += -fomit-frame-pointer -ffast-math -march=mips64 -mabi=n32 -mhard-float - CFLAGS += -fno-caller-saves HAVE_DYNAREC := 1 CPU_ARCH := mips @@ -394,7 +393,7 @@ else ifeq ($(platform), emscripten) TARGET := $(TARGET_NAME)_libretro_$(platform).bc STATIC_LINKING = 1 -# GCW0 +# GCW0 (OD and OD Beta) else ifeq ($(platform), gcw0) TARGET := $(TARGET_NAME)_libretro.so CC = /opt/gcw0-toolchain/usr/bin/mipsel-linux-gcc @@ -407,22 +406,6 @@ else ifeq ($(platform), gcw0) HAVE_DYNAREC := 1 CPU_ARCH := mips -# GCW0 (OpenDingux Beta) -else ifeq ($(platform), gcw0-odbeta) - TARGET := $(TARGET_NAME)_libretro.so - CC = /opt/gcw0-toolchain/usr/bin/mipsel-linux-gcc - CXX = /opt/gcw0-toolchain/usr/bin/mipsel-linux-g++ - AR = /opt/gcw0-toolchain/usr/bin/mipsel-linux-ar - SHARED := -shared -nostdlib -Wl,--version-script=link.T - fpic := -fPIC -DPIC - CFLAGS += -fomit-frame-pointer -ffast-math -march=mips32 -mtune=mips32r2 -mhard-float - # The ASM code and/or MIPS dynarec of GPSP does not respect - # MIPS calling conventions, so we must use '-fno-caller-saves' - # for the OpenDingux Beta build - CFLAGS += -fno-caller-saves -DMIPS_HAS_R2_INSTS - HAVE_DYNAREC := 1 - CPU_ARCH := mips - # Windows else TARGET := $(TARGET_NAME)_libretro.dll -- cgit v1.2.3