Enable LTO in both Turris 1.x builds. The NOR build needs the space for the ubi command next to the BCH code. The SD card build needs it even without the BCH code: with Debian's GCC 14.2, its u-boot.bin, device tree included, is 1049419 bytes, more than the 1 MiB (CFG_SYS_MMC_U_BOOT_SIZE) that its SPL loads from the card. With LTO, it is 984523 bytes.
Signed-off-by: Josef Schlehofer <[email protected]> Reviewed-by: Marek Mojík <[email protected]> Cc: Marek Mojík <[email protected]> --- Changes in v2: - give the size of the SD card build, which is too large already without the BCH code The Reviewed-by of v1 is kept: the diff is the same, only the commit message changed. The build does not catch an SD card image that is too large: here BOARD_SIZE_CHECK covers only u-boot-nodtb.bin, while the SPL loads u-boot.bin, device tree included. That is left for a follow-up. --- configs/turris_1x_nor_defconfig | 1 + configs/turris_1x_sdcard_defconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/configs/turris_1x_nor_defconfig b/configs/turris_1x_nor_defconfig index 070428ae25e..d8ce4aed4a7 100644 --- a/configs/turris_1x_nor_defconfig +++ b/configs/turris_1x_nor_defconfig @@ -19,6 +19,7 @@ CONFIG_PCIE1=y CONFIG_PCIE2=y CONFIG_PCIE3=y CONFIG_OPTIMIZE_INLINING=y +CONFIG_LTO=y CONFIG_ENV_VARS_UBOOT_CONFIG=y CONFIG_HAS_BOARD_SIZE_LIMIT=y CONFIG_BOARD_SIZE_LIMIT=786432 diff --git a/configs/turris_1x_sdcard_defconfig b/configs/turris_1x_sdcard_defconfig index dbeb34dacfb..982a6cb0703 100644 --- a/configs/turris_1x_sdcard_defconfig +++ b/configs/turris_1x_sdcard_defconfig @@ -29,6 +29,7 @@ CONFIG_OF_BOARD_FIXUP=y CONFIG_PCIE1=y CONFIG_PCIE2=y CONFIG_PCIE3=y +CONFIG_LTO=y CONFIG_HAS_BOARD_SIZE_LIMIT=y CONFIG_BOARD_SIZE_LIMIT=1048576 CONFIG_MP=y -- 2.54.0 (Apple Git-157)
