1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +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=[ LIBSOURCE_DIRS=[
join(FRAMEWORK_DIR, "libraries") join(FRAMEWORK_DIR, "libraries")
],
LINKFLAGS=[
"-Wl,-wrap,system_restart_local",
"-Wl,-wrap,spi_flash_read",
"-u", "app_entry"
] ]
) )
env.Replace( # remove LINKFLAGS defined in main.py and keep user custom flags
LINKFLAGS=[ try:
"-Os", index = env['LINKFLAGS'].index("call_user_start")
"-nostdlib", if index > 0 and env['LINKFLAGS'][index - 1] == "-u":
"-Wl,--no-check-sections", del env['LINKFLAGS'][index - 1]
"-Wl,-static", env['LINKFLAGS'].remove("call_user_start")
"-Wl,--gc-sections", except IndexError:
"-Wl,-wrap,system_restart_local", pass
"-Wl,-wrap,spi_flash_read",
"-u", "app_entry",
"-u", "_printf_float",
"-u", "_scanf_float"
]
)
flatten_cppdefines = env.Flatten(env['CPPDEFINES']) flatten_cppdefines = env.Flatten(env['CPPDEFINES'])