arch: arm: set the architecture via Kconfig
Currently the build system has hardcoded values for the -march/-mcpu which identify what architecture should be used when compiling ARM code. For processors such as the STM32 this will need to be defined by a per SOC process. Change-Id: Ia8158cd687d8d0432ea420e204bb2bc67d33a054 Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
This commit is contained in:
parent
baddeadda1
commit
3f6884902b
4 changed files with 9 additions and 7 deletions
|
@ -7,6 +7,12 @@ cflags-$(CONFIG_LTO) += $(call cc-option,-flto,)
|
||||||
KBUILD_CFLAGS += $(cflags-y)
|
KBUILD_CFLAGS += $(cflags-y)
|
||||||
KBUILD_CXXFLAGS += $(cflags-y)
|
KBUILD_CXXFLAGS += $(cflags-y)
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_CPU_CORTEX_M3),y)
|
||||||
|
arch-cflags += $(call cc-option, -mthumb -mcpu=cortex-m3)
|
||||||
|
else ifeq ($(CONFIG_CPU_CORTEX_M4),y)
|
||||||
|
arch-cflags += $(call cc-option, -mthumb -mcpu=cortex-m4)
|
||||||
|
endif
|
||||||
|
|
||||||
QEMU_CPU_TYPE_arm = cortex-m3
|
QEMU_CPU_TYPE_arm = cortex-m3
|
||||||
QEMU_FLAGS_arm = -cpu $(QEMU_CPU_TYPE_arm) \
|
QEMU_FLAGS_arm = -cpu $(QEMU_CPU_TYPE_arm) \
|
||||||
-machine lm3s6965evb -nographic
|
-machine lm3s6965evb -nographic
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
|
|
||||||
arch-cflags += $(call cc-option,-mthumb -mcpu=cortex-m3) \
|
arch-cflags += $(call cc-option,-mthumb -march=armv7-m)
|
||||||
$(call cc-option,-mthumb -march=armv7-m)
|
|
||||||
|
|
||||||
KBUILD_AFLAGS += $(arch-cflags)
|
KBUILD_AFLAGS += $(arch-cflags)
|
||||||
KBUILD_CXXFLAGS += $(arch-cflags)
|
KBUILD_CXXFLAGS += $(arch-cflags)
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
|
arch-cflags = $(call cc-option,-mthumb -march=armv7e-m)
|
||||||
arch-cflags = $(call cc-option,-mthumb -mcpu=cortex-m4) \
|
|
||||||
$(call cc-option,-mthumb -march=armv7e-m)
|
|
||||||
|
|
||||||
KBUILD_CFLAGS += $(arch-cflags)
|
KBUILD_CFLAGS += $(arch-cflags)
|
||||||
KBUILD_CXXFLAGS += $(arch-cflags)
|
KBUILD_CXXFLAGS += $(arch-cflags)
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
|
|
||||||
arch-cflags = $(call cc-option,-mthumb -mcpu=cortex-m3) \
|
arch-cflags = $(call cc-option,-mthumb -march=armv7-m)
|
||||||
$(call cc-option,-mthumb -march=armv7-m)
|
|
||||||
|
|
||||||
KBUILD_CFLAGS += $(arch-cflags)
|
KBUILD_CFLAGS += $(arch-cflags)
|
||||||
KBUILD_CXXFLAGS += $(arch-cflags)
|
KBUILD_CXXFLAGS += $(arch-cflags)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue