Skip to content

Commit e5746c0

Browse files
authored
Merge pull request #4399 from ivankravets/master
Drop PlatformIO lines from LD script; append object suffix to the end of target name // Resolve #4355
2 parents ee5a1e2 + f2fc590 commit e5746c0

File tree

2 files changed

+16
-23
lines changed

2 files changed

+16
-23
lines changed

tools/platformio-build.py

+16-1
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,23 @@
2626

2727
from os.path import isdir, join
2828

29+
from SCons import Builder, Util
2930
from SCons.Script import DefaultEnvironment
3031

32+
33+
def scons_patched_match_splitext(path, suffixes=None):
34+
"""
35+
Patch SCons Builder, append $OBJSUFFIX to the end of each target
36+
"""
37+
tokens = Util.splitext(path)
38+
if suffixes and tokens[1] and tokens[1] in suffixes:
39+
return (path, tokens[1])
40+
return tokens
41+
42+
43+
Builder.match_splitext = scons_patched_match_splitext
44+
45+
3146
env = DefaultEnvironment()
3247
platform = env.PioPlatform()
3348

@@ -92,4 +107,4 @@
92107
join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core"))
93108
))
94109

95-
env.Prepend(LIBS=libs)
110+
env.Prepend(LIBS=libs)

tools/sdk/ld/eagle.app.v6.common.ld

-22
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,6 @@ SECTIONS
9191
*.c.o( EXCLUDE_FILE (umm_malloc.c.o) .literal*, \
9292
EXCLUDE_FILE (umm_malloc.c.o) .text*)
9393
*.cpp.o(.literal*, .text*)
94-
/* PlatformIO */
95-
/* framework */
96-
*.pioenvs\\*\\lib*.a:(EXCLUDE_FILE (umm_malloc.o) .literal*, EXCLUDE_FILE (umm_malloc.o) .text*)
97-
*.pioenvs/*/lib*.a:(EXCLUDE_FILE (umm_malloc.o) .literal*, EXCLUDE_FILE (umm_malloc.o) .text*)
98-
/* project dependencies */
99-
*.pioenvs\\*\\lib*\\lib*.a:(.literal*, .text*)
100-
*.pioenvs/*/lib*/lib*.a:(.literal*, .text*)
101-
/* project source objects */
102-
*.pioenvs\\*\\src\\*.o(.literal*, .text*)
103-
*.pioenvs/*/src/*.o(.literal*, .text*)
104-
/* End PlatformIO */
10594
*libc.a:(.literal .text .literal.* .text.*)
10695
*libm.a:(.literal .text .literal.* .text.*)
10796
*libgcc.a:_umoddi3.o(.literal .text)
@@ -166,17 +155,6 @@ SECTIONS
166155
*.cpp.o(.iram.text)
167156
*.c.o(.iram.text)
168157
*(.rodata._ZTV*) /* C++ vtables */
169-
/* PlatformIO */
170-
/* framework */
171-
*.pioenvs\\*\\lib*.a:(.iram.text)
172-
*.pioenvs/*/lib*.a:(.iram.text)
173-
/* project dependencies */
174-
*.pioenvs\\*\\lib*\\lib*.a:(.iram.text)
175-
*.pioenvs/*/lib*/lib*.a:(.iram.text)
176-
/* project source objects */
177-
*.pioenvs\\*\\src\\*.o(.iram.text)
178-
*.pioenvs/*/src/*.o(.iram.text)
179-
/* End PlatformIO */
180158
*(.fini.literal)
181159
*(.fini)
182160
*(.gnu.version)

0 commit comments

Comments
 (0)