Skip to content
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

Pico build size improvements #810

Merged
merged 3 commits into from
Mar 8, 2023
Merged

Conversation

Daft-Freak
Copy link
Collaborator

Adds some flags to the BlitEngine library as the pico sdk does not set things globally. Also switches to nano stdlibs, mostly to avoid exceptions related code getting pulled in through libstdc++.

Saves ~24k of flash for the logo example and some RAM too.

The enabled policy requires CMake 3.13, but the pico-sdk requires that itself.

This is where the pico-sdk sets things like -fno-exceptions. Saves a few kb.

Requires enabling a policy from CMake 3.13, which the pico-sdk already requires
This is specified in pico_standard_link for the executables. Reduces the size of the logo example by ~17k (as an example)
Removes another 4k from logo and gets rid of a load of unwind code from RAM. Also consistent with 32blit-stm32
@Gadgetoid
Copy link
Contributor

Interesting, same libstdc++ issue I was seeing with my MicroPython builds?

@Daft-Freak
Copy link
Collaborator Author

Similar, but not as huge as the verbose stuff.

The standard linker script ends up putting anything unwind related in RAM... and any c++ compiled with exceptions support (including the non-nano libstdc++) pulls all of it in.

@Gadgetoid
Copy link
Contributor

Wow, .uf2 size differences say it all. Nice work, thanks!

@Daft-Freak
Copy link
Collaborator Author

Mostly 12bc110 I think.

This was all discovered by accident while digging into low-level pico stuff for... other reasons.

@Gadgetoid Gadgetoid merged commit 470f57b into 32blit:master Mar 8, 2023
@Daft-Freak Daft-Freak deleted the pico-build-size branch March 8, 2023 11:52
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.

2 participants