From 1d13edcf9221cfeabfe23eeff046dd7324f532b8 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Sat, 17 Jan 2015 22:35:59 +0300 Subject: Stack checks made optional: ENABLE_STACK_CHECKS --- makefiles/toolchain_gnu-arm-eabi.mk | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'makefiles/toolchain_gnu-arm-eabi.mk') 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)) -- cgit v1.2.3