1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

Keep custom user flags passed via build_flags, such as a custom LD script (#4680)

This commit is contained in:
Ivan Kravets 2018-04-25 16:28:14 +03:00 committed by GitHub
parent d582cab938
commit a0d1c64af8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -84,23 +84,23 @@ env.Append(
LIBSOURCE_DIRS=[
join(FRAMEWORK_DIR, "libraries")
],
LINKFLAGS=[
"-Wl,-wrap,system_restart_local",
"-Wl,-wrap,spi_flash_read",
"-u", "app_entry"
]
)
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"
]
)
# 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'])