I presume that Particle is using Link Time Optimization for extra memory savings when compiling the system firmware, but how would I go about for using LTO on my user code? Does anyone have experience with this and could share some insight on how to do this the best way?
The only mention I’ve seen is this thread that is several years old.
Looking at the Travis continuous-integration testing script on github, builds for debug are done with COMPILE_LTO=n, but builds for production are done with COMPILE_LTO=y.
If you are running make and gcc locally, you are fully in control over this. If you are using the cloud compiler, you do not have control that I know of and I believe it always does COMPILE_LTO=y.
Right, but I won’t gain anything (other than a complex compilation setup) from doing this rather than setting it up myself? I have no experience with LOT, but from what I’ve read it’s just another pass of optimisation that comes after the compile process and it’s fully automated so I can’t do much to affect the output?
Yeah. I got Eclipse setup and that part’s working great. I’m just trying to squeeze as much as possible out of the 128k available. I’m not using much RAM, so I’ve been trying to see if I can move things from Flash to the stack. Any help in that regard would be very appreciated.