From f2fc590d51091356320f35641b48eb4439ea7aae Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 20 Feb 2018 13:40:54 +0200 Subject: [PATCH] Drop PlatformIO lines from LD script; append object suffix to the end of target name // Resolve #4355 --- tools/platformio-build.py | 17 ++++++++++++++++- tools/sdk/ld/eagle.app.v6.common.ld | 22 ---------------------- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/tools/platformio-build.py b/tools/platformio-build.py index bdd071b0a..fbc2ef4ad 100644 --- a/tools/platformio-build.py +++ b/tools/platformio-build.py @@ -26,8 +26,23 @@ http://arduino.cc/en/Reference/HomePage from os.path import isdir, join +from SCons import Builder, Util from SCons.Script import DefaultEnvironment + +def scons_patched_match_splitext(path, suffixes=None): + """ + Patch SCons Builder, append $OBJSUFFIX to the end of each target + """ + tokens = Util.splitext(path) + if suffixes and tokens[1] and tokens[1] in suffixes: + return (path, tokens[1]) + return tokens + + +Builder.match_splitext = scons_patched_match_splitext + + env = DefaultEnvironment() platform = env.PioPlatform() @@ -92,4 +107,4 @@ libs.append(env.BuildLibrary( join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core")) )) -env.Prepend(LIBS=libs) \ No newline at end of file +env.Prepend(LIBS=libs) diff --git a/tools/sdk/ld/eagle.app.v6.common.ld b/tools/sdk/ld/eagle.app.v6.common.ld index 132fae986..cbc1ebf87 100644 --- a/tools/sdk/ld/eagle.app.v6.common.ld +++ b/tools/sdk/ld/eagle.app.v6.common.ld @@ -91,17 +91,6 @@ SECTIONS *.c.o( EXCLUDE_FILE (umm_malloc.c.o) .literal*, \ EXCLUDE_FILE (umm_malloc.c.o) .text*) *.cpp.o(.literal*, .text*) - /* PlatformIO */ - /* framework */ - *.pioenvs\\*\\lib*.a:(EXCLUDE_FILE (umm_malloc.o) .literal*, EXCLUDE_FILE (umm_malloc.o) .text*) - *.pioenvs/*/lib*.a:(EXCLUDE_FILE (umm_malloc.o) .literal*, EXCLUDE_FILE (umm_malloc.o) .text*) - /* project dependencies */ - *.pioenvs\\*\\lib*\\lib*.a:(.literal*, .text*) - *.pioenvs/*/lib*/lib*.a:(.literal*, .text*) - /* project source objects */ - *.pioenvs\\*\\src\\*.o(.literal*, .text*) - *.pioenvs/*/src/*.o(.literal*, .text*) - /* End PlatformIO */ *libc.a:(.literal .text .literal.* .text.*) *libm.a:(.literal .text .literal.* .text.*) *libgcc.a:_umoddi3.o(.literal .text) @@ -166,17 +155,6 @@ SECTIONS *.cpp.o(.iram.text) *.c.o(.iram.text) *(.rodata._ZTV*) /* C++ vtables */ - /* PlatformIO */ - /* framework */ - *.pioenvs\\*\\lib*.a:(.iram.text) - *.pioenvs/*/lib*.a:(.iram.text) - /* project dependencies */ - *.pioenvs\\*\\lib*\\lib*.a:(.iram.text) - *.pioenvs/*/lib*/lib*.a:(.iram.text) - /* project source objects */ - *.pioenvs\\*\\src\\*.o(.iram.text) - *.pioenvs/*/src/*.o(.iram.text) - /* End PlatformIO */ *(.fini.literal) *(.fini) *(.gnu.version)