diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2013-11-01 15:08:47 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2013-11-02 01:07:20 +0000 |
commit | e18eb27f3a65b57f103c10a24c02bfe933288c61 (patch) | |
tree | d5a1462ed011a347c1867e9e7abe09f72d306f33 /core/cortex-m | |
parent | 88503ab4ec8f68c19d36ec4b6d3516848d71404a (diff) | |
download | chrome-ec-e18eb27f3a65b57f103c10a24c02bfe933288c61.tar.gz |
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 <vpalatin@chromium.org>
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 <rspangler@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'core/cortex-m')
-rw-r--r-- | core/cortex-m/build.mk | 2 |
1 files changed, 1 insertions, 1 deletions
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) |