aboutsummaryrefslogtreecommitdiff
path: root/makefiles/toolchain_gnu-arm-eabi.mk
diff options
context:
space:
mode:
Diffstat (limited to 'makefiles/toolchain_gnu-arm-eabi.mk')
-rw-r--r--makefiles/toolchain_gnu-arm-eabi.mk16
1 files changed, 12 insertions, 4 deletions
diff --git a/makefiles/toolchain_gnu-arm-eabi.mk b/makefiles/toolchain_gnu-arm-eabi.mk
index 5a7f8390f..b38f40eb4 100644
--- a/makefiles/toolchain_gnu-arm-eabi.mk
+++ b/makefiles/toolchain_gnu-arm-eabi.mk
@@ -80,14 +80,22 @@ ARCHCPUFLAGS_CORTEXM3 = -mcpu=cortex-m3 \
-march=armv7-m \
-mfloat-abi=soft
-ARCHINSTRUMENTATIONDEFINES_CORTEXM4F = -finstrument-functions \
- -ffixed-r10
+ARCHINSTRUMENTATIONDEFINES_CORTEXM4F = -ffixed-r10
-ARCHINSTRUMENTATIONDEFINES_CORTEXM4 = -finstrument-functions \
- -ffixed-r10
+ARCHINSTRUMENTATIONDEFINES_CORTEXM4 = -ffixed-r10
ARCHINSTRUMENTATIONDEFINES_CORTEXM3 =
+# Enabling stack checks if requested
+#
+ENABLE_STACK_CHECKS ?= 0
+ifneq ($(ENABLE_STACK_CHECKS),0)
+$(info Stack checks enabled)
+ARCHINSTRUMENTATIONDEFINES_CORTEXM4F += -finstrument-functions
+ARCHINSTRUMENTATIONDEFINES_CORTEXM4 += -finstrument-functions
+ARCHINSTRUMENTATIONDEFINES_CORTEXM3 +=
+endif
+
# Pick the right set of flags for the architecture.
#
ARCHCPUFLAGS = $(ARCHCPUFLAGS_$(CONFIG_ARCH))