From f8cebb4f789c9950caf55a0b73e88049e7a1c3a3 Mon Sep 17 00:00:00 2001
From: Fabio Estevam <festevam@denx.de>
Date: Thu, 18 Jan 2024 12:06:39 -0300
Subject: [PATCH] imx8m: Enable LTO by default

In an attempt to select ARMV8_SPL_EXCEPTION_VECTORS, the SPL size
could not fit into the internal SRAM of some imx8m targets:

   aarch64:  +   imx8mm_phg
+aarch64-linux-ld.bfd: u-boot-spl section `__u_boot_list' will not fit in region `.sram'
+aarch64-linux-ld.bfd: region `.sram' overflowed by 1824 bytes

Select LTO to prevent that.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Marek Vasut <marex@denx.de>
---
 arch/arm/mach-imx/imx8m/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-imx/imx8m/Kconfig b/arch/arm/mach-imx/imx8m/Kconfig
index b193719840..328c3e3880 100644
--- a/arch/arm/mach-imx/imx8m/Kconfig
+++ b/arch/arm/mach-imx/imx8m/Kconfig
@@ -5,6 +5,7 @@ config IMX8M
 	select BINMAN
 	select GICV3 if ARMV8_PSCI
 	select HAS_CAAM
+	select LTO
 	select ROM_UNIFIED_SECTIONS
 	select ARMV8_CRYPTO
 
-- 
2.39.5