commit | 00416dcb0f5319a3106d1f86188f7516183e0b95 | [log] [tgz] |
---|---|---|
author | Chris Kay <chris.kay@arm.com> | Tue Feb 20 16:19:54 2024 +0000 |
committer | Chris Kay <chris.kay@arm.com> | Tue Mar 05 16:30:02 2024 +0100 |
tree | f23c09f22f2cbb3d868cefb16ea18827e01b6b8f | |
parent | 0a7a0bc098874129244830dcc527e087173e33ff [diff] [blame] |
build: allow platform makefiles to configure `ENABLE_LTO` This change introduces a lazily-evaluated condition on `ENABLE_LTO` to the `LTO_CFLAGS` variable as opposed to evaluating the condition eagerly. This concludes a recent request on the mailing list: https://lists.trustedfirmware.org/archives/list/tf-a@lists.trustedfirmware.org/thread/EU3XR4VB3RP2NQB372QPZ4VRP57ANNLC/ Change-Id: Ie1f73352eb51fb2ceb2385232336312216ef87fc Signed-off-by: Chris Kay <chris.kay@arm.com>
diff --git a/Makefile b/Makefile index 603c8d9..ef570b2 100644 --- a/Makefile +++ b/Makefile
@@ -155,11 +155,9 @@ endif else ifeq ($($(ARCH)-cc-id),gnu-gcc) - ifeq ($(ENABLE_LTO),1) - # Enable LTO only for aarch64 - ifeq (${ARCH},aarch64) - LTO_CFLAGS = -flto - endif + # Enable LTO only for aarch64 + ifeq (${ARCH},aarch64) + LTO_CFLAGS = $(if $(filter-out 0,$(ENABLE_LTO)),-flto) endif endif #(clang)