diff options
-rw-r--r-- | makefiles/toolchain_gnu-arm-eabi.mk | 16 | ||||
-rw-r--r-- | nuttx-configs/px4fmu-v2/nsh/Make.defs | 6 | ||||
-rw-r--r-- | src/modules/uavcan/module.mk | 3 |
3 files changed, 13 insertions, 12 deletions
diff --git a/makefiles/toolchain_gnu-arm-eabi.mk b/makefiles/toolchain_gnu-arm-eabi.mk index 7e1f510e6..7055137ca 100644 --- a/makefiles/toolchain_gnu-arm-eabi.mk +++ b/makefiles/toolchain_gnu-arm-eabi.mk @@ -80,20 +80,18 @@ ARCHCPUFLAGS_CORTEXM3 = -mcpu=cortex-m3 \ -march=armv7-m \ -mfloat-abi=soft -ARCHINSTRUMENTATIONDEFINES_CORTEXM4F = -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 += +ARCHINSTRUMENTATIONDEFINES_CORTEXM4F = -finstrument-functions -ffixed-r10 +ARCHINSTRUMENTATIONDEFINES_CORTEXM4 = -finstrument-functions -ffixed-r10 +ARCHINSTRUMENTATIONDEFINES_CORTEXM3 = +else +ARCHINSTRUMENTATIONDEFINES_CORTEXM4F = -ffixed-r10 +ARCHINSTRUMENTATIONDEFINES_CORTEXM4 = -ffixed-r10 +ARCHINSTRUMENTATIONDEFINES_CORTEXM3 = endif # Pick the right set of flags for the architecture. diff --git a/nuttx-configs/px4fmu-v2/nsh/Make.defs b/nuttx-configs/px4fmu-v2/nsh/Make.defs index 99f3b3140..798d58572 100644 --- a/nuttx-configs/px4fmu-v2/nsh/Make.defs +++ b/nuttx-configs/px4fmu-v2/nsh/Make.defs @@ -62,8 +62,14 @@ ARCHCPUFLAGS = -mcpu=cortex-m4 \ # enable precise stack overflow tracking +ENABLE_STACK_CHECKS ?= 0 +ifneq ($(ENABLE_STACK_CHECKS),0) +$(info Stack checks enabled) INSTRUMENTATIONDEFINES = -finstrument-functions \ -ffixed-r10 +else +INSTRUMENTATIONDEFINES = -ffixed-r10 +endif # pull in *just* libm from the toolchain ... this is grody LIBM = "${shell $(CC) $(ARCHCPUFLAGS) -print-file-name=libm.a}" diff --git a/src/modules/uavcan/module.mk b/src/modules/uavcan/module.mk index a3c6e46a0..924b730a2 100644 --- a/src/modules/uavcan/module.mk +++ b/src/modules/uavcan/module.mk @@ -40,9 +40,6 @@ MODULE_COMMAND = uavcan MAXOPTIMIZATION = -O3 -# Instrumentation makes the CPU load about 3 times higher, see https://github.com/PX4/Firmware/issues/1417 -INSTRUMENTATIONDEFINES += -fno-instrument-functions - # Main SRCS += uavcan_main.cpp \ uavcan_clock.cpp \ |