Move compiler optimization to the SoC

Decisions on compiler optimizations were done on the architecture level,
this does not scale and some SoCs will have different optimization levels
or compiler options needed. Moving this to the SoC makes it easy to optimize
differently when using the same CPU which we use to set the right optimization
now on the architecture level.

For IAMCU platforms, use the right architecture and tuning.

-march=lakemont -mtune=lakemont -miamcu -msoft-float

Change-Id: I458afca5feb9be5de8dcae559d6dcac3c6d6a2a7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2016-01-13 07:49:42 -05:00
commit c4c919dbe0
12 changed files with 67 additions and 22 deletions

View file

@ -1,15 +1,11 @@
KBUILD_CFLAGS += $(call cc-option,-ffunction-sections,) $(call cc-option,-fdata-sections,)
arch-$(CONFIG_CPU_CORTEX_M3) += $(call cc-option,-mthumb -mcpu=cortex-m3) \
$(call cc-option,-mthumb -march=armv7-m)
arch-$(CONFIG_CPU_CORTEX_M4) += $(call cc-option,-mthumb -mcpu=cortex-m4) \
$(call cc-option,-mthumb -march=armv7e-m)
include $(srctree)/arch/$(ARCH)/soc/$(SOC_NAME)/Makefile
cflags-$(CONFIG_LTO) = $(call cc-option,-flto,)
cflags-$(CONFIG_LTO) += $(call cc-option,-flto,)
KBUILD_CFLAGS += $(cflags-y) $(arch-y)
KBUILD_CXXFLAGS += $(cflags-y) $(arch-y)
KBUILD_AFLAGS += $(arch-y)
KBUILD_CFLAGS += $(cflags-y)
KBUILD_CXXFLAGS += $(cflags-y)
QEMU_CPU_TYPE_arm = cortex-m3
QEMU_FLAGS_arm = -cpu $(QEMU_CPU_TYPE_arm) \