Closed wrcrooks closed 12 months ago
A mystery indeed !
Remove -fmoduo-sched from CFLAGS. I've noticed that can make the bin fluctuate by ~16 bytes and it should've stayed local to my machine as I didn't know how GCC 10.x handled it.
Okey doke, I've removed that from the Makefile, I'll upload shortly.
Tested the fix and the firmware size still fluctuates.
I noticed -fmoduo-sched
only gets applied when ENABLE_CLANG := 1
, my Makefile has it set to 0
gcc version 10.2.1 20210110 (Debian 10.2.1-6)
^ Is that GCC version a problem?
Tested the fix and the firmware size still fluctuates. I noticed
-fmoduo-sched
only gets applied whenENABLE_CLANG := 1
, my Makefile has it set to 0
So GCC 10.x ignores it. I use GCC 13.x so I can't comment further.
Edit: It's the other option, -freorder-blocks-algorithm=stc. -O2 uses stc, -Os uses simple. The former saves us 100 bytes despite what GCC docs say.
It's the other option, -freorder-blocks-algorithm=stc. -O2 uses stc, -Os uses simple. The former saves us 100 bytes despite what GCC docs say
Can you elaborate on this?
According to the documentation, -O2 uses -freorder-blocks-algorithm=stc
when compiling. -Os disables this, opting for -freorder-blocks-algorithm=simple
to keep code size down. In our case, stc (software trace cache) reduces the compiled binary by ~100 bytes. I didn't foresee it making the bin size vary by 8-12 bytes between builds.
So it sounds like we want to keep STC because it reduces the compiled binary by ~100 bytes and close this issue because the fluctuation just seems to be a side-effect of a good compile option?
I would agree with that, or at least remove it while counting the size of each feature and putting it back afterwards. I would like to eventually refactor some parts now that I think the AGC stuff is done (or not, seems I've written to a read-only register).
Anything to calm things down.
Roger that. Thanks for the explaination @bricky149 !
I was trying to see how much space enabling 'ENABLE_SQUELCH_MORE_SENSITIVE' took up and I noticed that compile size is fluctuating every time I compile (between 62,592 and 62,604 bytes). Sometimes 62,594, sometimes 62,600, sometimes 62,602. Any idea why the project could be outputting different size bins when it stays identical? Is something in the makefile dynamic?
Makefile parameters: