From 1f47a0dbce1fc1cbe7856d59812e09a1b3655d33 Mon Sep 17 00:00:00 2001 From: Peter Mitsis Date: Mon, 16 May 2016 12:56:14 -0400 Subject: [PATCH] arm float: Update compiler options Apply the correct compiler options when building for a Cortex-M4 processor that has floating point enabled. Using 'softfp' allows floating point to be used with existing libraries supplied by the Zephyr SDK. The 'hard' option would require new libraries to be shipped with the SDK. Change-Id: I141c20f54c2241134510888688637930c7b560a2 Signed-off-by: Peter Mitsis --- arch/arm/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 0e5663f1391..f49f0dd1b27 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -14,6 +14,11 @@ cflags-cortex-m3 = $(call cc-option,-mabi=aapcs -mthumb -mcpu=cortex-m3) \ $(call cc-option,-mthumb -march=armv7-m) cflags-cortex-m4 = $(call cc-option,-mabi=aapcs -mthumb -mcpu=cortex-m4) \ $(call cc-option,-mthumb -march=armv7e-m) + +ifeq ($(CONFIG_FLOAT), y) +cflags-cortex-m4 += $(call cc-option,-mfloat-abi=softfp -mfpu=fpv4-sp-d16) +endif + cflags-cortex-m7 = $(call cc-option,-mabi=aapcs -mthumb -mcpu=cortex-m7) \ $(call cc-option,-mthumb -march=armv7e-m)