Makefile: Allow LTO to be disabled for a build
authorSimon Glass <sjg@chromium.org>
Wed, 3 Aug 2022 18:13:08 +0000 (12:13 -0600)
committerTom Rini <trini@konsulko.com>
Fri, 2 Sep 2022 20:20:11 +0000 (16:20 -0400)
commita55014d09b29d7bc2cbaeb8e41a155c9a257a183
tree7651a422b0d01a6a8ed0375e8f1a6eff3065df3f
parent583f1b2f10be36f86a2da3686d406bfd90cfbc70
Makefile: Allow LTO to be disabled for a build

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 NO_LTO parameter to the build, similar to NO_SDL, 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@chromium.org>
Makefile
arch/arm/config.mk
arch/arm/include/asm/global_data.h
doc/build/gcc.rst
scripts/Makefile.spl