Skip to content

Shrink the smallest builds with compile options #4333

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 2 commits into from
Mar 5, 2021

Conversation

dhalbert
Copy link
Collaborator

@dhalbert dhalbert commented Mar 5, 2021

The trinket_m0 build was running out of space on the latest PR's. It has more in it due to having a DotStar (I think).

These compile options saved about 500 bytes total.

Still left as a possibility is to use a -Os libgcc.a, instead of the current -O2 one, which makes software floating point and various other arithmetic routines noticeably smaller (by at least 1kB or 2kB, I forget which). I have not measured the performance decrease.

@dhalbert dhalbert requested a review from jepler March 5, 2021 04:13
@dhalbert
Copy link
Collaborator Author

dhalbert commented Mar 5, 2021

I am getting paradoxical results on pewpew_m4: the --param max-inline-insns-auto increase is increasing the size rather than decreasing it as on the trinket_m0. Turning this into a draft while I experiment.

@dhalbert dhalbert marked this pull request as draft March 5, 2021 05:08
jepler
jepler previously approved these changes Mar 5, 2021
Copy link

@jepler jepler left a comment

Choose a reason for hiding this comment

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

This is fine by me. A number of things make debugging tough on these samd21 boards as it is.

@jepler
Copy link

jepler commented Mar 5, 2021

Unfortunately, the gains are not uniform. for instance, "meowmeow" no longer fits:

Build meowmeow for de_DE took 17.64s and failed
make: Entering directory '/home/runner/work/circuitpython/circuitpython/ports/atmel-samd'
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
/usr/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: build-meowmeow/firmware.elf section `.text' will not fit in region `FLASH_FIRMWARE'
/usr/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: region `FLASH_FIRMWARE' overflowed by 16 bytes
collect2: error: ld returned 1 exit status
make: *** [Makefile:418: build-meowmeow/firmware.elf] Error 1

@dhalbert dhalbert requested a review from jepler March 5, 2021 16:03
@dhalbert dhalbert marked this pull request as ready for review March 5, 2021 16:03
@dhalbert
Copy link
Collaborator Author

dhalbert commented Mar 5, 2021

The single failure in the latest build was a network error, on a build that did not fail before. @jepler, this is ready for re-review.

Copy link

@jepler jepler left a comment

Choose a reason for hiding this comment

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

Thank you

@jepler jepler merged commit 3c50918 into adafruit:main Mar 5, 2021
@dhalbert dhalbert deleted the compile-options-shrink-builds branch March 5, 2021 17:33
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