Skip to content

Commit

Permalink
Keep custom user flags passed via build_flags, such as a custom LD …
Browse files Browse the repository at this point in the history
…script (esp8266#4680)
  • Loading branch information
ivankravets authored Apr 25, 2018
1 parent d582cab commit a0d1c64
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tools/platformio-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,24 @@ def scons_patched_match_splitext(path, suffixes=None):

LIBSOURCE_DIRS=[
join(FRAMEWORK_DIR, "libraries")
]
)
],

env.Replace(
LINKFLAGS=[
"-Os",
"-nostdlib",
"-Wl,--no-check-sections",
"-Wl,-static",
"-Wl,--gc-sections",
"-Wl,-wrap,system_restart_local",
"-Wl,-wrap,spi_flash_read",
"-u", "app_entry",
"-u", "_printf_float",
"-u", "_scanf_float"
"-u", "app_entry"
]
)

# remove LINKFLAGS defined in main.py and keep user custom flags
try:
index = env['LINKFLAGS'].index("call_user_start")
if index > 0 and env['LINKFLAGS'][index - 1] == "-u":
del env['LINKFLAGS'][index - 1]
env['LINKFLAGS'].remove("call_user_start")
except IndexError:
pass

flatten_cppdefines = env.Flatten(env['CPPDEFINES'])

#
Expand Down

0 comments on commit a0d1c64

Please sign in to comment.