[PATCH v2 02/13] Makefile: Allow LTO to be disabled for a build

Tom Rini trini at konsulko.com
Mon Mar 7 15:33:02 CET 2022


On Fri, Mar 04, 2022 at 08:42:57AM -0700, Simon Glass 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.
> 
> Add a LTO_BUILD=n parameter to the build, so it can be disabled during
> development if needed, for faster builds.
> 
> Add some documentation about LTO while we are here.
> 
> Signed-off-by: Simon Glass <sjg at chromium.org>

We don't need this since you can do:
make EXTRA_CFLAGS="-fno-lto" EXTRA_LDFLAGS="-fno-lto"
to pass -fno-lto to compile/linking and disable lto and per
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46905 this has been working
for some time.

Not that you need to respin the series for this.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20220307/dee2fddf/attachment.sig>


More information about the U-Boot mailing list