aboutsummaryrefslogtreecommitdiff
path: root/Makefile.libretro
diff options
context:
space:
mode:
authorHugo Hromic2019-04-20 10:50:06 +0100
committerHugo Hromic2019-04-20 10:58:31 +0100
commit4abd2871cc87171bf7e6ca8a3b42ade92e754402 (patch)
treebd2a4774c3271a5f20d8023870f19ee6442cb8a3 /Makefile.libretro
parente1d8eb0f131f9e7e838ec5658345e51ebcc3179c (diff)
downloadpcsx_rearmed-4abd2871cc87171bf7e6ca8a3b42ade92e754402.tar.gz
pcsx_rearmed-4abd2871cc87171bf7e6ca8a3b42ade92e754402.tar.bz2
pcsx_rearmed-4abd2871cc87171bf7e6ca8a3b42ade92e754402.zip
Backport check for Thumb instructions from configure script
The recompiler can't handle Thumb instructions, so they must be disabled. This is accomplished via the `-marm` flag being set for different platforms. However, when using `platform=unix` and manually configuring the build, the check for Thumb instructions is not done in `Makefile.libretro`. Therefore, when building with a compiler that defaults to Thumb instructions (e.g. ODROID-XU4), the build can fail with this error: libpcsxcore/new_dynarec/backends/psx/pcsxmem.c:18:2: error: #error the dynarec is incompatible with Thumb functions, libpcsxcore/new_dynarec/backends/psx/pcsxmem.c:19:2: error: #error please add -marm to compile flags To address this, we simply backport the define check from the configure script for when we build with `ARCH=arm`. This change doesn't affect the buildbot.
Diffstat (limited to 'Makefile.libretro')
-rw-r--r--Makefile.libretro6
1 files changed, 6 insertions, 0 deletions
diff --git a/Makefile.libretro b/Makefile.libretro
index 5a59aea..2cda1d0 100644
--- a/Makefile.libretro
+++ b/Makefile.libretro
@@ -47,6 +47,12 @@ ifeq ($(platform), unix)
ifneq ($(findstring SunOS,$(shell uname -s)),)
CC = gcc
endif
+ifeq ($(ARCH), arm)
+ifneq ($(findstring __thumb__,$(shell $(CC) -E -dD $(CFLAGS) include/arm_features.h)),)
+ # must disable thumb as recompiler can't handle it
+ CFLAGS += -marm
+endif
+endif
else ifeq ($(platform), linux-portable)
TARGET := $(TARGET_NAME)_libretro.so