Skip to content

atmel-samd: parallelize lto linking #3541

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 7 commits into from
Oct 19, 2020
Merged

Conversation

jepler
Copy link

@jepler jepler commented Oct 12, 2020

This decreases the link time, especially on desktop machines with many CPU
cores. However, it does come at a slight cost in binary size, making the flash
section about 200 bytes bigger for circuitplayground_express.

Before, linking build-circuitplayground_express/firmware.elf takes
8.8s elapsed time, leaving 3128 bytes free in flash.

After, linking build-circuitplayground_express/firmware.elf takes 2.8s elapsed
time, leaving 2924 bytes free in flash. (-6 seconds, -204 bytes free)

If necessary, we can make this per-board or even per-translation to squeeze full
builds.

@jepler
Copy link
Author

jepler commented Oct 12, 2020

A curious error on two builds:

/usr/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /tmp/firmware.elf.uSD8rO.ltrans66.ltrans.o: in function `common_hal_mcu_pin_is_free':
<artificial>:(.text.common_hal_mcu_pin_is_free+0x30): undefined reference to `pin_PA30'

I'll investigate.

@tannewt
Copy link
Member

tannewt commented Oct 13, 2020

I don't think we want to increase the binary size at all. #3529 is currently failing due to running out of space on the French translation for the metro_m0_express.

@jepler
Copy link
Author

jepler commented Oct 18, 2020

@tannewt I hope I can still get this to the point of being possible to include; but if not, we should grab the parts that fix comparisons against pin objects that don't actually exist, like 051e7d5 -- and pull in the related submodule update adafruit/samd-peripherals#37 which will turn such mistakes into compile-time errors.

This decreases the link time, especially on desktop machines with many CPU
cores.  However, it does come at a slight cost in binary size, making the flash
section about 200 bytes bigger for circuitplayground_express.

Before, linking build-circuitplayground_express/firmware.elf takes
8.8s elapsed time, leaving 3128 bytes free in flash.

After, linking build-circuitplayground_express/firmware.elf takes 2.8s elapsed
time, leaving 2924 bytes free in flash. (-6 seconds, -204 bytes free)

If necessary, we can make this per-board or even per-translation to squeeze full
builds.
this is possible now that the undefined reference to pin_PA30 has been
resolved.
The SDA, SCL, and MISO pins were ignored.  This error was not diagnosed
before now.
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

This looks good! Beware, I'll be tempted to set lto back to a single partition when we need the space.

@tannewt tannewt merged commit d98b312 into adafruit:main Oct 19, 2020
@jepler jepler deleted the lto-parallel branch November 3, 2021 21:10
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