Skip to content
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

Makes binary much smaller with -flto #561

Open
wants to merge 1 commit into
base: 3.5-dev
Choose a base branch
from

Conversation

tobbelobb
Copy link
Contributor

No description provided.

@tobbelobb tobbelobb changed the base branch from 3.4-dev to 3.5-dev March 13, 2022 18:26
@dc42
Copy link
Collaborator

dc42 commented Mar 14, 2022

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!

@dc42
Copy link
Collaborator

dc42 commented Mar 14, 2022

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.

@tobbelobb
Copy link
Contributor Author

Glad to help!

@tobbelobb tobbelobb closed this Apr 11, 2023
@dc42
Copy link
Collaborator

dc42 commented Apr 11, 2023

I have enquired whether there is now a stable release of gcc that fixes the floating point bug.

@dc42 dc42 reopened this Apr 11, 2023
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