diff options
author | David Sidrane <david_s5@nscdg.com> | 2015-01-14 16:33:02 -1000 |
---|---|---|
committer | David Sidrane <david_s5@nscdg.com> | 2015-03-05 08:33:55 -1000 |
commit | e3e5fd5cf758e1fa7d4aaeb30e9fff06cefb6d5d (patch) | |
tree | ebc5f402f2f1f7e86972189672526968118d0069 /makefiles | |
parent | 60043fc9b0cbe560a284ea72db8b3ed8623f6987 (diff) | |
download | px4-firmware-e3e5fd5cf758e1fa7d4aaeb30e9fff06cefb6d5d.tar.gz px4-firmware-e3e5fd5cf758e1fa7d4aaeb30e9fff06cefb6d5d.tar.bz2 px4-firmware-e3e5fd5cf758e1fa7d4aaeb30e9fff06cefb6d5d.zip |
Allows CONFIG_ARMV7M_STACKCHECK to be not set
Diffstat (limited to 'makefiles')
-rw-r--r-- | makefiles/toolchain_gnu-arm-eabi.mk | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/makefiles/toolchain_gnu-arm-eabi.mk b/makefiles/toolchain_gnu-arm-eabi.mk index 2c5302812..853885a3b 100644 --- a/makefiles/toolchain_gnu-arm-eabi.mk +++ b/makefiles/toolchain_gnu-arm-eabi.mk @@ -1,5 +1,5 @@ # -# Copyright (C) 2012-2014 PX4 Development Team. All rights reserved. +# Copyright (c) 2012-2015 PX4 Development Team. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -80,12 +80,23 @@ ARCHCPUFLAGS_CORTEXM3 = -mcpu=cortex-m3 \ -march=armv7-m \ -mfloat-abi=soft +# +# Tool to test a Nuttx Config value from config.h +# + +NUTTX_CONFIG_H=$(WORK_DIR)nuttx-export/include/nuttx/config.h +define check_nuttx_config +$(strip $(shell $(GREP) -q $1 $2;echo $$?;)) +endef +nuttx_config_true:="0" +nuttx_config_2true:="0 0" + +# # Enabling stack checks if OS was build with them # -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") + +ENABLE_STACK_CHECKS=$(call check_nuttx_config ,"CONFIG_ARMV7M_STACKCHECK 1", $(NUTTX_CONFIG_H)) +ifeq ("$(ENABLE_STACK_CHECKS)",$(nuttx_config_true)) ARCHINSTRUMENTATIONDEFINES_CORTEXM4F = -finstrument-functions -ffixed-r10 ARCHINSTRUMENTATIONDEFINES_CORTEXM4 = -finstrument-functions -ffixed-r10 ARCHINSTRUMENTATIONDEFINES_CORTEXM3 = @@ -328,3 +339,4 @@ define BIN_TO_OBJ --rename-section .data=.rodata $(Q) $(REMOVE) $2.c $2.c.o endef + |