Skip to content

Commit

Permalink
Merge pull request #1356 from haukepetersen/fix_sam3x_newlibnano
Browse files Browse the repository at this point in the history
cpu - sam3x8e: added switch for newlib-nano specs
  • Loading branch information
OlegHahm committed Jul 2, 2014
2 parents 63dd854 + fe818c5 commit d52df83
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions boards/arduino-due/Makefile.include
@@ -1,4 +1,3 @@

# define the cpu used by the arduino due board
export CPU = sam3x8e

Expand Down Expand Up @@ -30,19 +29,18 @@ 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
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 </dev/null ; echo $$?),0)
export LINKFLAGS += -specs=nano.specs -lc -lnosys
endif

# export board specific includes to the global includes-listing
export INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include

0 comments on commit d52df83

Please sign in to comment.