From fe818c5735ae07b1c98a7505b2d5c3d38d139ad9 Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Sun, 22 Jun 2014 15:07:32 +0200 Subject: [PATCH] cpu - sam3x8e: added switch for newlib-nano specs --- boards/arduino-due/Makefile.include | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/boards/arduino-due/Makefile.include b/boards/arduino-due/Makefile.include index 987a18f5f4ff..f1c5ca541c21 100644 --- a/boards/arduino-due/Makefile.include +++ b/boards/arduino-due/Makefile.include @@ -1,4 +1,3 @@ - # define the cpu used by the arduino due board export CPU = sam3x8e @@ -30,7 +29,7 @@ export PORT # define build specific options export CPU_USAGE = -mcpu=cortex-m3 export CFLAGS += -ggdb -g3 -std=gnu99 -Os -Wall -Wstrict-prototypes $(CPU_USAGE) -mlittle-endian -mthumb -mthumb-interwork -nostartfiles -export CFLAGS += -DREENTRANT_SYSCALLS_PROVIDED +export CFLAGS += -flto -ffunction-sections -fdata-sections -fno-builtin export ASFLAGS += -ggdb -g3 -mcpu=cortex-m4 $(FPU_USAGE) -mlittle-endian export LINKFLAGS += -g3 -ggdb -std=gnu99 $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian -static -lgcc -mthumb -mthumb-interwork -nostartfiles # linkerscript specified in cpu/Makefile.include @@ -38,11 +37,10 @@ export LINKFLAGS += -T$(LINKERSCRIPT) export OFLAGS += -O binary export FFLAGS += -e -w -v -b bin/$(BOARD)/$(APPLICATION).hex -# additional compiler and linker flags to enable newlib-nano and optimize for it -# CAREFUL: newlib-nano is not supported by the ubuntu arm-none-eabi- toolchain, so its disabled by default -#export CFLAGS += -flto -ffunction-sections -fdata-sections -fno-builtin -#export LINKFLAGS += -specs=nano.specs -lc -lnosys - +# use the nano-specs of the NewLib when available +ifeq ($(shell $(LINK) -specs=nano.specs -E - 2>/dev/null >/dev/null