Skip to content

Commit

Permalink
Enable precompiled libraries (#4209)
Browse files Browse the repository at this point in the history
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 arduino/ArduinoCore-avr#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.
  • Loading branch information
cpq authored Oct 1, 2020
1 parent 8fcc914 commit c3c38a8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down

1 comment on commit c3c38a8

@coelner
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.