From e18eb27f3a65b57f103c10a24c02bfe933288c61 Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Fri, 1 Nov 2013 15:08:47 -0700 Subject: cortex-m: ensure we use the right subset of the instruction set Cortex-M3 and Cortex-M4 are not using exactly the same instruction set. Cortex-M3 is using ARMv7-M ISA which is a subset of the ARMv7E-M used by the Cortex-M4 core (even though the delta is small). Let's restrict each core to the right subset of instruction by pushing the -mcpu/-march configuration in the chip specific area. Note: GCC 4.8 is now using the full ARMv7E-M instruction set and will emit "undefined instruction" on Cortex-M3 without this patch. Signed-off-by: Vincent Palatin BRANCH=none BUG=chromium:314194 TEST=build *and* run on Spring and Link. Change-Id: I2f9b87fec689e8d1097809cab437a2bd32dfa194 Reviewed-on: https://chromium-review.googlesource.com/175487 Reviewed-by: Randall Spangler Tested-by: Vincent Palatin Commit-Queue: Vincent Palatin --- core/cortex-m/build.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/cortex-m/build.mk') diff --git a/core/cortex-m/build.mk b/core/cortex-m/build.mk index 5f036bc522..c3ae55a521 100644 --- a/core/cortex-m/build.mk +++ b/core/cortex-m/build.mk @@ -10,7 +10,7 @@ CFLAGS_FPU-$(CONFIG_FPU)=-mfpu=fpv4-sp-d16 -mfloat-abi=hard # CPU specific compilation flags -CFLAGS_CPU=-mcpu=cortex-m4 -mthumb -Os -mno-sched-prolog +CFLAGS_CPU+=-mthumb -Os -mno-sched-prolog CFLAGS_CPU+=-mno-unaligned-access CFLAGS_CPU+=$(CFLAGS_FPU-y) -- cgit v1.2.1