aboutsummaryrefslogtreecommitdiff
path: root/makefiles
diff options
context:
space:
mode:
authorDavid Sidrane <david_s5@nscdg.com>2015-01-20 17:36:55 -1000
committerLorenz Meier <lm@inf.ethz.ch>2015-01-21 14:54:24 +0100
commit4b8feb03cfca89b18ca88a19079e796b44f6d216 (patch)
tree5d0f26224a018e313f160537d7207491e2b4fe6f /makefiles
parentf6dc2af3986ba823822525d9865c101d91aa67c3 (diff)
downloadpx4-firmware-4b8feb03cfca89b18ca88a19079e796b44f6d216.tar.gz
px4-firmware-4b8feb03cfca89b18ca88a19079e796b44f6d216.tar.bz2
px4-firmware-4b8feb03cfca89b18ca88a19079e796b44f6d216.zip
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
Diffstat (limited to 'makefiles')
-rwxr-xr-x[-rw-r--r--]makefiles/setup.mk1
-rwxr-xr-x[-rw-r--r--]makefiles/toolchain_gnu-arm-eabi.mk9
2 files changed, 6 insertions, 4 deletions
diff --git a/makefiles/setup.mk b/makefiles/setup.mk
index 4bfa7a087..c932a6758 100644..100755
--- a/makefiles/setup.mk
+++ b/makefiles/setup.mk
@@ -80,6 +80,7 @@ export ECHO = echo
export UNZIP_CMD = unzip
export PYTHON = python
export OPENOCD = openocd
+export GREP = grep
#
# Host-specific paths, hacks and fixups
diff --git a/makefiles/toolchain_gnu-arm-eabi.mk b/makefiles/toolchain_gnu-arm-eabi.mk
index 0d681cacc..d4d73fb84 100644..100755
--- a/makefiles/toolchain_gnu-arm-eabi.mk
+++ b/makefiles/toolchain_gnu-arm-eabi.mk
@@ -80,11 +80,12 @@ ARCHCPUFLAGS_CORTEXM3 = -mcpu=cortex-m3 \
-march=armv7-m \
-mfloat-abi=soft
-# Enabling stack checks if requested
+# Enabling stack checks if OS was build with them
#
-ENABLE_STACK_CHECKS ?= 0
-ifneq ($(ENABLE_STACK_CHECKS),0)
-$(info Stack checks enabled)
+TEST_FILE_STACKCHECK=$(WORK_DIR)nuttx-export/include/nuttx/config.h
+TEST_VALUE_STACKCHECK=CONFIG_ARMV7M_STACKCHECK\ 1
+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_CORTEXM4 = -finstrument-functions -ffixed-r10
ARCHINSTRUMENTATIONDEFINES_CORTEXM3 =