From 960eccad8c132b00a0b59b303f85151a99dd2e6f Mon Sep 17 00:00:00 2001 From: Valeriy Koval Date: Mon, 6 Apr 2015 21:16:10 +0300 Subject: [PATCH] Add "nano.specs" for ARM linker --- platformio/builder/scripts/basearm.py | 5 +++-- platformio/builder/scripts/baseavr.py | 2 +- platformio/builder/scripts/teensy.py | 12 ++++-------- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/platformio/builder/scripts/basearm.py b/platformio/builder/scripts/basearm.py index 9ae00990..cc947a32 100644 --- a/platformio/builder/scripts/basearm.py +++ b/platformio/builder/scripts/basearm.py @@ -45,9 +45,10 @@ env.Replace( LINKFLAGS=[ "-Os", - "-Wl,--gc-sections", + "-Wl,--gc-sections,--relax", "-mthumb", - "-mcpu=${BOARD_OPTIONS['build']['cpu']}" + "-mcpu=${BOARD_OPTIONS['build']['cpu']}", + "--specs=nano.specs" ], LIBS=["c", "gcc", "m"], diff --git a/platformio/builder/scripts/baseavr.py b/platformio/builder/scripts/baseavr.py index 8a0384f1..3ac52b00 100644 --- a/platformio/builder/scripts/baseavr.py +++ b/platformio/builder/scripts/baseavr.py @@ -44,7 +44,7 @@ env.Replace( LINKFLAGS=[ "-Os", "-mmcu=$BOARD_MCU", - "-Wl,--gc-sections" + "-Wl,--gc-sections,--relax" ], LIBS=["m"], diff --git a/platformio/builder/scripts/teensy.py b/platformio/builder/scripts/teensy.py index 4d97a54e..ba657713 100644 --- a/platformio/builder/scripts/teensy.py +++ b/platformio/builder/scripts/teensy.py @@ -16,6 +16,9 @@ if env.get("BOARD_OPTIONS", {}).get("build", {}).get("core") == "teensy": SConscript(env.subst(join("$PIOBUILDER_DIR", "scripts", "baseavr.py"))) elif env.get("BOARD_OPTIONS", {}).get("build", {}).get("core") == "teensy3": SConscript(env.subst(join("$PIOBUILDER_DIR", "scripts", "basearm.py"))) + env.Append( + LINKFLAGS=["-Wl,--defsym=__rtc_localtime=$UNIX_TIME"] + ) env.Append( CPPDEFINES=[ @@ -26,14 +29,7 @@ env.Append( CXXFLAGS=[ "-std=gnu++0x", "-felide-constructors" - ], - - LINKFLAGS=[ - "-Wl,--gc-sections,--relax,--defsym=__rtc_localtime=$UNIX_TIME", - "--specs=nano.specs" - ], - - LIBS=["m"] + ] ) if isfile(env.subst(join(