Skip to content

Enable precompiled libraries #4209

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 1, 2020
Merged

Enable precompiled libraries #4209

merged 3 commits into from
Oct 1, 2020

Conversation

cpq
Copy link
Contributor

@cpq cpq commented Jul 27, 2020

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.

cpq and others added 3 commits July 27, 2020 10:33
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.
@me-no-dev me-no-dev merged commit c3c38a8 into espressif:master Oct 1, 2020
@tanakamasayuki
Copy link
Contributor

Hi.
I think it's a different place to put the options.

arduino/ArduinoCore-avr#52

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"

but, This PR

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"

I got an error and could not compile it in my environment.

@gizero
Copy link

gizero commented Mar 26, 2021

Hi! @tanakamasayuki's suggestion seems correct. Neither arduino-esp32 1.0.5 nor 1.0.6 releases solved my original issue with using BSEC-Arduino-library. I still need to "override" the combine recipe as suggested here to make the linker happy.

Having {compiler.libraries.ldflags} listed before the list of the object files ({object_files}) and outside the linker's archive list sounds weird to me, but I may be wrong. @cpq can you please help understand why with this PR you choose to leave {compiler.libraries.ldflags} outside the linker's archive list (delimited by the --start-group and --end-group linker options)?

@gizero
Copy link

gizero commented Mar 26, 2021

After a better look at the repo history, I noticed this PR intentionally moved {compiler.libraries.ldflags} outside the archive list after #3783 (merged just the day before) had it where @tanakamasayuki and my tests would suggest... I'm becoming even more confused...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants