From c3c38a8eb57f54265e7f0918c821b2e9649a4d1b Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Thu, 1 Oct 2020 12:32:20 +0100 Subject: [PATCH] Enable precompiled libraries (#4209) The latest versions of Arduino IDE shifted the responsibility for precompiled libraries support to the core developers, which breaks precompiled library support in esp32 Arduino core. See https://github.com/arduino/ArduinoCore-avr/pull/52 for more details: ``` In this new version of the builder we are not doing any heuristics to find the right spot where the ldflags should be inserted (this was causing many bugs on its own); instead, we fully trust the core makers to add explicit support to precompiled libs. ``` This chage re-enables precompiled library support in the esp32 Arduino core. --- platform.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform.txt b/platform.txt index 5be1a50d..3bb4f9d3 100644 --- a/platform.txt +++ b/platform.txt @@ -44,6 +44,8 @@ compiler.ar.flags=cru compiler.size.cmd=xtensa-esp32-elf-size +compiler.libraries.ldflags= + # This can be overriden in boards.txt build.flash_size=4MB build.flash_mode=dio @@ -82,7 +84,7 @@ recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.fla recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}" ## Combine gc-sections, archives, and objects -recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -Wl,--start-group {object_files} "{archive_file_path}" {compiler.c.elf.libs} {compiler.libraries.ldflags} -Wl,--end-group -Wl,-EL -o "{build.path}/{build.project_name}.elf" +recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} {compiler.libraries.ldflags} -Wl,--start-group {object_files} "{archive_file_path}" {compiler.c.elf.libs} -Wl,--end-group -Wl,-EL -o "{build.path}/{build.project_name}.elf" ## Create eeprom recipe.objcopy.eep.pattern={tools.gen_esp32part.cmd} -q "{build.path}/partitions.csv" "{build.path}/{build.project_name}.partitions.bin"