From 142690e1645763b4415dde63ebb10d2c268fa7c5 Mon Sep 17 00:00:00 2001 From: Yamagi Date: Wed, 18 Mar 2020 15:58:22 +0100 Subject: [PATCH] Enforce a minimum architecture for ARM. This was added in 558ee7 to master. --- Makefile | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index f30b8262..0ec1d6ae 100755 --- a/Makefile +++ b/Makefile @@ -147,6 +147,23 @@ endif # ---------- +# ARM needs a sane minimum architecture. We need the `yield` +# opcode, arm6k is the first iteration that supports it. arm6k +# is also the first Raspberry PI generation and older hardware +# is likely too slow to run the game. We're not enforcing the +# minimum architecture, but if you're build for something older +# like arm5 you need to remove the `yield` opcode. It's set in +# Qcommon_Mainloop() in frame.c via inline assmebly. +ifeq ($(YQ2_ARCH), arm) +CFLAGS += -march=armv6k +endif + +ifeq ($(YQ2_ARCH), aarch64) +CFLAGS += -march=armv8.0-a +endif + +# ---------- + # Switch of some annoying warnings. ifeq ($(COMPILER), clang) # -Wno-missing-braces because otherwise clang complains @@ -191,16 +208,6 @@ ifeq ($(YQ2_ARCH), x86_64) override CFLAGS += -mfpmath=sse endif -# In ARM mode it cannot generate yield instruction -# to cool down the CPU in busy mode -ifeq ($(YQ2_ARCH), arm) -CFLAGS += -march=armv6k -endif - -ifeq ($(YQ2_ARCH), aarch64) -CFLAGS += -march=armv8-a -endif - # ---------- # Systemwide installation.