Match the OS build's CONFIG_ARMV7M_STACKCHECK setting by using actual setting in the exported nuttx config.h file to control each board build setting of ENABLE_STACK_CHECKS in toolchain_gnu-arm-eabi.mk

This commit is contained in:
David Sidrane
2015-01-21 14:54:24 +01:00
committed by Lorenz Meier
parent f6dc2af398
commit 4b8feb03cf
8 changed files with 25 additions and 16 deletions
Regular → Executable
+1
View File
@@ -80,6 +80,7 @@ export ECHO = echo
export UNZIP_CMD = unzip export UNZIP_CMD = unzip
export PYTHON = python export PYTHON = python
export OPENOCD = openocd export OPENOCD = openocd
export GREP = grep
# #
# Host-specific paths, hacks and fixups # Host-specific paths, hacks and fixups
+5 -4
View File
@@ -80,11 +80,12 @@ ARCHCPUFLAGS_CORTEXM3 = -mcpu=cortex-m3 \
-march=armv7-m \ -march=armv7-m \
-mfloat-abi=soft -mfloat-abi=soft
# Enabling stack checks if requested # Enabling stack checks if OS was build with them
# #
ENABLE_STACK_CHECKS ?= 0 TEST_FILE_STACKCHECK=$(WORK_DIR)nuttx-export/include/nuttx/config.h
ifneq ($(ENABLE_STACK_CHECKS),0) TEST_VALUE_STACKCHECK=CONFIG_ARMV7M_STACKCHECK\ 1
$(info Stack checks enabled) ENABLE_STACK_CHECKS=$(shell $(GREP) -q "$(TEST_VALUE_STACKCHECK)" $(TEST_FILE_STACKCHECK); echo $$?;)
ifeq ("$(ENABLE_STACK_CHECKS)","0")
ARCHINSTRUMENTATIONDEFINES_CORTEXM4F = -finstrument-functions -ffixed-r10 ARCHINSTRUMENTATIONDEFINES_CORTEXM4F = -finstrument-functions -ffixed-r10
ARCHINSTRUMENTATIONDEFINES_CORTEXM4 = -finstrument-functions -ffixed-r10 ARCHINSTRUMENTATIONDEFINES_CORTEXM4 = -finstrument-functions -ffixed-r10
ARCHINSTRUMENTATIONDEFINES_CORTEXM3 = ARCHINSTRUMENTATIONDEFINES_CORTEXM3 =
+3 -2
View File
@@ -62,8 +62,9 @@ ARCHCPUFLAGS = -mcpu=cortex-m4 \
# enable precise stack overflow tracking # enable precise stack overflow tracking
INSTRUMENTATIONDEFINES = -finstrument-functions \ ifeq ($(CONFIG_ARMV7M_STACKCHECK),y)
-ffixed-r10 INSTRUMENTATIONDEFINES = -finstrument-functions -ffixed-r10
endif
# pull in *just* libm from the toolchain ... this is grody # pull in *just* libm from the toolchain ... this is grody
LIBM = "${shell $(CC) $(ARCHCPUFLAGS) -print-file-name=libm.a}" LIBM = "${shell $(CC) $(ARCHCPUFLAGS) -print-file-name=libm.a}"
+3 -2
View File
@@ -62,8 +62,9 @@ ARCHCPUFLAGS = -mcpu=cortex-m4 \
# enable precise stack overflow tracking # enable precise stack overflow tracking
INSTRUMENTATIONDEFINES = -finstrument-functions \ ifeq ($(CONFIG_ARMV7M_STACKCHECK),y)
-ffixed-r10 INSTRUMENTATIONDEFINES = -finstrument-functions -ffixed-r10
endif
# pull in *just* libm from the toolchain ... this is grody # pull in *just* libm from the toolchain ... this is grody
LIBM = "${shell $(CC) $(ARCHCPUFLAGS) -print-file-name=libm.a}" LIBM = "${shell $(CC) $(ARCHCPUFLAGS) -print-file-name=libm.a}"
+2 -7
View File
@@ -62,13 +62,8 @@ ARCHCPUFLAGS = -mcpu=cortex-m4 \
# enable precise stack overflow tracking # enable precise stack overflow tracking
ENABLE_STACK_CHECKS ?= 0 ifeq ($(CONFIG_ARMV7M_STACKCHECK),y)
ifneq ($(ENABLE_STACK_CHECKS),0) INSTRUMENTATIONDEFINES = -finstrument-functions -ffixed-r10
$(info Stack checks enabled)
INSTRUMENTATIONDEFINES = -finstrument-functions \
-ffixed-r10
else
INSTRUMENTATIONDEFINES =
endif endif
# pull in *just* libm from the toolchain ... this is grody # pull in *just* libm from the toolchain ... this is grody
+1 -1
View File
@@ -117,7 +117,7 @@ CONFIG_ARCH_HAVE_MPU=y
# #
# CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT is not set # CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT is not set
CONFIG_ARMV7M_TOOLCHAIN_GNU_EABI=y CONFIG_ARMV7M_TOOLCHAIN_GNU_EABI=y
CONFIG_ARMV7M_STACKCHECK=y CONFIG_ARMV7M_STACKCHECK=n
CONFIG_SERIAL_TERMIOS=y CONFIG_SERIAL_TERMIOS=y
CONFIG_SDIO_DMA=y CONFIG_SDIO_DMA=y
CONFIG_SDIO_DMAPRIO=0x00010000 CONFIG_SDIO_DMAPRIO=0x00010000
+5
View File
@@ -58,6 +58,11 @@ ARCHCPUFLAGS = -mcpu=cortex-m3 \
-mthumb \ -mthumb \
-march=armv7-m -march=armv7-m
# enable precise stack overflow tracking
ifeq ($(CONFIG_ARMV7M_STACKCHECK),y)
INSTRUMENTATIONDEFINES = -finstrument-functions -ffixed-r10
endif
# use our linker script # use our linker script
LDSCRIPT = ld.script LDSCRIPT = ld.script
+5
View File
@@ -58,6 +58,11 @@ ARCHCPUFLAGS = -mcpu=cortex-m3 \
-mthumb \ -mthumb \
-march=armv7-m -march=armv7-m
# enable precise stack overflow tracking
ifeq ($(CONFIG_ARMV7M_STACKCHECK),y)
INSTRUMENTATIONDEFINES = -finstrument-functions -ffixed-r10
endif
# use our linker script # use our linker script
LDSCRIPT = ld.script LDSCRIPT = ld.script