
On Mon, Apr 11, 2022 at 03:46:04PM -0600, Simon Glass wrote:
Hi Andrew,
On Thu, 31 Mar 2022 at 04:29, Andrew Scull ascull@google.com wrote:
On Sun, 27 Mar 2022 at 21:27, Simon Glass sjg@chromium.org wrote:
LTO (Link-Time Optimisation) is an very useful feature which can significantly reduce the size of U-Boot binaries. So far it has been made available for selected ARM boards and sandbox.
However, incremental builds are much slower when LTO is used. For example, an incremental build of sandbox takes 2.1 seconds on my machine, but 6.7 seconds with LTO enabled.
This is something that has been bothering me too. I'd resorted to adding `# CONFIG_LTO is not set` to sandbox_defconfig because I couldn't work out how to stop .config being regenerated each build. But then the diff gets in the way and is difficult to manage.
Add a LTO_BUILD=n parameter to the build, so it can be disabled during development if needed, for faster builds.
If you go the build parameter route rather than config route to address this, could the flag be consistent e.g. with NO_SDL=1, which would mean NO_LTO=1?
That seems OK to me. Would you like to do that and send a new version?
Here is a better version of the patch to use as a starting point:
https://source.denx.de/u-boot/custodians/u-boot-dm/-/commit/2d4ebfb0e8e86a1b...
Tom, please consider dropping your objection to this. I have already shown that it makes a dramatic difference to incremental build time for any board...
Yeah, OK, reworked to be consistent with now we do SDL is workable.