[PATCH u-boot v2.1 38/38] ARM: enable LTO for some boards

Enable LTO for some boards that were tested by people on U-Boot Mailing List.
Signed-off-by: Marek Behún marek.behun@nic.cz Tested-by: Adam Ford aford173@gmail.com Tested-by: Pali Rohár pali@kernel.org Tested-by: Tim Harvey tharvey@gateworks.com --- configs/am3517_evm_defconfig | 1 + configs/da850evm_defconfig | 1 + configs/da850evm_direct_nor_defconfig | 1 + configs/da850evm_nand_defconfig | 1 + configs/imx6q_logic_defconfig | 1 + configs/imx8mm_beacon_defconfig | 1 + configs/imx8mm_venice_defconfig | 1 + configs/imx8mn_beacon_2g_defconfig | 1 + configs/imx8mn_beacon_defconfig | 1 + configs/nokia_rx51_defconfig | 1 + configs/omap3_logic_defconfig | 1 + configs/r8a774a1_beacon_defconfig | 1 + configs/r8a774b1_beacon_defconfig | 1 + configs/r8a774e1_beacon_defconfig | 1 + configs/turris_mox_defconfig | 1 + configs/turris_omnia_defconfig | 1 + 16 files changed, 16 insertions(+)
diff --git a/configs/am3517_evm_defconfig b/configs/am3517_evm_defconfig index bae0e0af35..d61eec94a4 100644 --- a/configs/am3517_evm_defconfig +++ b/configs/am3517_evm_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SPL_USE_ARCH_MEMCPY is not set # CONFIG_SPL_USE_ARCH_MEMSET is not set diff --git a/configs/da850evm_defconfig b/configs/da850evm_defconfig index 26e76a2929..6ff5e21bc6 100644 --- a/configs/da850evm_defconfig +++ b/configs/da850evm_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=y diff --git a/configs/da850evm_direct_nor_defconfig b/configs/da850evm_direct_nor_defconfig index d3860a963d..06c7ce7c47 100644 --- a/configs/da850evm_direct_nor_defconfig +++ b/configs/da850evm_direct_nor_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_DAVINCI=y diff --git a/configs/da850evm_nand_defconfig b/configs/da850evm_nand_defconfig index 0d0e9a148d..be737564e1 100644 --- a/configs/da850evm_nand_defconfig +++ b/configs/da850evm_nand_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=y diff --git a/configs/imx6q_logic_defconfig b/configs/imx6q_logic_defconfig index 36dc24d080..0f8aea6983 100644 --- a/configs/imx6q_logic_defconfig +++ b/configs/imx6q_logic_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_MX6=y CONFIG_SYS_TEXT_BASE=0x17800000 diff --git a/configs/imx8mm_beacon_defconfig b/configs/imx8mm_beacon_defconfig index 045b19f4f3..e8bb44eea6 100644 --- a/configs/imx8mm_beacon_defconfig +++ b/configs/imx8mm_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/imx8mm_venice_defconfig b/configs/imx8mm_venice_defconfig index a15c3641f6..dff8f64540 100644 --- a/configs/imx8mm_venice_defconfig +++ b/configs/imx8mm_venice_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/imx8mn_beacon_2g_defconfig b/configs/imx8mn_beacon_2g_defconfig index 58b8e49486..1c8cbc2c89 100644 --- a/configs/imx8mn_beacon_2g_defconfig +++ b/configs/imx8mn_beacon_2g_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/imx8mn_beacon_defconfig b/configs/imx8mn_beacon_defconfig index d6a3385d8d..6457b9409a 100644 --- a/configs/imx8mn_beacon_defconfig +++ b/configs/imx8mn_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/nokia_rx51_defconfig b/configs/nokia_rx51_defconfig index 312ca3a1a9..85ca627790 100644 --- a/configs/nokia_rx51_defconfig +++ b/configs/nokia_rx51_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SYS_THUMB_BUILD is not set CONFIG_ARCH_OMAP2PLUS=y diff --git a/configs/omap3_logic_defconfig b/configs/omap3_logic_defconfig index 4e37237b86..cc4b727a2c 100644 --- a/configs/omap3_logic_defconfig +++ b/configs/omap3_logic_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SPL_USE_ARCH_MEMCPY is not set # CONFIG_SPL_USE_ARCH_MEMSET is not set diff --git a/configs/r8a774a1_beacon_defconfig b/configs/r8a774a1_beacon_defconfig index 2f45edd92e..9dd5d9192e 100644 --- a/configs/r8a774a1_beacon_defconfig +++ b/configs/r8a774a1_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000 diff --git a/configs/r8a774b1_beacon_defconfig b/configs/r8a774b1_beacon_defconfig index ca514bb1aa..b7d7f23f5a 100644 --- a/configs/r8a774b1_beacon_defconfig +++ b/configs/r8a774b1_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000 diff --git a/configs/r8a774e1_beacon_defconfig b/configs/r8a774e1_beacon_defconfig index b89729d92a..3e44edf29f 100644 --- a/configs/r8a774e1_beacon_defconfig +++ b/configs/r8a774e1_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000 diff --git a/configs/turris_mox_defconfig b/configs/turris_mox_defconfig index f938fbb475..2a351d9180 100644 --- a/configs/turris_mox_defconfig +++ b/configs/turris_mox_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_MVEBU=y diff --git a/configs/turris_omnia_defconfig b/configs/turris_omnia_defconfig index 4b8843d7be..d7a2ec3592 100644 --- a/configs/turris_omnia_defconfig +++ b/configs/turris_omnia_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_SPL_SYS_THUMB_BUILD=y

On Fri, Mar 12, 2021 at 5:47 AM Marek Behún marek.behun@nic.cz wrote:
Enable LTO for some boards that were tested by people on U-Boot Mailing List.
Signed-off-by: Marek Behún marek.behun@nic.cz Tested-by: Adam Ford aford173@gmail.com Tested-by: Pali Rohár pali@kernel.org Tested-by: Tim Harvey tharvey@gateworks.com
configs/am3517_evm_defconfig | 1 + configs/da850evm_defconfig | 1 + configs/da850evm_direct_nor_defconfig | 1 + configs/da850evm_nand_defconfig | 1 + configs/imx6q_logic_defconfig | 1 + configs/imx8mm_beacon_defconfig | 1 + configs/imx8mm_venice_defconfig | 1 + configs/imx8mn_beacon_2g_defconfig | 1 + configs/imx8mn_beacon_defconfig | 1 + configs/nokia_rx51_defconfig | 1 + configs/omap3_logic_defconfig | 1 + configs/r8a774a1_beacon_defconfig | 1 + configs/r8a774b1_beacon_defconfig | 1 + configs/r8a774e1_beacon_defconfig | 1 + configs/turris_mox_defconfig | 1 + configs/turris_omnia_defconfig | 1 + 16 files changed, 16 insertions(+)
diff --git a/configs/am3517_evm_defconfig b/configs/am3517_evm_defconfig index bae0e0af35..d61eec94a4 100644 --- a/configs/am3517_evm_defconfig +++ b/configs/am3517_evm_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SPL_USE_ARCH_MEMCPY is not set # CONFIG_SPL_USE_ARCH_MEMSET is not set diff --git a/configs/da850evm_defconfig b/configs/da850evm_defconfig index 26e76a2929..6ff5e21bc6 100644 --- a/configs/da850evm_defconfig +++ b/configs/da850evm_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=y diff --git a/configs/da850evm_direct_nor_defconfig b/configs/da850evm_direct_nor_defconfig index d3860a963d..06c7ce7c47 100644 --- a/configs/da850evm_direct_nor_defconfig +++ b/configs/da850evm_direct_nor_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_DAVINCI=y diff --git a/configs/da850evm_nand_defconfig b/configs/da850evm_nand_defconfig index 0d0e9a148d..be737564e1 100644 --- a/configs/da850evm_nand_defconfig +++ b/configs/da850evm_nand_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=y diff --git a/configs/imx6q_logic_defconfig b/configs/imx6q_logic_defconfig index 36dc24d080..0f8aea6983 100644 --- a/configs/imx6q_logic_defconfig +++ b/configs/imx6q_logic_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_MX6=y CONFIG_SYS_TEXT_BASE=0x17800000 diff --git a/configs/imx8mm_beacon_defconfig b/configs/imx8mm_beacon_defconfig index 045b19f4f3..e8bb44eea6 100644 --- a/configs/imx8mm_beacon_defconfig +++ b/configs/imx8mm_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/imx8mm_venice_defconfig b/configs/imx8mm_venice_defconfig index a15c3641f6..dff8f64540 100644 --- a/configs/imx8mm_venice_defconfig +++ b/configs/imx8mm_venice_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/imx8mn_beacon_2g_defconfig b/configs/imx8mn_beacon_2g_defconfig index 58b8e49486..1c8cbc2c89 100644 --- a/configs/imx8mn_beacon_2g_defconfig +++ b/configs/imx8mn_beacon_2g_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/imx8mn_beacon_defconfig b/configs/imx8mn_beacon_defconfig index d6a3385d8d..6457b9409a 100644 --- a/configs/imx8mn_beacon_defconfig +++ b/configs/imx8mn_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/nokia_rx51_defconfig b/configs/nokia_rx51_defconfig index 312ca3a1a9..85ca627790 100644 --- a/configs/nokia_rx51_defconfig +++ b/configs/nokia_rx51_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SYS_THUMB_BUILD is not set CONFIG_ARCH_OMAP2PLUS=y diff --git a/configs/omap3_logic_defconfig b/configs/omap3_logic_defconfig index 4e37237b86..cc4b727a2c 100644 --- a/configs/omap3_logic_defconfig +++ b/configs/omap3_logic_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SPL_USE_ARCH_MEMCPY is not set # CONFIG_SPL_USE_ARCH_MEMSET is not set diff --git a/configs/r8a774a1_beacon_defconfig b/configs/r8a774a1_beacon_defconfig index 2f45edd92e..9dd5d9192e 100644 --- a/configs/r8a774a1_beacon_defconfig +++ b/configs/r8a774a1_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000 diff --git a/configs/r8a774b1_beacon_defconfig b/configs/r8a774b1_beacon_defconfig index ca514bb1aa..b7d7f23f5a 100644 --- a/configs/r8a774b1_beacon_defconfig +++ b/configs/r8a774b1_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000 diff --git a/configs/r8a774e1_beacon_defconfig b/configs/r8a774e1_beacon_defconfig index b89729d92a..3e44edf29f 100644 --- a/configs/r8a774e1_beacon_defconfig +++ b/configs/r8a774e1_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000 diff --git a/configs/turris_mox_defconfig b/configs/turris_mox_defconfig index f938fbb475..2a351d9180 100644 --- a/configs/turris_mox_defconfig +++ b/configs/turris_mox_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_MVEBU=y diff --git a/configs/turris_omnia_defconfig b/configs/turris_omnia_defconfig index 4b8843d7be..d7a2ec3592 100644 --- a/configs/turris_omnia_defconfig +++ b/configs/turris_omnia_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_SPL_SYS_THUMB_BUILD=y -- 2.26.2
Marek,
Perhaps I didn't test the property test before as I did not realize there was a config to be enabled.
Enabling CONFIG_LTO breaks linking the SPL (linking uboot is fine): LTO spl/u-boot-spl make[2]: *** read jobs pipe: No such file or directory. Stop. make[2]: *** Waiting for unfinished jobs.... lto-wrapper: fatal error: make returned 2 exit status compilation terminated. /usr/src/venice/buildroot/output/host/lib/gcc/aarch64-buildroot-linux-gnu/9.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status scripts/Makefile.spl:461: recipe for target 'spl/u-boot-spl' failed make[1]: *** [spl/u-boot-spl] Error 1 Makefile:1985: recipe for target 'spl/u-boot-spl' failed make: *** [spl/u-boot-spl] Error 2
I'm using your lto branch
Best Regards,
Tim

On Fri, 12 Mar 2021 08:34:41 -0800 Tim Harvey tharvey@gateworks.com wrote:
On Fri, Mar 12, 2021 at 5:47 AM Marek Behún marek.behun@nic.cz wrote:
Enable LTO for some boards that were tested by people on U-Boot Mailing List.
Signed-off-by: Marek Behún marek.behun@nic.cz Tested-by: Adam Ford aford173@gmail.com Tested-by: Pali Rohár pali@kernel.org Tested-by: Tim Harvey tharvey@gateworks.com
configs/am3517_evm_defconfig | 1 + configs/da850evm_defconfig | 1 + configs/da850evm_direct_nor_defconfig | 1 + configs/da850evm_nand_defconfig | 1 + configs/imx6q_logic_defconfig | 1 + configs/imx8mm_beacon_defconfig | 1 + configs/imx8mm_venice_defconfig | 1 + configs/imx8mn_beacon_2g_defconfig | 1 + configs/imx8mn_beacon_defconfig | 1 + configs/nokia_rx51_defconfig | 1 + configs/omap3_logic_defconfig | 1 + configs/r8a774a1_beacon_defconfig | 1 + configs/r8a774b1_beacon_defconfig | 1 + configs/r8a774e1_beacon_defconfig | 1 + configs/turris_mox_defconfig | 1 + configs/turris_omnia_defconfig | 1 + 16 files changed, 16 insertions(+)
diff --git a/configs/am3517_evm_defconfig b/configs/am3517_evm_defconfig index bae0e0af35..d61eec94a4 100644 --- a/configs/am3517_evm_defconfig +++ b/configs/am3517_evm_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SPL_USE_ARCH_MEMCPY is not set # CONFIG_SPL_USE_ARCH_MEMSET is not set diff --git a/configs/da850evm_defconfig b/configs/da850evm_defconfig index 26e76a2929..6ff5e21bc6 100644 --- a/configs/da850evm_defconfig +++ b/configs/da850evm_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=y diff --git a/configs/da850evm_direct_nor_defconfig b/configs/da850evm_direct_nor_defconfig index d3860a963d..06c7ce7c47 100644 --- a/configs/da850evm_direct_nor_defconfig +++ b/configs/da850evm_direct_nor_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_DAVINCI=y diff --git a/configs/da850evm_nand_defconfig b/configs/da850evm_nand_defconfig index 0d0e9a148d..be737564e1 100644 --- a/configs/da850evm_nand_defconfig +++ b/configs/da850evm_nand_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=y diff --git a/configs/imx6q_logic_defconfig b/configs/imx6q_logic_defconfig index 36dc24d080..0f8aea6983 100644 --- a/configs/imx6q_logic_defconfig +++ b/configs/imx6q_logic_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_MX6=y CONFIG_SYS_TEXT_BASE=0x17800000 diff --git a/configs/imx8mm_beacon_defconfig b/configs/imx8mm_beacon_defconfig index 045b19f4f3..e8bb44eea6 100644 --- a/configs/imx8mm_beacon_defconfig +++ b/configs/imx8mm_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/imx8mm_venice_defconfig b/configs/imx8mm_venice_defconfig index a15c3641f6..dff8f64540 100644 --- a/configs/imx8mm_venice_defconfig +++ b/configs/imx8mm_venice_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/imx8mn_beacon_2g_defconfig b/configs/imx8mn_beacon_2g_defconfig index 58b8e49486..1c8cbc2c89 100644 --- a/configs/imx8mn_beacon_2g_defconfig +++ b/configs/imx8mn_beacon_2g_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/imx8mn_beacon_defconfig b/configs/imx8mn_beacon_defconfig index d6a3385d8d..6457b9409a 100644 --- a/configs/imx8mn_beacon_defconfig +++ b/configs/imx8mn_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/nokia_rx51_defconfig b/configs/nokia_rx51_defconfig index 312ca3a1a9..85ca627790 100644 --- a/configs/nokia_rx51_defconfig +++ b/configs/nokia_rx51_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SYS_THUMB_BUILD is not set CONFIG_ARCH_OMAP2PLUS=y diff --git a/configs/omap3_logic_defconfig b/configs/omap3_logic_defconfig index 4e37237b86..cc4b727a2c 100644 --- a/configs/omap3_logic_defconfig +++ b/configs/omap3_logic_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SPL_USE_ARCH_MEMCPY is not set # CONFIG_SPL_USE_ARCH_MEMSET is not set diff --git a/configs/r8a774a1_beacon_defconfig b/configs/r8a774a1_beacon_defconfig index 2f45edd92e..9dd5d9192e 100644 --- a/configs/r8a774a1_beacon_defconfig +++ b/configs/r8a774a1_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000 diff --git a/configs/r8a774b1_beacon_defconfig b/configs/r8a774b1_beacon_defconfig index ca514bb1aa..b7d7f23f5a 100644 --- a/configs/r8a774b1_beacon_defconfig +++ b/configs/r8a774b1_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000 diff --git a/configs/r8a774e1_beacon_defconfig b/configs/r8a774e1_beacon_defconfig index b89729d92a..3e44edf29f 100644 --- a/configs/r8a774e1_beacon_defconfig +++ b/configs/r8a774e1_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000 diff --git a/configs/turris_mox_defconfig b/configs/turris_mox_defconfig index f938fbb475..2a351d9180 100644 --- a/configs/turris_mox_defconfig +++ b/configs/turris_mox_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_MVEBU=y diff --git a/configs/turris_omnia_defconfig b/configs/turris_omnia_defconfig index 4b8843d7be..d7a2ec3592 100644 --- a/configs/turris_omnia_defconfig +++ b/configs/turris_omnia_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_SPL_SYS_THUMB_BUILD=y -- 2.26.2
Marek,
Perhaps I didn't test the property test before as I did not realize there was a config to be enabled.
Enabling CONFIG_LTO breaks linking the SPL (linking uboot is fine): LTO spl/u-boot-spl make[2]: *** read jobs pipe: No such file or directory. Stop. make[2]: *** Waiting for unfinished jobs.... lto-wrapper: fatal error: make returned 2 exit status compilation terminated. /usr/src/venice/buildroot/output/host/lib/gcc/aarch64-buildroot-linux-gnu/9.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status scripts/Makefile.spl:461: recipe for target 'spl/u-boot-spl' failed make[1]: *** [spl/u-boot-spl] Error 1 Makefile:1985: recipe for target 'spl/u-boot-spl' failed make: *** [spl/u-boot-spl] Error 2
I'm using your lto branch
Best Regards,
Tim
Tim, try compiling with only one job, i.e. make -j1

On 12.03.21 18:03, Marek Behun wrote:
On Fri, 12 Mar 2021 08:34:41 -0800 Tim Harvey tharvey@gateworks.com wrote:
On Fri, Mar 12, 2021 at 5:47 AM Marek Behún marek.behun@nic.cz wrote:
Enable LTO for some boards that were tested by people on U-Boot Mailing List.
Signed-off-by: Marek Behún marek.behun@nic.cz Tested-by: Adam Ford aford173@gmail.com Tested-by: Pali Rohár pali@kernel.org Tested-by: Tim Harvey tharvey@gateworks.com
configs/am3517_evm_defconfig | 1 + configs/da850evm_defconfig | 1 + configs/da850evm_direct_nor_defconfig | 1 + configs/da850evm_nand_defconfig | 1 + configs/imx6q_logic_defconfig | 1 + configs/imx8mm_beacon_defconfig | 1 + configs/imx8mm_venice_defconfig | 1 + configs/imx8mn_beacon_2g_defconfig | 1 + configs/imx8mn_beacon_defconfig | 1 + configs/nokia_rx51_defconfig | 1 + configs/omap3_logic_defconfig | 1 + configs/r8a774a1_beacon_defconfig | 1 + configs/r8a774b1_beacon_defconfig | 1 + configs/r8a774e1_beacon_defconfig | 1 + configs/turris_mox_defconfig | 1 + configs/turris_omnia_defconfig | 1 + 16 files changed, 16 insertions(+)
diff --git a/configs/am3517_evm_defconfig b/configs/am3517_evm_defconfig index bae0e0af35..d61eec94a4 100644 --- a/configs/am3517_evm_defconfig +++ b/configs/am3517_evm_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SPL_USE_ARCH_MEMCPY is not set # CONFIG_SPL_USE_ARCH_MEMSET is not set diff --git a/configs/da850evm_defconfig b/configs/da850evm_defconfig index 26e76a2929..6ff5e21bc6 100644 --- a/configs/da850evm_defconfig +++ b/configs/da850evm_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=y diff --git a/configs/da850evm_direct_nor_defconfig b/configs/da850evm_direct_nor_defconfig index d3860a963d..06c7ce7c47 100644 --- a/configs/da850evm_direct_nor_defconfig +++ b/configs/da850evm_direct_nor_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_DAVINCI=y diff --git a/configs/da850evm_nand_defconfig b/configs/da850evm_nand_defconfig index 0d0e9a148d..be737564e1 100644 --- a/configs/da850evm_nand_defconfig +++ b/configs/da850evm_nand_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=y diff --git a/configs/imx6q_logic_defconfig b/configs/imx6q_logic_defconfig index 36dc24d080..0f8aea6983 100644 --- a/configs/imx6q_logic_defconfig +++ b/configs/imx6q_logic_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_MX6=y CONFIG_SYS_TEXT_BASE=0x17800000 diff --git a/configs/imx8mm_beacon_defconfig b/configs/imx8mm_beacon_defconfig index 045b19f4f3..e8bb44eea6 100644 --- a/configs/imx8mm_beacon_defconfig +++ b/configs/imx8mm_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/imx8mm_venice_defconfig b/configs/imx8mm_venice_defconfig index a15c3641f6..dff8f64540 100644 --- a/configs/imx8mm_venice_defconfig +++ b/configs/imx8mm_venice_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/imx8mn_beacon_2g_defconfig b/configs/imx8mn_beacon_2g_defconfig index 58b8e49486..1c8cbc2c89 100644 --- a/configs/imx8mn_beacon_2g_defconfig +++ b/configs/imx8mn_beacon_2g_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/imx8mn_beacon_defconfig b/configs/imx8mn_beacon_defconfig index d6a3385d8d..6457b9409a 100644 --- a/configs/imx8mn_beacon_defconfig +++ b/configs/imx8mn_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/nokia_rx51_defconfig b/configs/nokia_rx51_defconfig index 312ca3a1a9..85ca627790 100644 --- a/configs/nokia_rx51_defconfig +++ b/configs/nokia_rx51_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SYS_THUMB_BUILD is not set CONFIG_ARCH_OMAP2PLUS=y diff --git a/configs/omap3_logic_defconfig b/configs/omap3_logic_defconfig index 4e37237b86..cc4b727a2c 100644 --- a/configs/omap3_logic_defconfig +++ b/configs/omap3_logic_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SPL_USE_ARCH_MEMCPY is not set # CONFIG_SPL_USE_ARCH_MEMSET is not set diff --git a/configs/r8a774a1_beacon_defconfig b/configs/r8a774a1_beacon_defconfig index 2f45edd92e..9dd5d9192e 100644 --- a/configs/r8a774a1_beacon_defconfig +++ b/configs/r8a774a1_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000 diff --git a/configs/r8a774b1_beacon_defconfig b/configs/r8a774b1_beacon_defconfig index ca514bb1aa..b7d7f23f5a 100644 --- a/configs/r8a774b1_beacon_defconfig +++ b/configs/r8a774b1_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000 diff --git a/configs/r8a774e1_beacon_defconfig b/configs/r8a774e1_beacon_defconfig index b89729d92a..3e44edf29f 100644 --- a/configs/r8a774e1_beacon_defconfig +++ b/configs/r8a774e1_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000 diff --git a/configs/turris_mox_defconfig b/configs/turris_mox_defconfig index f938fbb475..2a351d9180 100644 --- a/configs/turris_mox_defconfig +++ b/configs/turris_mox_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_MVEBU=y diff --git a/configs/turris_omnia_defconfig b/configs/turris_omnia_defconfig index 4b8843d7be..d7a2ec3592 100644 --- a/configs/turris_omnia_defconfig +++ b/configs/turris_omnia_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y>>> CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_SPL_SYS_THUMB_BUILD=y -- 2.26.2
Marek,
Perhaps I didn't test the property test before as I did not realize there was a config to be enabled.
Enabling CONFIG_LTO breaks linking the SPL (linking uboot is fine): LTO spl/u-boot-spl make[2]: *** read jobs pipe: No such file or directory. Stop. make[2]: *** Waiting for unfinished jobs.... lto-wrapper: fatal error: make returned 2 exit status compilation terminated. /usr/src/venice/buildroot/output/host/lib/gcc/aarch64-buildroot-linux-gnu/9.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status scripts/Makefile.spl:461: recipe for target 'spl/u-boot-spl' failed make[1]: *** [spl/u-boot-spl] Error 1 Makefile:1985: recipe for target 'spl/u-boot-spl' failed make: *** [spl/u-boot-spl] Error 2
I'm using your lto branch
Best Regards,
Tim
Tim, try compiling with only one job, i.e. make -j1
If parallel build fails, we have a bug in the Makefile. It worked fine without the LTO patches.
The problem needs to be fixed before merging your series.
Best regards
Heinrich

On Fri, 12 Mar 2021 18:19:08 +0100 Heinrich Schuchardt xypron.glpk@gmx.de wrote:
On 12.03.21 18:03, Marek Behun wrote:
On Fri, 12 Mar 2021 08:34:41 -0800 Tim Harvey tharvey@gateworks.com wrote:
On Fri, Mar 12, 2021 at 5:47 AM Marek Behún marek.behun@nic.cz wrote:
Enable LTO for some boards that were tested by people on U-Boot Mailing List.
Signed-off-by: Marek Behún marek.behun@nic.cz Tested-by: Adam Ford aford173@gmail.com Tested-by: Pali Rohár pali@kernel.org Tested-by: Tim Harvey tharvey@gateworks.com
configs/am3517_evm_defconfig | 1 + configs/da850evm_defconfig | 1 + configs/da850evm_direct_nor_defconfig | 1 + configs/da850evm_nand_defconfig | 1 + configs/imx6q_logic_defconfig | 1 + configs/imx8mm_beacon_defconfig | 1 + configs/imx8mm_venice_defconfig | 1 + configs/imx8mn_beacon_2g_defconfig | 1 + configs/imx8mn_beacon_defconfig | 1 + configs/nokia_rx51_defconfig | 1 + configs/omap3_logic_defconfig | 1 + configs/r8a774a1_beacon_defconfig | 1 + configs/r8a774b1_beacon_defconfig | 1 + configs/r8a774e1_beacon_defconfig | 1 + configs/turris_mox_defconfig | 1 + configs/turris_omnia_defconfig | 1 + 16 files changed, 16 insertions(+)
diff --git a/configs/am3517_evm_defconfig b/configs/am3517_evm_defconfig index bae0e0af35..d61eec94a4 100644 --- a/configs/am3517_evm_defconfig +++ b/configs/am3517_evm_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SPL_USE_ARCH_MEMCPY is not set # CONFIG_SPL_USE_ARCH_MEMSET is not set diff --git a/configs/da850evm_defconfig b/configs/da850evm_defconfig index 26e76a2929..6ff5e21bc6 100644 --- a/configs/da850evm_defconfig +++ b/configs/da850evm_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=y diff --git a/configs/da850evm_direct_nor_defconfig b/configs/da850evm_direct_nor_defconfig index d3860a963d..06c7ce7c47 100644 --- a/configs/da850evm_direct_nor_defconfig +++ b/configs/da850evm_direct_nor_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_DAVINCI=y diff --git a/configs/da850evm_nand_defconfig b/configs/da850evm_nand_defconfig index 0d0e9a148d..be737564e1 100644 --- a/configs/da850evm_nand_defconfig +++ b/configs/da850evm_nand_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=y diff --git a/configs/imx6q_logic_defconfig b/configs/imx6q_logic_defconfig index 36dc24d080..0f8aea6983 100644 --- a/configs/imx6q_logic_defconfig +++ b/configs/imx6q_logic_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_MX6=y CONFIG_SYS_TEXT_BASE=0x17800000 diff --git a/configs/imx8mm_beacon_defconfig b/configs/imx8mm_beacon_defconfig index 045b19f4f3..e8bb44eea6 100644 --- a/configs/imx8mm_beacon_defconfig +++ b/configs/imx8mm_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/imx8mm_venice_defconfig b/configs/imx8mm_venice_defconfig index a15c3641f6..dff8f64540 100644 --- a/configs/imx8mm_venice_defconfig +++ b/configs/imx8mm_venice_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/imx8mn_beacon_2g_defconfig b/configs/imx8mn_beacon_2g_defconfig index 58b8e49486..1c8cbc2c89 100644 --- a/configs/imx8mn_beacon_2g_defconfig +++ b/configs/imx8mn_beacon_2g_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/imx8mn_beacon_defconfig b/configs/imx8mn_beacon_defconfig index d6a3385d8d..6457b9409a 100644 --- a/configs/imx8mn_beacon_defconfig +++ b/configs/imx8mn_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/nokia_rx51_defconfig b/configs/nokia_rx51_defconfig index 312ca3a1a9..85ca627790 100644 --- a/configs/nokia_rx51_defconfig +++ b/configs/nokia_rx51_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SYS_THUMB_BUILD is not set CONFIG_ARCH_OMAP2PLUS=y diff --git a/configs/omap3_logic_defconfig b/configs/omap3_logic_defconfig index 4e37237b86..cc4b727a2c 100644 --- a/configs/omap3_logic_defconfig +++ b/configs/omap3_logic_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SPL_USE_ARCH_MEMCPY is not set # CONFIG_SPL_USE_ARCH_MEMSET is not set diff --git a/configs/r8a774a1_beacon_defconfig b/configs/r8a774a1_beacon_defconfig index 2f45edd92e..9dd5d9192e 100644 --- a/configs/r8a774a1_beacon_defconfig +++ b/configs/r8a774a1_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000 diff --git a/configs/r8a774b1_beacon_defconfig b/configs/r8a774b1_beacon_defconfig index ca514bb1aa..b7d7f23f5a 100644 --- a/configs/r8a774b1_beacon_defconfig +++ b/configs/r8a774b1_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000 diff --git a/configs/r8a774e1_beacon_defconfig b/configs/r8a774e1_beacon_defconfig index b89729d92a..3e44edf29f 100644 --- a/configs/r8a774e1_beacon_defconfig +++ b/configs/r8a774e1_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000 diff --git a/configs/turris_mox_defconfig b/configs/turris_mox_defconfig index f938fbb475..2a351d9180 100644 --- a/configs/turris_mox_defconfig +++ b/configs/turris_mox_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_MVEBU=y diff --git a/configs/turris_omnia_defconfig b/configs/turris_omnia_defconfig index 4b8843d7be..d7a2ec3592 100644 --- a/configs/turris_omnia_defconfig +++ b/configs/turris_omnia_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y>>> CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_SPL_SYS_THUMB_BUILD=y -- 2.26.2
Marek,
Perhaps I didn't test the property test before as I did not realize there was a config to be enabled.
Enabling CONFIG_LTO breaks linking the SPL (linking uboot is fine): LTO spl/u-boot-spl make[2]: *** read jobs pipe: No such file or directory. Stop. make[2]: *** Waiting for unfinished jobs.... lto-wrapper: fatal error: make returned 2 exit status compilation terminated. /usr/src/venice/buildroot/output/host/lib/gcc/aarch64-buildroot-linux-gnu/9.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status scripts/Makefile.spl:461: recipe for target 'spl/u-boot-spl' failed make[1]: *** [spl/u-boot-spl] Error 1 Makefile:1985: recipe for target 'spl/u-boot-spl' failed make: *** [spl/u-boot-spl] Error 2
I'm using your lto branch
Best Regards,
Tim
Tim, try compiling with only one job, i.e. make -j1
If parallel build fails, we have a bug in the Makefile. It worked fine without the LTO patches.
It may be a problem with GNU make's jobserver. Tom mentioned that there is a known race condition or something...
If only there was a simple way to discover inside the Makefile the number of jobs given to the make command via the -j parameter, we could use -flto=$(JOBS).
I found this https://blog.jgc.org/2015/03/gnu-make-insanity-finding-value-of-j.html
Marek

On Fri, Mar 12, 2021 at 9:36 AM Marek Behun marek.behun@nic.cz wrote:
On Fri, 12 Mar 2021 18:19:08 +0100 Heinrich Schuchardt xypron.glpk@gmx.de wrote:
On 12.03.21 18:03, Marek Behun wrote:
On Fri, 12 Mar 2021 08:34:41 -0800 Tim Harvey tharvey@gateworks.com wrote:
On Fri, Mar 12, 2021 at 5:47 AM Marek Behún marek.behun@nic.cz wrote:
Enable LTO for some boards that were tested by people on U-Boot Mailing List.
Signed-off-by: Marek Behún marek.behun@nic.cz Tested-by: Adam Ford aford173@gmail.com Tested-by: Pali Rohár pali@kernel.org Tested-by: Tim Harvey tharvey@gateworks.com
configs/am3517_evm_defconfig | 1 + configs/da850evm_defconfig | 1 + configs/da850evm_direct_nor_defconfig | 1 + configs/da850evm_nand_defconfig | 1 + configs/imx6q_logic_defconfig | 1 + configs/imx8mm_beacon_defconfig | 1 + configs/imx8mm_venice_defconfig | 1 + configs/imx8mn_beacon_2g_defconfig | 1 + configs/imx8mn_beacon_defconfig | 1 + configs/nokia_rx51_defconfig | 1 + configs/omap3_logic_defconfig | 1 + configs/r8a774a1_beacon_defconfig | 1 + configs/r8a774b1_beacon_defconfig | 1 + configs/r8a774e1_beacon_defconfig | 1 + configs/turris_mox_defconfig | 1 + configs/turris_omnia_defconfig | 1 + 16 files changed, 16 insertions(+)
diff --git a/configs/am3517_evm_defconfig b/configs/am3517_evm_defconfig index bae0e0af35..d61eec94a4 100644 --- a/configs/am3517_evm_defconfig +++ b/configs/am3517_evm_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SPL_USE_ARCH_MEMCPY is not set # CONFIG_SPL_USE_ARCH_MEMSET is not set diff --git a/configs/da850evm_defconfig b/configs/da850evm_defconfig index 26e76a2929..6ff5e21bc6 100644 --- a/configs/da850evm_defconfig +++ b/configs/da850evm_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=y diff --git a/configs/da850evm_direct_nor_defconfig b/configs/da850evm_direct_nor_defconfig index d3860a963d..06c7ce7c47 100644 --- a/configs/da850evm_direct_nor_defconfig +++ b/configs/da850evm_direct_nor_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_DAVINCI=y diff --git a/configs/da850evm_nand_defconfig b/configs/da850evm_nand_defconfig index 0d0e9a148d..be737564e1 100644 --- a/configs/da850evm_nand_defconfig +++ b/configs/da850evm_nand_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=y diff --git a/configs/imx6q_logic_defconfig b/configs/imx6q_logic_defconfig index 36dc24d080..0f8aea6983 100644 --- a/configs/imx6q_logic_defconfig +++ b/configs/imx6q_logic_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_MX6=y CONFIG_SYS_TEXT_BASE=0x17800000 diff --git a/configs/imx8mm_beacon_defconfig b/configs/imx8mm_beacon_defconfig index 045b19f4f3..e8bb44eea6 100644 --- a/configs/imx8mm_beacon_defconfig +++ b/configs/imx8mm_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/imx8mm_venice_defconfig b/configs/imx8mm_venice_defconfig index a15c3641f6..dff8f64540 100644 --- a/configs/imx8mm_venice_defconfig +++ b/configs/imx8mm_venice_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/imx8mn_beacon_2g_defconfig b/configs/imx8mn_beacon_2g_defconfig index 58b8e49486..1c8cbc2c89 100644 --- a/configs/imx8mn_beacon_2g_defconfig +++ b/configs/imx8mn_beacon_2g_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/imx8mn_beacon_defconfig b/configs/imx8mn_beacon_defconfig index d6a3385d8d..6457b9409a 100644 --- a/configs/imx8mn_beacon_defconfig +++ b/configs/imx8mn_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/nokia_rx51_defconfig b/configs/nokia_rx51_defconfig index 312ca3a1a9..85ca627790 100644 --- a/configs/nokia_rx51_defconfig +++ b/configs/nokia_rx51_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SYS_THUMB_BUILD is not set CONFIG_ARCH_OMAP2PLUS=y diff --git a/configs/omap3_logic_defconfig b/configs/omap3_logic_defconfig index 4e37237b86..cc4b727a2c 100644 --- a/configs/omap3_logic_defconfig +++ b/configs/omap3_logic_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SPL_USE_ARCH_MEMCPY is not set # CONFIG_SPL_USE_ARCH_MEMSET is not set diff --git a/configs/r8a774a1_beacon_defconfig b/configs/r8a774a1_beacon_defconfig index 2f45edd92e..9dd5d9192e 100644 --- a/configs/r8a774a1_beacon_defconfig +++ b/configs/r8a774a1_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000 diff --git a/configs/r8a774b1_beacon_defconfig b/configs/r8a774b1_beacon_defconfig index ca514bb1aa..b7d7f23f5a 100644 --- a/configs/r8a774b1_beacon_defconfig +++ b/configs/r8a774b1_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000 diff --git a/configs/r8a774e1_beacon_defconfig b/configs/r8a774e1_beacon_defconfig index b89729d92a..3e44edf29f 100644 --- a/configs/r8a774e1_beacon_defconfig +++ b/configs/r8a774e1_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000 diff --git a/configs/turris_mox_defconfig b/configs/turris_mox_defconfig index f938fbb475..2a351d9180 100644 --- a/configs/turris_mox_defconfig +++ b/configs/turris_mox_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_MVEBU=y diff --git a/configs/turris_omnia_defconfig b/configs/turris_omnia_defconfig index 4b8843d7be..d7a2ec3592 100644 --- a/configs/turris_omnia_defconfig +++ b/configs/turris_omnia_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y>>> CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_SPL_SYS_THUMB_BUILD=y -- 2.26.2
Marek,
Perhaps I didn't test the property test before as I did not realize there was a config to be enabled.
Enabling CONFIG_LTO breaks linking the SPL (linking uboot is fine): LTO spl/u-boot-spl make[2]: *** read jobs pipe: No such file or directory. Stop. make[2]: *** Waiting for unfinished jobs.... lto-wrapper: fatal error: make returned 2 exit status compilation terminated. /usr/src/venice/buildroot/output/host/lib/gcc/aarch64-buildroot-linux-gnu/9.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status scripts/Makefile.spl:461: recipe for target 'spl/u-boot-spl' failed make[1]: *** [spl/u-boot-spl] Error 1 Makefile:1985: recipe for target 'spl/u-boot-spl' failed make: *** [spl/u-boot-spl] Error 2
I'm using your lto branch
Best Regards,
Tim
Tim, try compiling with only one job, i.e. make -j1
If parallel build fails, we have a bug in the Makefile. It worked fine without the LTO patches.
It may be a problem with GNU make's jobserver. Tom mentioned that there is a known race condition or something...
If only there was a simple way to discover inside the Makefile the number of jobs given to the make command via the -j parameter, we could use -flto=$(JOBS).
I found this https://blog.jgc.org/2015/03/gnu-make-insanity-finding-value-of-j.html
Marek
Marek / Heinrich,
Yes, 'make -j1' does work.
Tim

On Fri, 12 Mar 2021 10:01:34 -0800 Tim Harvey tharvey@gateworks.com wrote:
Marek / Heinrich,
Yes, 'make -j1' does work.
Tim
Tim, could you try make -j8, but change the toplevel Makefile: find string "-flto=jobserver" and change it to "-flto".
Does make -j8 fail then?
Thank you.
Marek

On Mon, Mar 15, 2021 at 3:44 PM Marek Behun marek.behun@nic.cz wrote:
On Fri, 12 Mar 2021 10:01:34 -0800 Tim Harvey tharvey@gateworks.com wrote:
Marek / Heinrich,
Yes, 'make -j1' does work.
Tim
Tim, could you try make -j8, but change the toplevel Makefile: find string "-flto=jobserver" and change it to "-flto".
Does make -j8 fail then?
Thank you.
Marek,
diff --git a/Makefile b/Makefile index 9518ba4a32..20b27e6dd5 100644 --- a/Makefile +++ b/Makefile @@ -688,7 +688,7 @@ ifdef CONFIG_LTO ifeq ($(cc-name),clang) LTO_FINAL_LDFLAGS += -flto else - LTO_FINAL_LDFLAGS += -fuse-linker-plugin -flto=jobserver + LTO_FINAL_LDFLAGS += -fuse-linker-plugin -flto
# use plugin aware tools AR = $(CROSS_COMPILE)gcc-ar
make distclean imx8mm_venice_defconfig make -j8 flash.bin
This now builds but the LTO steps do take noticeably several seconds longer than without LTO (13 seconds without CONFIG_LTO vs 23 seconds with) which is a bummer for development workflow.
You can of course play with building this as well... if you need me to boot test something I can do that for you (and this does boot just fine).
Best regards,
Tim

On Fri, Mar 12, 2021 at 06:36:05PM +0100, Marek Behun wrote:
On Fri, 12 Mar 2021 18:19:08 +0100 Heinrich Schuchardt xypron.glpk@gmx.de wrote:
On 12.03.21 18:03, Marek Behun wrote:
On Fri, 12 Mar 2021 08:34:41 -0800 Tim Harvey tharvey@gateworks.com wrote:
On Fri, Mar 12, 2021 at 5:47 AM Marek Behún marek.behun@nic.cz wrote:
Enable LTO for some boards that were tested by people on U-Boot Mailing List.
Signed-off-by: Marek Behún marek.behun@nic.cz Tested-by: Adam Ford aford173@gmail.com Tested-by: Pali Rohár pali@kernel.org Tested-by: Tim Harvey tharvey@gateworks.com
configs/am3517_evm_defconfig | 1 + configs/da850evm_defconfig | 1 + configs/da850evm_direct_nor_defconfig | 1 + configs/da850evm_nand_defconfig | 1 + configs/imx6q_logic_defconfig | 1 + configs/imx8mm_beacon_defconfig | 1 + configs/imx8mm_venice_defconfig | 1 + configs/imx8mn_beacon_2g_defconfig | 1 + configs/imx8mn_beacon_defconfig | 1 + configs/nokia_rx51_defconfig | 1 + configs/omap3_logic_defconfig | 1 + configs/r8a774a1_beacon_defconfig | 1 + configs/r8a774b1_beacon_defconfig | 1 + configs/r8a774e1_beacon_defconfig | 1 + configs/turris_mox_defconfig | 1 + configs/turris_omnia_defconfig | 1 + 16 files changed, 16 insertions(+)
diff --git a/configs/am3517_evm_defconfig b/configs/am3517_evm_defconfig index bae0e0af35..d61eec94a4 100644 --- a/configs/am3517_evm_defconfig +++ b/configs/am3517_evm_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SPL_USE_ARCH_MEMCPY is not set # CONFIG_SPL_USE_ARCH_MEMSET is not set diff --git a/configs/da850evm_defconfig b/configs/da850evm_defconfig index 26e76a2929..6ff5e21bc6 100644 --- a/configs/da850evm_defconfig +++ b/configs/da850evm_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=y diff --git a/configs/da850evm_direct_nor_defconfig b/configs/da850evm_direct_nor_defconfig index d3860a963d..06c7ce7c47 100644 --- a/configs/da850evm_direct_nor_defconfig +++ b/configs/da850evm_direct_nor_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_DAVINCI=y diff --git a/configs/da850evm_nand_defconfig b/configs/da850evm_nand_defconfig index 0d0e9a148d..be737564e1 100644 --- a/configs/da850evm_nand_defconfig +++ b/configs/da850evm_nand_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=y diff --git a/configs/imx6q_logic_defconfig b/configs/imx6q_logic_defconfig index 36dc24d080..0f8aea6983 100644 --- a/configs/imx6q_logic_defconfig +++ b/configs/imx6q_logic_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_MX6=y CONFIG_SYS_TEXT_BASE=0x17800000 diff --git a/configs/imx8mm_beacon_defconfig b/configs/imx8mm_beacon_defconfig index 045b19f4f3..e8bb44eea6 100644 --- a/configs/imx8mm_beacon_defconfig +++ b/configs/imx8mm_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/imx8mm_venice_defconfig b/configs/imx8mm_venice_defconfig index a15c3641f6..dff8f64540 100644 --- a/configs/imx8mm_venice_defconfig +++ b/configs/imx8mm_venice_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/imx8mn_beacon_2g_defconfig b/configs/imx8mn_beacon_2g_defconfig index 58b8e49486..1c8cbc2c89 100644 --- a/configs/imx8mn_beacon_2g_defconfig +++ b/configs/imx8mn_beacon_2g_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/imx8mn_beacon_defconfig b/configs/imx8mn_beacon_defconfig index d6a3385d8d..6457b9409a 100644 --- a/configs/imx8mn_beacon_defconfig +++ b/configs/imx8mn_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/nokia_rx51_defconfig b/configs/nokia_rx51_defconfig index 312ca3a1a9..85ca627790 100644 --- a/configs/nokia_rx51_defconfig +++ b/configs/nokia_rx51_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SYS_THUMB_BUILD is not set CONFIG_ARCH_OMAP2PLUS=y diff --git a/configs/omap3_logic_defconfig b/configs/omap3_logic_defconfig index 4e37237b86..cc4b727a2c 100644 --- a/configs/omap3_logic_defconfig +++ b/configs/omap3_logic_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SPL_USE_ARCH_MEMCPY is not set # CONFIG_SPL_USE_ARCH_MEMSET is not set diff --git a/configs/r8a774a1_beacon_defconfig b/configs/r8a774a1_beacon_defconfig index 2f45edd92e..9dd5d9192e 100644 --- a/configs/r8a774a1_beacon_defconfig +++ b/configs/r8a774a1_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000 diff --git a/configs/r8a774b1_beacon_defconfig b/configs/r8a774b1_beacon_defconfig index ca514bb1aa..b7d7f23f5a 100644 --- a/configs/r8a774b1_beacon_defconfig +++ b/configs/r8a774b1_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000 diff --git a/configs/r8a774e1_beacon_defconfig b/configs/r8a774e1_beacon_defconfig index b89729d92a..3e44edf29f 100644 --- a/configs/r8a774e1_beacon_defconfig +++ b/configs/r8a774e1_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000 diff --git a/configs/turris_mox_defconfig b/configs/turris_mox_defconfig index f938fbb475..2a351d9180 100644 --- a/configs/turris_mox_defconfig +++ b/configs/turris_mox_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_MVEBU=y diff --git a/configs/turris_omnia_defconfig b/configs/turris_omnia_defconfig index 4b8843d7be..d7a2ec3592 100644 --- a/configs/turris_omnia_defconfig +++ b/configs/turris_omnia_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y>>> CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_SPL_SYS_THUMB_BUILD=y -- 2.26.2
Marek,
Perhaps I didn't test the property test before as I did not realize there was a config to be enabled.
Enabling CONFIG_LTO breaks linking the SPL (linking uboot is fine): LTO spl/u-boot-spl make[2]: *** read jobs pipe: No such file or directory. Stop. make[2]: *** Waiting for unfinished jobs.... lto-wrapper: fatal error: make returned 2 exit status compilation terminated. /usr/src/venice/buildroot/output/host/lib/gcc/aarch64-buildroot-linux-gnu/9.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status scripts/Makefile.spl:461: recipe for target 'spl/u-boot-spl' failed make[1]: *** [spl/u-boot-spl] Error 1 Makefile:1985: recipe for target 'spl/u-boot-spl' failed make: *** [spl/u-boot-spl] Error 2
I'm using your lto branch
Best Regards,
Tim
Tim, try compiling with only one job, i.e. make -j1
If parallel build fails, we have a bug in the Makefile. It worked fine without the LTO patches.
It may be a problem with GNU make's jobserver. Tom mentioned that there is a known race condition or something...
I was unclear at the time, sorry. Yes, it sounds like there's some race condition these patches are adding that needs to be addressed. By the nature of race condition they aren't always easy to trigger, but we can't just ignore them if CI doesn't trip on it every time.
If only there was a simple way to discover inside the Makefile the number of jobs given to the make command via the -j parameter, we could use -flto=$(JOBS).
I found this https://blog.jgc.org/2015/03/gnu-make-insanity-finding-value-of-j.html
Well, how is this being done in the Linux kernel? Or maybe, sigh, this isn't a problem with Clang's LTO which is what is in mainline Linux kernel atm. Maybe https://lore.kernel.org/patchwork/project/lkml/list/?series=463749&state... will have some clues, all the same.

On Fri, 12 Mar 2021 15:47:12 -0500 Tom Rini trini@konsulko.com wrote:
On Fri, Mar 12, 2021 at 06:36:05PM +0100, Marek Behun wrote:
On Fri, 12 Mar 2021 18:19:08 +0100 Heinrich Schuchardt xypron.glpk@gmx.de wrote:
On 12.03.21 18:03, Marek Behun wrote:
On Fri, 12 Mar 2021 08:34:41 -0800 Tim Harvey tharvey@gateworks.com wrote:
On Fri, Mar 12, 2021 at 5:47 AM Marek Behún marek.behun@nic.cz wrote:
Enable LTO for some boards that were tested by people on U-Boot Mailing List.
Signed-off-by: Marek Behún marek.behun@nic.cz Tested-by: Adam Ford aford173@gmail.com Tested-by: Pali Rohár pali@kernel.org Tested-by: Tim Harvey tharvey@gateworks.com
configs/am3517_evm_defconfig | 1 + configs/da850evm_defconfig | 1 + configs/da850evm_direct_nor_defconfig | 1 + configs/da850evm_nand_defconfig | 1 + configs/imx6q_logic_defconfig | 1 + configs/imx8mm_beacon_defconfig | 1 + configs/imx8mm_venice_defconfig | 1 + configs/imx8mn_beacon_2g_defconfig | 1 + configs/imx8mn_beacon_defconfig | 1 + configs/nokia_rx51_defconfig | 1 + configs/omap3_logic_defconfig | 1 + configs/r8a774a1_beacon_defconfig | 1 + configs/r8a774b1_beacon_defconfig | 1 + configs/r8a774e1_beacon_defconfig | 1 + configs/turris_mox_defconfig | 1 + configs/turris_omnia_defconfig | 1 + 16 files changed, 16 insertions(+)
diff --git a/configs/am3517_evm_defconfig b/configs/am3517_evm_defconfig index bae0e0af35..d61eec94a4 100644 --- a/configs/am3517_evm_defconfig +++ b/configs/am3517_evm_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SPL_USE_ARCH_MEMCPY is not set # CONFIG_SPL_USE_ARCH_MEMSET is not set diff --git a/configs/da850evm_defconfig b/configs/da850evm_defconfig index 26e76a2929..6ff5e21bc6 100644 --- a/configs/da850evm_defconfig +++ b/configs/da850evm_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=y diff --git a/configs/da850evm_direct_nor_defconfig b/configs/da850evm_direct_nor_defconfig index d3860a963d..06c7ce7c47 100644 --- a/configs/da850evm_direct_nor_defconfig +++ b/configs/da850evm_direct_nor_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_DAVINCI=y diff --git a/configs/da850evm_nand_defconfig b/configs/da850evm_nand_defconfig index 0d0e9a148d..be737564e1 100644 --- a/configs/da850evm_nand_defconfig +++ b/configs/da850evm_nand_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=y diff --git a/configs/imx6q_logic_defconfig b/configs/imx6q_logic_defconfig index 36dc24d080..0f8aea6983 100644 --- a/configs/imx6q_logic_defconfig +++ b/configs/imx6q_logic_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_MX6=y CONFIG_SYS_TEXT_BASE=0x17800000 diff --git a/configs/imx8mm_beacon_defconfig b/configs/imx8mm_beacon_defconfig index 045b19f4f3..e8bb44eea6 100644 --- a/configs/imx8mm_beacon_defconfig +++ b/configs/imx8mm_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/imx8mm_venice_defconfig b/configs/imx8mm_venice_defconfig index a15c3641f6..dff8f64540 100644 --- a/configs/imx8mm_venice_defconfig +++ b/configs/imx8mm_venice_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/imx8mn_beacon_2g_defconfig b/configs/imx8mn_beacon_2g_defconfig index 58b8e49486..1c8cbc2c89 100644 --- a/configs/imx8mn_beacon_2g_defconfig +++ b/configs/imx8mn_beacon_2g_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/imx8mn_beacon_defconfig b/configs/imx8mn_beacon_defconfig index d6a3385d8d..6457b9409a 100644 --- a/configs/imx8mn_beacon_defconfig +++ b/configs/imx8mn_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000 diff --git a/configs/nokia_rx51_defconfig b/configs/nokia_rx51_defconfig index 312ca3a1a9..85ca627790 100644 --- a/configs/nokia_rx51_defconfig +++ b/configs/nokia_rx51_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SYS_THUMB_BUILD is not set CONFIG_ARCH_OMAP2PLUS=y diff --git a/configs/omap3_logic_defconfig b/configs/omap3_logic_defconfig index 4e37237b86..cc4b727a2c 100644 --- a/configs/omap3_logic_defconfig +++ b/configs/omap3_logic_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SPL_USE_ARCH_MEMCPY is not set # CONFIG_SPL_USE_ARCH_MEMSET is not set diff --git a/configs/r8a774a1_beacon_defconfig b/configs/r8a774a1_beacon_defconfig index 2f45edd92e..9dd5d9192e 100644 --- a/configs/r8a774a1_beacon_defconfig +++ b/configs/r8a774a1_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000 diff --git a/configs/r8a774b1_beacon_defconfig b/configs/r8a774b1_beacon_defconfig index ca514bb1aa..b7d7f23f5a 100644 --- a/configs/r8a774b1_beacon_defconfig +++ b/configs/r8a774b1_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000 diff --git a/configs/r8a774e1_beacon_defconfig b/configs/r8a774e1_beacon_defconfig index b89729d92a..3e44edf29f 100644 --- a/configs/r8a774e1_beacon_defconfig +++ b/configs/r8a774e1_beacon_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000 diff --git a/configs/turris_mox_defconfig b/configs/turris_mox_defconfig index f938fbb475..2a351d9180 100644 --- a/configs/turris_mox_defconfig +++ b/configs/turris_mox_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_MVEBU=y diff --git a/configs/turris_omnia_defconfig b/configs/turris_omnia_defconfig index 4b8843d7be..d7a2ec3592 100644 --- a/configs/turris_omnia_defconfig +++ b/configs/turris_omnia_defconfig @@ -1,3 +1,4 @@ +CONFIG_LTO=y>>> CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_SPL_SYS_THUMB_BUILD=y -- 2.26.2
Marek,
Perhaps I didn't test the property test before as I did not realize there was a config to be enabled.
Enabling CONFIG_LTO breaks linking the SPL (linking uboot is fine): LTO spl/u-boot-spl make[2]: *** read jobs pipe: No such file or directory. Stop. make[2]: *** Waiting for unfinished jobs.... lto-wrapper: fatal error: make returned 2 exit status compilation terminated. /usr/src/venice/buildroot/output/host/lib/gcc/aarch64-buildroot-linux-gnu/9.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status scripts/Makefile.spl:461: recipe for target 'spl/u-boot-spl' failed make[1]: *** [spl/u-boot-spl] Error 1 Makefile:1985: recipe for target 'spl/u-boot-spl' failed make: *** [spl/u-boot-spl] Error 2
I'm using your lto branch
Best Regards,
Tim
Tim, try compiling with only one job, i.e. make -j1
If parallel build fails, we have a bug in the Makefile. It worked fine without the LTO patches.
It may be a problem with GNU make's jobserver. Tom mentioned that there is a known race condition or something...
I was unclear at the time, sorry. Yes, it sounds like there's some race condition these patches are adding that needs to be addressed. By the nature of race condition they aren't always easy to trigger, but we can't just ignore them if CI doesn't trip on it every time.
If only there was a simple way to discover inside the Makefile the number of jobs given to the make command via the -j parameter, we could use -flto=$(JOBS).
I found this https://blog.jgc.org/2015/03/gnu-make-insanity-finding-value-of-j.html
Well, how is this being done in the Linux kernel? Or maybe, sigh, this isn't a problem with Clang's LTO which is what is in mainline Linux kernel atm. Maybe https://lore.kernel.org/patchwork/project/lkml/list/?series=463749&state... will have some clues, all the same.
Tom, I fear that the only stable and sane solution now is to drop jobserver and just do -flto, i.e. in one thread. This will increase compilation time, but will work for everyone.
Another option is to do -flto=NCPUs, but that would contradict user's choice of -j option, if they chose -j1, for example.
What do you think?
Marek

On Mon, Mar 15, 2021 at 10:42:31AM +0100, Marek Behun wrote:
On Fri, 12 Mar 2021 15:47:12 -0500 Tom Rini trini@konsulko.com wrote:
On Fri, Mar 12, 2021 at 06:36:05PM +0100, Marek Behun wrote:
On Fri, 12 Mar 2021 18:19:08 +0100 Heinrich Schuchardt xypron.glpk@gmx.de wrote:
On 12.03.21 18:03, Marek Behun wrote:
On Fri, 12 Mar 2021 08:34:41 -0800 Tim Harvey tharvey@gateworks.com wrote:
On Fri, Mar 12, 2021 at 5:47 AM Marek Behún marek.behun@nic.cz wrote: > > Enable LTO for some boards that were tested by people on U-Boot Mailing > List. > > Signed-off-by: Marek Behún marek.behun@nic.cz > Tested-by: Adam Ford aford173@gmail.com > Tested-by: Pali Rohár pali@kernel.org > Tested-by: Tim Harvey tharvey@gateworks.com > --- > configs/am3517_evm_defconfig | 1 + > configs/da850evm_defconfig | 1 + > configs/da850evm_direct_nor_defconfig | 1 + > configs/da850evm_nand_defconfig | 1 + > configs/imx6q_logic_defconfig | 1 + > configs/imx8mm_beacon_defconfig | 1 + > configs/imx8mm_venice_defconfig | 1 + > configs/imx8mn_beacon_2g_defconfig | 1 + > configs/imx8mn_beacon_defconfig | 1 + > configs/nokia_rx51_defconfig | 1 + > configs/omap3_logic_defconfig | 1 + > configs/r8a774a1_beacon_defconfig | 1 + > configs/r8a774b1_beacon_defconfig | 1 + > configs/r8a774e1_beacon_defconfig | 1 + > configs/turris_mox_defconfig | 1 + > configs/turris_omnia_defconfig | 1 + > 16 files changed, 16 insertions(+) > > diff --git a/configs/am3517_evm_defconfig b/configs/am3517_evm_defconfig > index bae0e0af35..d61eec94a4 100644 > --- a/configs/am3517_evm_defconfig > +++ b/configs/am3517_evm_defconfig > @@ -1,3 +1,4 @@ > +CONFIG_LTO=y > CONFIG_ARM=y > # CONFIG_SPL_USE_ARCH_MEMCPY is not set > # CONFIG_SPL_USE_ARCH_MEMSET is not set > diff --git a/configs/da850evm_defconfig b/configs/da850evm_defconfig > index 26e76a2929..6ff5e21bc6 100644 > --- a/configs/da850evm_defconfig > +++ b/configs/da850evm_defconfig > @@ -1,3 +1,4 @@ > +CONFIG_LTO=y > CONFIG_ARM=y > CONFIG_SYS_THUMB_BUILD=y > CONFIG_ARCH_DAVINCI=y > diff --git a/configs/da850evm_direct_nor_defconfig b/configs/da850evm_direct_nor_defconfig > index d3860a963d..06c7ce7c47 100644 > --- a/configs/da850evm_direct_nor_defconfig > +++ b/configs/da850evm_direct_nor_defconfig > @@ -1,3 +1,4 @@ > +CONFIG_LTO=y > CONFIG_ARM=y > CONFIG_ARCH_CPU_INIT=y > CONFIG_ARCH_DAVINCI=y > diff --git a/configs/da850evm_nand_defconfig b/configs/da850evm_nand_defconfig > index 0d0e9a148d..be737564e1 100644 > --- a/configs/da850evm_nand_defconfig > +++ b/configs/da850evm_nand_defconfig > @@ -1,3 +1,4 @@ > +CONFIG_LTO=y > CONFIG_ARM=y > CONFIG_SYS_THUMB_BUILD=y > CONFIG_ARCH_DAVINCI=y > diff --git a/configs/imx6q_logic_defconfig b/configs/imx6q_logic_defconfig > index 36dc24d080..0f8aea6983 100644 > --- a/configs/imx6q_logic_defconfig > +++ b/configs/imx6q_logic_defconfig > @@ -1,3 +1,4 @@ > +CONFIG_LTO=y > CONFIG_ARM=y > CONFIG_ARCH_MX6=y > CONFIG_SYS_TEXT_BASE=0x17800000 > diff --git a/configs/imx8mm_beacon_defconfig b/configs/imx8mm_beacon_defconfig > index 045b19f4f3..e8bb44eea6 100644 > --- a/configs/imx8mm_beacon_defconfig > +++ b/configs/imx8mm_beacon_defconfig > @@ -1,3 +1,4 @@ > +CONFIG_LTO=y > CONFIG_ARM=y > CONFIG_ARCH_IMX8M=y > CONFIG_SYS_TEXT_BASE=0x40200000 > diff --git a/configs/imx8mm_venice_defconfig b/configs/imx8mm_venice_defconfig > index a15c3641f6..dff8f64540 100644 > --- a/configs/imx8mm_venice_defconfig > +++ b/configs/imx8mm_venice_defconfig > @@ -1,3 +1,4 @@ > +CONFIG_LTO=y > CONFIG_ARM=y > CONFIG_ARCH_IMX8M=y > CONFIG_SYS_TEXT_BASE=0x40200000 > diff --git a/configs/imx8mn_beacon_2g_defconfig b/configs/imx8mn_beacon_2g_defconfig > index 58b8e49486..1c8cbc2c89 100644 > --- a/configs/imx8mn_beacon_2g_defconfig > +++ b/configs/imx8mn_beacon_2g_defconfig > @@ -1,3 +1,4 @@ > +CONFIG_LTO=y > CONFIG_ARM=y > CONFIG_ARCH_IMX8M=y > CONFIG_SYS_TEXT_BASE=0x40200000 > diff --git a/configs/imx8mn_beacon_defconfig b/configs/imx8mn_beacon_defconfig > index d6a3385d8d..6457b9409a 100644 > --- a/configs/imx8mn_beacon_defconfig > +++ b/configs/imx8mn_beacon_defconfig > @@ -1,3 +1,4 @@ > +CONFIG_LTO=y > CONFIG_ARM=y > CONFIG_ARCH_IMX8M=y > CONFIG_SYS_TEXT_BASE=0x40200000 > diff --git a/configs/nokia_rx51_defconfig b/configs/nokia_rx51_defconfig > index 312ca3a1a9..85ca627790 100644 > --- a/configs/nokia_rx51_defconfig > +++ b/configs/nokia_rx51_defconfig > @@ -1,3 +1,4 @@ > +CONFIG_LTO=y > CONFIG_ARM=y > # CONFIG_SYS_THUMB_BUILD is not set > CONFIG_ARCH_OMAP2PLUS=y > diff --git a/configs/omap3_logic_defconfig b/configs/omap3_logic_defconfig > index 4e37237b86..cc4b727a2c 100644 > --- a/configs/omap3_logic_defconfig > +++ b/configs/omap3_logic_defconfig > @@ -1,3 +1,4 @@ > +CONFIG_LTO=y > CONFIG_ARM=y > # CONFIG_SPL_USE_ARCH_MEMCPY is not set > # CONFIG_SPL_USE_ARCH_MEMSET is not set > diff --git a/configs/r8a774a1_beacon_defconfig b/configs/r8a774a1_beacon_defconfig > index 2f45edd92e..9dd5d9192e 100644 > --- a/configs/r8a774a1_beacon_defconfig > +++ b/configs/r8a774a1_beacon_defconfig > @@ -1,3 +1,4 @@ > +CONFIG_LTO=y > CONFIG_ARM=y > CONFIG_ARCH_RMOBILE=y > CONFIG_SYS_TEXT_BASE=0x50000000 > diff --git a/configs/r8a774b1_beacon_defconfig b/configs/r8a774b1_beacon_defconfig > index ca514bb1aa..b7d7f23f5a 100644 > --- a/configs/r8a774b1_beacon_defconfig > +++ b/configs/r8a774b1_beacon_defconfig > @@ -1,3 +1,4 @@ > +CONFIG_LTO=y > CONFIG_ARM=y > CONFIG_ARCH_RMOBILE=y > CONFIG_SYS_TEXT_BASE=0x50000000 > diff --git a/configs/r8a774e1_beacon_defconfig b/configs/r8a774e1_beacon_defconfig > index b89729d92a..3e44edf29f 100644 > --- a/configs/r8a774e1_beacon_defconfig > +++ b/configs/r8a774e1_beacon_defconfig > @@ -1,3 +1,4 @@ > +CONFIG_LTO=y > CONFIG_ARM=y > CONFIG_ARCH_RMOBILE=y > CONFIG_SYS_TEXT_BASE=0x50000000 > diff --git a/configs/turris_mox_defconfig b/configs/turris_mox_defconfig > index f938fbb475..2a351d9180 100644 > --- a/configs/turris_mox_defconfig > +++ b/configs/turris_mox_defconfig > @@ -1,3 +1,4 @@ > +CONFIG_LTO=y > CONFIG_ARM=y > CONFIG_ARCH_CPU_INIT=y > CONFIG_ARCH_MVEBU=y > diff --git a/configs/turris_omnia_defconfig b/configs/turris_omnia_defconfig > index 4b8843d7be..d7a2ec3592 100644 > --- a/configs/turris_omnia_defconfig > +++ b/configs/turris_omnia_defconfig > @@ -1,3 +1,4 @@ > +CONFIG_LTO=y>>> CONFIG_ARM=y > CONFIG_ARCH_CPU_INIT=y > CONFIG_SPL_SYS_THUMB_BUILD=y > -- > 2.26.2 >
Marek,
Perhaps I didn't test the property test before as I did not realize there was a config to be enabled.
Enabling CONFIG_LTO breaks linking the SPL (linking uboot is fine): LTO spl/u-boot-spl make[2]: *** read jobs pipe: No such file or directory. Stop. make[2]: *** Waiting for unfinished jobs.... lto-wrapper: fatal error: make returned 2 exit status compilation terminated. /usr/src/venice/buildroot/output/host/lib/gcc/aarch64-buildroot-linux-gnu/9.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status scripts/Makefile.spl:461: recipe for target 'spl/u-boot-spl' failed make[1]: *** [spl/u-boot-spl] Error 1 Makefile:1985: recipe for target 'spl/u-boot-spl' failed make: *** [spl/u-boot-spl] Error 2
I'm using your lto branch
Best Regards,
Tim
Tim, try compiling with only one job, i.e. make -j1
If parallel build fails, we have a bug in the Makefile. It worked fine without the LTO patches.
It may be a problem with GNU make's jobserver. Tom mentioned that there is a known race condition or something...
I was unclear at the time, sorry. Yes, it sounds like there's some race condition these patches are adding that needs to be addressed. By the nature of race condition they aren't always easy to trigger, but we can't just ignore them if CI doesn't trip on it every time.
If only there was a simple way to discover inside the Makefile the number of jobs given to the make command via the -j parameter, we could use -flto=$(JOBS).
I found this https://blog.jgc.org/2015/03/gnu-make-insanity-finding-value-of-j.html
Well, how is this being done in the Linux kernel? Or maybe, sigh, this isn't a problem with Clang's LTO which is what is in mainline Linux kernel atm. Maybe https://lore.kernel.org/patchwork/project/lkml/list/?series=463749&state... will have some clues, all the same.
Tom, I fear that the only stable and sane solution now is to drop jobserver and just do -flto, i.e. in one thread. This will increase compilation time, but will work for everyone.
Another option is to do -flto=NCPUs, but that would contradict user's choice of -j option, if they chose -j1, for example.
What do you think?
Maybe we do NCPUs and have the help text note this particular quirk for now?

On Mon, 15 Mar 2021 21:12:32 -0400 Tom Rini trini@konsulko.com wrote:
On Mon, Mar 15, 2021 at 10:42:31AM +0100, Marek Behun wrote:
On Fri, 12 Mar 2021 15:47:12 -0500 Tom Rini trini@konsulko.com wrote:
On Fri, Mar 12, 2021 at 06:36:05PM +0100, Marek Behun wrote:
On Fri, 12 Mar 2021 18:19:08 +0100 Heinrich Schuchardt xypron.glpk@gmx.de wrote:
On 12.03.21 18:03, Marek Behun wrote:
On Fri, 12 Mar 2021 08:34:41 -0800 Tim Harvey tharvey@gateworks.com wrote:
> On Fri, Mar 12, 2021 at 5:47 AM Marek Behún marek.behun@nic.cz wrote: >> >> Enable LTO for some boards that were tested by people on U-Boot Mailing >> List. >> >> Signed-off-by: Marek Behún marek.behun@nic.cz >> Tested-by: Adam Ford aford173@gmail.com >> Tested-by: Pali Rohár pali@kernel.org >> Tested-by: Tim Harvey tharvey@gateworks.com >> --- >> configs/am3517_evm_defconfig | 1 + >> configs/da850evm_defconfig | 1 + >> configs/da850evm_direct_nor_defconfig | 1 + >> configs/da850evm_nand_defconfig | 1 + >> configs/imx6q_logic_defconfig | 1 + >> configs/imx8mm_beacon_defconfig | 1 + >> configs/imx8mm_venice_defconfig | 1 + >> configs/imx8mn_beacon_2g_defconfig | 1 + >> configs/imx8mn_beacon_defconfig | 1 + >> configs/nokia_rx51_defconfig | 1 + >> configs/omap3_logic_defconfig | 1 + >> configs/r8a774a1_beacon_defconfig | 1 + >> configs/r8a774b1_beacon_defconfig | 1 + >> configs/r8a774e1_beacon_defconfig | 1 + >> configs/turris_mox_defconfig | 1 + >> configs/turris_omnia_defconfig | 1 + >> 16 files changed, 16 insertions(+) >> >> diff --git a/configs/am3517_evm_defconfig b/configs/am3517_evm_defconfig >> index bae0e0af35..d61eec94a4 100644 >> --- a/configs/am3517_evm_defconfig >> +++ b/configs/am3517_evm_defconfig >> @@ -1,3 +1,4 @@ >> +CONFIG_LTO=y >> CONFIG_ARM=y >> # CONFIG_SPL_USE_ARCH_MEMCPY is not set >> # CONFIG_SPL_USE_ARCH_MEMSET is not set >> diff --git a/configs/da850evm_defconfig b/configs/da850evm_defconfig >> index 26e76a2929..6ff5e21bc6 100644 >> --- a/configs/da850evm_defconfig >> +++ b/configs/da850evm_defconfig >> @@ -1,3 +1,4 @@ >> +CONFIG_LTO=y >> CONFIG_ARM=y >> CONFIG_SYS_THUMB_BUILD=y >> CONFIG_ARCH_DAVINCI=y >> diff --git a/configs/da850evm_direct_nor_defconfig b/configs/da850evm_direct_nor_defconfig >> index d3860a963d..06c7ce7c47 100644 >> --- a/configs/da850evm_direct_nor_defconfig >> +++ b/configs/da850evm_direct_nor_defconfig >> @@ -1,3 +1,4 @@ >> +CONFIG_LTO=y >> CONFIG_ARM=y >> CONFIG_ARCH_CPU_INIT=y >> CONFIG_ARCH_DAVINCI=y >> diff --git a/configs/da850evm_nand_defconfig b/configs/da850evm_nand_defconfig >> index 0d0e9a148d..be737564e1 100644 >> --- a/configs/da850evm_nand_defconfig >> +++ b/configs/da850evm_nand_defconfig >> @@ -1,3 +1,4 @@ >> +CONFIG_LTO=y >> CONFIG_ARM=y >> CONFIG_SYS_THUMB_BUILD=y >> CONFIG_ARCH_DAVINCI=y >> diff --git a/configs/imx6q_logic_defconfig b/configs/imx6q_logic_defconfig >> index 36dc24d080..0f8aea6983 100644 >> --- a/configs/imx6q_logic_defconfig >> +++ b/configs/imx6q_logic_defconfig >> @@ -1,3 +1,4 @@ >> +CONFIG_LTO=y >> CONFIG_ARM=y >> CONFIG_ARCH_MX6=y >> CONFIG_SYS_TEXT_BASE=0x17800000 >> diff --git a/configs/imx8mm_beacon_defconfig b/configs/imx8mm_beacon_defconfig >> index 045b19f4f3..e8bb44eea6 100644 >> --- a/configs/imx8mm_beacon_defconfig >> +++ b/configs/imx8mm_beacon_defconfig >> @@ -1,3 +1,4 @@ >> +CONFIG_LTO=y >> CONFIG_ARM=y >> CONFIG_ARCH_IMX8M=y >> CONFIG_SYS_TEXT_BASE=0x40200000 >> diff --git a/configs/imx8mm_venice_defconfig b/configs/imx8mm_venice_defconfig >> index a15c3641f6..dff8f64540 100644 >> --- a/configs/imx8mm_venice_defconfig >> +++ b/configs/imx8mm_venice_defconfig >> @@ -1,3 +1,4 @@ >> +CONFIG_LTO=y >> CONFIG_ARM=y >> CONFIG_ARCH_IMX8M=y >> CONFIG_SYS_TEXT_BASE=0x40200000 >> diff --git a/configs/imx8mn_beacon_2g_defconfig b/configs/imx8mn_beacon_2g_defconfig >> index 58b8e49486..1c8cbc2c89 100644 >> --- a/configs/imx8mn_beacon_2g_defconfig >> +++ b/configs/imx8mn_beacon_2g_defconfig >> @@ -1,3 +1,4 @@ >> +CONFIG_LTO=y >> CONFIG_ARM=y >> CONFIG_ARCH_IMX8M=y >> CONFIG_SYS_TEXT_BASE=0x40200000 >> diff --git a/configs/imx8mn_beacon_defconfig b/configs/imx8mn_beacon_defconfig >> index d6a3385d8d..6457b9409a 100644 >> --- a/configs/imx8mn_beacon_defconfig >> +++ b/configs/imx8mn_beacon_defconfig >> @@ -1,3 +1,4 @@ >> +CONFIG_LTO=y >> CONFIG_ARM=y >> CONFIG_ARCH_IMX8M=y >> CONFIG_SYS_TEXT_BASE=0x40200000 >> diff --git a/configs/nokia_rx51_defconfig b/configs/nokia_rx51_defconfig >> index 312ca3a1a9..85ca627790 100644 >> --- a/configs/nokia_rx51_defconfig >> +++ b/configs/nokia_rx51_defconfig >> @@ -1,3 +1,4 @@ >> +CONFIG_LTO=y >> CONFIG_ARM=y >> # CONFIG_SYS_THUMB_BUILD is not set >> CONFIG_ARCH_OMAP2PLUS=y >> diff --git a/configs/omap3_logic_defconfig b/configs/omap3_logic_defconfig >> index 4e37237b86..cc4b727a2c 100644 >> --- a/configs/omap3_logic_defconfig >> +++ b/configs/omap3_logic_defconfig >> @@ -1,3 +1,4 @@ >> +CONFIG_LTO=y >> CONFIG_ARM=y >> # CONFIG_SPL_USE_ARCH_MEMCPY is not set >> # CONFIG_SPL_USE_ARCH_MEMSET is not set >> diff --git a/configs/r8a774a1_beacon_defconfig b/configs/r8a774a1_beacon_defconfig >> index 2f45edd92e..9dd5d9192e 100644 >> --- a/configs/r8a774a1_beacon_defconfig >> +++ b/configs/r8a774a1_beacon_defconfig >> @@ -1,3 +1,4 @@ >> +CONFIG_LTO=y >> CONFIG_ARM=y >> CONFIG_ARCH_RMOBILE=y >> CONFIG_SYS_TEXT_BASE=0x50000000 >> diff --git a/configs/r8a774b1_beacon_defconfig b/configs/r8a774b1_beacon_defconfig >> index ca514bb1aa..b7d7f23f5a 100644 >> --- a/configs/r8a774b1_beacon_defconfig >> +++ b/configs/r8a774b1_beacon_defconfig >> @@ -1,3 +1,4 @@ >> +CONFIG_LTO=y >> CONFIG_ARM=y >> CONFIG_ARCH_RMOBILE=y >> CONFIG_SYS_TEXT_BASE=0x50000000 >> diff --git a/configs/r8a774e1_beacon_defconfig b/configs/r8a774e1_beacon_defconfig >> index b89729d92a..3e44edf29f 100644 >> --- a/configs/r8a774e1_beacon_defconfig >> +++ b/configs/r8a774e1_beacon_defconfig >> @@ -1,3 +1,4 @@ >> +CONFIG_LTO=y >> CONFIG_ARM=y >> CONFIG_ARCH_RMOBILE=y >> CONFIG_SYS_TEXT_BASE=0x50000000 >> diff --git a/configs/turris_mox_defconfig b/configs/turris_mox_defconfig >> index f938fbb475..2a351d9180 100644 >> --- a/configs/turris_mox_defconfig >> +++ b/configs/turris_mox_defconfig >> @@ -1,3 +1,4 @@ >> +CONFIG_LTO=y >> CONFIG_ARM=y >> CONFIG_ARCH_CPU_INIT=y >> CONFIG_ARCH_MVEBU=y >> diff --git a/configs/turris_omnia_defconfig b/configs/turris_omnia_defconfig >> index 4b8843d7be..d7a2ec3592 100644 >> --- a/configs/turris_omnia_defconfig >> +++ b/configs/turris_omnia_defconfig >> @@ -1,3 +1,4 @@ >> +CONFIG_LTO=y>>> CONFIG_ARM=y >> CONFIG_ARCH_CPU_INIT=y >> CONFIG_SPL_SYS_THUMB_BUILD=y >> -- >> 2.26.2 >> > > Marek, > > Perhaps I didn't test the property test before as I did not realize > there was a config to be enabled. > > Enabling CONFIG_LTO breaks linking the SPL (linking uboot is fine): > LTO spl/u-boot-spl > make[2]: *** read jobs pipe: No such file or directory. Stop. > make[2]: *** Waiting for unfinished jobs.... > lto-wrapper: fatal error: make returned 2 exit status > compilation terminated. > /usr/src/venice/buildroot/output/host/lib/gcc/aarch64-buildroot-linux-gnu/9.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: > error: lto-wrapper failed > collect2: error: ld returned 1 exit status > scripts/Makefile.spl:461: recipe for target 'spl/u-boot-spl' failed > make[1]: *** [spl/u-boot-spl] Error 1 > Makefile:1985: recipe for target 'spl/u-boot-spl' failed > make: *** [spl/u-boot-spl] Error 2 > > I'm using your lto branch > > Best Regards, > > Tim
Tim, try compiling with only one job, i.e. make -j1
If parallel build fails, we have a bug in the Makefile. It worked fine without the LTO patches.
It may be a problem with GNU make's jobserver. Tom mentioned that there is a known race condition or something...
I was unclear at the time, sorry. Yes, it sounds like there's some race condition these patches are adding that needs to be addressed. By the nature of race condition they aren't always easy to trigger, but we can't just ignore them if CI doesn't trip on it every time.
If only there was a simple way to discover inside the Makefile the number of jobs given to the make command via the -j parameter, we could use -flto=$(JOBS).
I found this https://blog.jgc.org/2015/03/gnu-make-insanity-finding-value-of-j.html
Well, how is this being done in the Linux kernel? Or maybe, sigh, this isn't a problem with Clang's LTO which is what is in mainline Linux kernel atm. Maybe https://lore.kernel.org/patchwork/project/lkml/list/?series=463749&state... will have some clues, all the same.
Tom, I fear that the only stable and sane solution now is to drop jobserver and just do -flto, i.e. in one thread. This will increase compilation time, but will work for everyone.
Another option is to do -flto=NCPUs, but that would contradict user's choice of -j option, if they chose -j1, for example.
What do you think?
Maybe we do NCPUs and have the help text note this particular quirk for now?
OK
participants (5)
-
Heinrich Schuchardt
-
Marek Behun
-
Marek Behún
-
Tim Harvey
-
Tom Rini