Makes binary much smaller with -flto#561
Conversation
|
I tried out your changes on the Duet 2 build of RRF 3.5-dev. I had to declare some additional functions externally visible, and I changed the type of __estack to uint32t in the other modules instead of changing it to char in SoftwareReset.cpp (there is now a 3.5-dev branch of CoreN2G). The main issue remaining was that the generation of assembler files and stack usage files no longer worked. I've changed the compiler options to generate those at link time, however as they are in system-generated filenames it's no longer easy to find individual functions. We'll need to change the stack analyser at https://github.com/Duet3D/RepRapFirmware/tree/3.4-dev/Tools/stackanalyzer to work with the new files, but unfortunately the person who wrote it can no longer do work for us, and nobody else in our team knows the Go language. So for now I'll leave link time optimization enabled for the Duet 2 build only, as that is the only one that breaks the size limit. Enabling LTO reduced the code size by more than 16kbytes, which is very useful. Thanks for your contribution! |
|
Also there is a reported gcc bug that may prevent us using LTO until it is fixed, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96882. |
|
Glad to help! |
|
I have enquired whether there is now a stable release of gcc that fixes the floating point bug. |
No description provided.