Skip to content

Commit

Permalink
Drop PlatformIO lines from LD script; append object suffix to the end…
Browse files Browse the repository at this point in the history
… of target name // Resolve esp8266#4355
  • Loading branch information
ivankravets committed Feb 20, 2018
1 parent ee5a1e2 commit f2fc590
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 23 deletions.
17 changes: 16 additions & 1 deletion tools/platformio-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,23 @@

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()

Expand Down Expand Up @@ -92,4 +107,4 @@
join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core"))
))

env.Prepend(LIBS=libs)
env.Prepend(LIBS=libs)
22 changes: 0 additions & 22 deletions tools/sdk/ld/eagle.app.v6.common.ld
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f2fc590

Please sign in to comment.