Makefile: ARMv7-M has no CPSR register
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Fri, 10 Apr 2020 09:10:32 +0000 (11:10 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 24 Apr 2020 14:51:32 +0000 (10:51 -0400)
Compiling on ARMv7-M fails when trying to address the CPSR register which
is not available on this architecture.

Atomic functions refer to the CPSR register if compiled with
arch/arm/include/asm/proc-armv/system.h. On ARMv7-M we should hence
use arch/arm/thumb1/include/asm/proc-armv/system.h instead.

Cf. https://stackoverflow.com/questions/61097841/error-selected-processor-does-not-support-requested-special-purpose-register

Reported-by: Sicris Rey Embay <sicris.embay@gmail.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Makefile

index 26307fd4a65648be2a291056a369efa9f6b7fbd4..b7fa6d89ce29585ada4f2ffaedd9eac675f5aea4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -742,13 +742,15 @@ KBUILD_CFLAGS += $(KCFLAGS)
 # Use UBOOTINCLUDE when you must reference the include/ directory.
 # Needed to be compatible with the O= option
 UBOOTINCLUDE    := \
-               -Iinclude \
-               $(if $(KBUILD_SRC), -I$(srctree)/include) \
-               $(if $(CONFIG_$(SPL_)SYS_THUMB_BUILD), \
-                       $(if $(CONFIG_HAS_THUMB2),, \
-                               -I$(srctree)/arch/$(ARCH)/thumb1/include),) \
-               -I$(srctree)/arch/$(ARCH)/include \
-               -include $(srctree)/include/linux/kconfig.h
+       -Iinclude \
+       $(if $(KBUILD_SRC), -I$(srctree)/include) \
+       $(if $(CONFIG_$(SPL_)SYS_THUMB_BUILD), \
+               $(if $(CONFIG_HAS_THUMB2), \
+                       $(if $(CONFIG_CPU_V7M), \
+                               -I$(srctree)/arch/arm/thumb1/include), \
+                       -I$(srctree)/arch/arm/thumb1/include)) \
+       -I$(srctree)/arch/$(ARCH)/include \
+       -include $(srctree)/include/linux/kconfig.h
 
 NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)