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>
This commit is contained in:
Simon Glass
2022-08-03 12:13:08 -06:00
committed by Tom Rini
parent 583f1b2f10
commit a55014d09b
5 changed files with 33 additions and 9 deletions

View File

@@ -489,7 +489,7 @@ endif
# Rule to link u-boot-spl
# May be overridden by arch/$(ARCH)/config.mk
ifdef CONFIG_LTO
ifeq ($(LTO_ENABLE),y)
quiet_cmd_u-boot-spl ?= LTO $@
cmd_u-boot-spl ?= \
( \