InfiniTime icon indicating copy to clipboard operation
InfiniTime copied to clipboard

LTO

Open mark9064 opened this issue 1 year ago • 3 comments

Based off #867, a compiler upgrade isn't needed anymore and I also simplified the changeset to the minimal needed.

I'm testing it locally now and all seems good so far, but I've only been running it for a few hours.

The original in discussion in #867 regarding why the memory usage has changed is still to be answered - I haven't looked into this yet

mark9064 avatar Nov 23 '24 00:11 mark9064

Build size and comparison to main:

Section Size Difference
text 354472B -25612B
data 920B -24B
bss 22560B 16B

Run in InfiniEmu

github-actions[bot] avatar Nov 23 '24 00:11 github-actions[bot]

Since more functions get inlined, the stack has to accommodate more local variables at once. Given the increased stack usage of LTO, I think this is may be not such a good idea, as InfiniTime is very RAM limited - moreso than it is flash limited.

This PR works perfectly fine though, so keeping it around as a draft

Edit: Need to collect some actual numbers for memory usage LTO off/on

mark9064 avatar Jan 26 '25 00:01 mark9064

With #2331 systemtask stack pressure is reduced now. Still, it needs some extra compared to before. I'm using GCC 14 locally, but I've never seen it go below 48 minimum with 400 size so that should be sufficient

mark9064 avatar Oct 20 '25 21:10 mark9064