ARM: enable LTO for some boards
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): CAHCN7xK29J6ymGqupEaSTF+wm9yzArayQJ4TPm_19ReNF62SUQ@mail.gmail.com
PATCH 38/38 ARM: enable LTO for some boards
Enable LTO for some boards that were tested by people on U-Boot Mailing List.
--- 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(+)
configs/am3517_evm_defconfig +1 -0
@@ -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
configs/da850evm_defconfig +1 -0
@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=y
configs/da850evm_direct_nor_defconfig +1 -0
@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_DAVINCI=y
configs/da850evm_nand_defconfig +1 -0
@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=y
configs/imx6q_logic_defconfig +1 -0
@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_MX6=y CONFIG_SYS_TEXT_BASE=0x17800000
configs/imx8mm_beacon_defconfig +1 -0
@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000
configs/imx8mm_venice_defconfig +1 -0
@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000
configs/imx8mn_beacon_2g_defconfig +1 -0
@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000
configs/imx8mn_beacon_defconfig +1 -0
@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000
configs/nokia_rx51_defconfig +1 -0
@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SYS_THUMB_BUILD is not set CONFIG_ARCH_OMAP2PLUS=y
configs/omap3_logic_defconfig +1 -0
@@ -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
configs/r8a774a1_beacon_defconfig +1 -0
@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000
configs/r8a774b1_beacon_defconfig +1 -0
@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000
configs/r8a774e1_beacon_defconfig +1 -0
@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000
configs/turris_mox_defconfig +1 -0
@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_MVEBU=y
configs/turris_omnia_defconfig +1 -0
@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_SPL_SYS_THUMB_BUILD=y
Signature · 1 line
2.26.2
PATCH 38/38 ARM: enable LTO for some boards
Quoted 172 lines · Marek Beh?n
Enable LTO for some boards that were tested by people on U-Boot Mailing List.
Signed-off-by Marek Beh?n <[email protected]>Tested-by Adam Ford <[email protected]>Tested-by Pali Roh?r <[email protected]>Tested-by Tim Harvey <[email protected]>--- 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(+)configs/am3517_evm_defconfig +1
-0@@ -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 setconfigs/da850evm_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=yconfigs/da850evm_direct_nor_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_DAVINCI=yconfigs/da850evm_nand_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=yconfigs/imx6q_logic_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_MX6=y CONFIG_SYS_TEXT_BASE=0x17800000configs/imx8mm_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/imx8mm_venice_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/imx8mn_beacon_2g_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/imx8mn_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/nokia_rx51_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SYS_THUMB_BUILD is not set CONFIG_ARCH_OMAP2PLUS=yconfigs/omap3_logic_defconfig +1
-0@@ -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 setconfigs/r8a774a1_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000configs/r8a774b1_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000configs/r8a774e1_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000configs/turris_mox_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_MVEBU=yconfigs/turris_omnia_defconfig +1
-1@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_SPL_SYS_THUMB_BUILD=y --
Quoted 2 lines
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 statusscripts/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
PATCH 38/38 ARM: enable LTO for some boards
Quoted 195 lines · On Fri, 12 Mar 2021 08:34:41 -0800 Tim Harvey <[email protected]> wrote:
Quoted 172 lines · Marek Beh?n
Enable LTO for some boards that were tested by people on U-Boot Mailing List.
Signed-off-by Marek Beh?n <[email protected]>Tested-by Adam Ford <[email protected]>Tested-by Pali Roh?r <[email protected]>Tested-by Tim Harvey <[email protected]>--- 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(+)configs/am3517_evm_defconfig +1
-0@@ -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 setconfigs/da850evm_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=yconfigs/da850evm_direct_nor_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_DAVINCI=yconfigs/da850evm_nand_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=yconfigs/imx6q_logic_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_MX6=y CONFIG_SYS_TEXT_BASE=0x17800000configs/imx8mm_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/imx8mm_venice_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/imx8mn_beacon_2g_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/imx8mn_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/nokia_rx51_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SYS_THUMB_BUILD is not set CONFIG_ARCH_OMAP2PLUS=yconfigs/omap3_logic_defconfig +1
-0@@ -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 setconfigs/r8a774a1_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000configs/r8a774b1_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000configs/r8a774e1_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000configs/turris_mox_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_MVEBU=yconfigs/turris_omnia_defconfig +1
-1@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_SPL_SYS_THUMB_BUILD=y --Quoted 2 lines
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_LTObreaks 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 statusscripts/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
Quoted 5 lines
I'm using your lto branch
Best Regards,
Tim
Tim, try compiling with only one job, i.e.
make -j1
PATCH 38/38 ARM: enable LTO for some boards
Quoted 197 lines · Marek Behun
Quoted 194 lines · On Fri, 12 Mar 2021 08:34:41 -0800 Tim Harvey <[email protected]> wrote:
Quoted 171 lines · Marek Beh?n
Enable LTO for some boards that were tested by people on U-Boot Mailing List.
Signed-off-by Marek Beh?n <[email protected]>Tested-by Adam Ford <[email protected]>Tested-by Pali Roh?r <[email protected]>Tested-by Tim Harvey <[email protected]>--- 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(+)configs/am3517_evm_defconfig +1
-0@@ -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 setconfigs/da850evm_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=yconfigs/da850evm_direct_nor_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_DAVINCI=yconfigs/da850evm_nand_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=yconfigs/imx6q_logic_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_MX6=y CONFIG_SYS_TEXT_BASE=0x17800000configs/imx8mm_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/imx8mm_venice_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/imx8mn_beacon_2g_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/imx8mn_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/nokia_rx51_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SYS_THUMB_BUILD is not set CONFIG_ARCH_OMAP2PLUS=yconfigs/omap3_logic_defconfig +1
-0@@ -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 setconfigs/r8a774a1_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000configs/r8a774b1_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000configs/r8a774e1_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000configs/turris_mox_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_MVEBU=yconfigs/turris_omnia_defconfig +1
-1@@ -1,3 +1,4 @@ +CONFIG_LTO=y>>> CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_SPL_SYS_THUMB_BUILD=y --Quoted 2 lines
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_LTObreaks 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 statusscripts/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
Quoted 9 lines
Quoted 5 lines
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
PATCH 38/38 ARM: enable LTO for some boards
Quoted 202 lines · On Fri, 12 Mar 2021 18:19:08 +0100 Heinrich Schuchardt <[email protected]>…
Quoted 201 lines · Marek Behun
Quoted 198 lines · On Fri, 12 Mar 2021 08:34:41 -0800 Tim Harvey <[email protected]> wrote:
Quoted 171 lines · Marek Beh?n
Enable LTO for some boards that were tested by people on U-Boot Mailing List.
Signed-off-by Marek Beh?n <[email protected]>Tested-by Adam Ford <[email protected]>Tested-by Pali Roh?r <[email protected]>Tested-by Tim Harvey <[email protected]>--- 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(+)configs/am3517_evm_defconfig +1
-0@@ -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 setconfigs/da850evm_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=yconfigs/da850evm_direct_nor_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_DAVINCI=yconfigs/da850evm_nand_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=yconfigs/imx6q_logic_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_MX6=y CONFIG_SYS_TEXT_BASE=0x17800000configs/imx8mm_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/imx8mm_venice_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/imx8mn_beacon_2g_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/imx8mn_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/nokia_rx51_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SYS_THUMB_BUILD is not set CONFIG_ARCH_OMAP2PLUS=yconfigs/omap3_logic_defconfig +1
-0@@ -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 setconfigs/r8a774a1_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000configs/r8a774b1_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000configs/r8a774e1_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000configs/turris_mox_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_MVEBU=yconfigs/turris_omnia_defconfig +1
-1@@ -1,3 +1,4 @@ +CONFIG_LTO=y>>> CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_SPL_SYS_THUMB_BUILD=y --Quoted 2 lines
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_LTObreaks 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 statusscripts/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 2I'm using your lto branch
Best Regards,
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Tim
Tim, try compiling with only one job, i.e.
make -j1If 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
PATCH 38/38 ARM: enable LTO for some boards
Quoted 218 lines · Marek Behun
Quoted 202 lines · On Fri, 12 Mar 2021 18:19:08 +0100 Heinrich Schuchardt <[email protected]>…
Quoted 201 lines · Marek Behun
Quoted 198 lines · On Fri, 12 Mar 2021 08:34:41 -0800 Tim Harvey <[email protected]> wrote:
Quoted 171 lines · Marek Beh?n
Enable LTO for some boards that were tested by people on U-Boot Mailing List.
Signed-off-by Marek Beh?n <[email protected]>Tested-by Adam Ford <[email protected]>Tested-by Pali Roh?r <[email protected]>Tested-by Tim Harvey <[email protected]>--- 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(+)configs/am3517_evm_defconfig +1
-0@@ -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 setconfigs/da850evm_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=yconfigs/da850evm_direct_nor_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_DAVINCI=yconfigs/da850evm_nand_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=yconfigs/imx6q_logic_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_MX6=y CONFIG_SYS_TEXT_BASE=0x17800000configs/imx8mm_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/imx8mm_venice_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/imx8mn_beacon_2g_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/imx8mn_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/nokia_rx51_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SYS_THUMB_BUILD is not set CONFIG_ARCH_OMAP2PLUS=yconfigs/omap3_logic_defconfig +1
-0@@ -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 setconfigs/r8a774a1_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000configs/r8a774b1_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000configs/r8a774e1_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000configs/turris_mox_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_MVEBU=yconfigs/turris_omnia_defconfig +1
-1@@ -1,3 +1,4 @@ +CONFIG_LTO=y>>> CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_SPL_SYS_THUMB_BUILD=y --Quoted 2 lines
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_LTObreaks 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 statusscripts/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 2I'm using your lto branch
Best Regards,
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Tim
Tim, try compiling with only one job, i.e.
make -j1If 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...
Quoted 8 lines
If only there was a simple way to discover inside the
Makefilethe 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.htmlMarek
Marek / Heinrich,
Yes, 'make -j1' does work.
Tim
PATCH 38/38 ARM: enable LTO for some boards
Quoted 5 lines · On Fri, 12 Mar 2021 10:01:34 -0800 Tim Harvey <[email protected]> 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
PATCH 38/38 ARM: enable LTO for some boards
Quoted 8 lines · Marek Behun
Quoted 4 lines · On Fri, 12 Mar 2021 10:01:34 -0800 Tim Harvey <[email protected]> wrote:
Marek / Heinrich,
Yes, 'make -j1' does work.
Quoted 9 lines
Quoted 1 line
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,
Makefile +1 -1
@@ -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
PATCH 38/38 ARM: enable LTO for some boards
In reply to Marek BehunQuoted 211 lines · Marek Behun
Quoted 208 lines · On Fri, 12 Mar 2021 18:19:08 +0100 Heinrich Schuchardt <[email protected]>…
Quoted 206 lines · Marek Behun
Quoted 194 lines · On Fri, 12 Mar 2021 08:34:41 -0800 Tim Harvey <[email protected]> wrote:
Quoted 171 lines · Marek Beh?n
Enable LTO for some boards that were tested by people on U-Boot Mailing List.
Signed-off-by Marek Beh?n <[email protected]>Tested-by Adam Ford <[email protected]>Tested-by Pali Roh?r <[email protected]>Tested-by Tim Harvey <[email protected]>--- 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(+)configs/am3517_evm_defconfig +1
-0@@ -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 setconfigs/da850evm_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=yconfigs/da850evm_direct_nor_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_DAVINCI=yconfigs/da850evm_nand_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=yconfigs/imx6q_logic_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_MX6=y CONFIG_SYS_TEXT_BASE=0x17800000configs/imx8mm_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/imx8mm_venice_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/imx8mn_beacon_2g_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/imx8mn_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/nokia_rx51_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SYS_THUMB_BUILD is not set CONFIG_ARCH_OMAP2PLUS=yconfigs/omap3_logic_defconfig +1
-0@@ -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 setconfigs/r8a774a1_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000configs/r8a774b1_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000configs/r8a774e1_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000configs/turris_mox_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_MVEBU=yconfigs/turris_omnia_defconfig +1
-1@@ -1,3 +1,4 @@ +CONFIG_LTO=y>>> CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_SPL_SYS_THUMB_BUILD=y --Quoted 2 lines
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_LTObreaks 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 statusscripts/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 2Quoted 5 lines
I'm using your lto branch
Best Regards,
Tim
Tim, try compiling with only one job, i.e.
make -j1
Quoted 5 lines
Quoted 2 lines
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.
Quoted 6 lines
If only there was a simple way to discover inside the
Makefilethe 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.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210312/94df1715/attachment.sig>
PATCH 38/38 ARM: enable LTO for some boards
Quoted 227 lines · On Fri, 12 Mar 2021 15:47:12 -0500 Tom Rini <[email protected]> wrote:
Quoted 211 lines · Marek Behun
Quoted 208 lines · On Fri, 12 Mar 2021 18:19:08 +0100 Heinrich Schuchardt <[email protected]>…
Quoted 206 lines · Marek Behun
Quoted 194 lines · On Fri, 12 Mar 2021 08:34:41 -0800 Tim Harvey <[email protected]> wrote:
Quoted 171 lines · Marek Beh?n
Enable LTO for some boards that were tested by people on U-Boot Mailing List.
Signed-off-by Marek Beh?n <[email protected]>Tested-by Adam Ford <[email protected]>Tested-by Pali Roh?r <[email protected]>Tested-by Tim Harvey <[email protected]>--- 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(+)configs/am3517_evm_defconfig +1
-0@@ -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 setconfigs/da850evm_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=yconfigs/da850evm_direct_nor_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_DAVINCI=yconfigs/da850evm_nand_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=yconfigs/imx6q_logic_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_MX6=y CONFIG_SYS_TEXT_BASE=0x17800000configs/imx8mm_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/imx8mm_venice_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/imx8mn_beacon_2g_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/imx8mn_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/nokia_rx51_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SYS_THUMB_BUILD is not set CONFIG_ARCH_OMAP2PLUS=yconfigs/omap3_logic_defconfig +1
-0@@ -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 setconfigs/r8a774a1_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000configs/r8a774b1_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000configs/r8a774e1_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000configs/turris_mox_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_MVEBU=yconfigs/turris_omnia_defconfig +1
-1@@ -1,3 +1,4 @@ +CONFIG_LTO=y>>> CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_SPL_SYS_THUMB_BUILD=y --Quoted 2 lines
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_LTObreaks 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 statusscripts/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 2Quoted 5 lines
I'm using your lto branch
Best Regards,
Tim
Tim, try compiling with only one job, i.e.
make -j1Quoted 5 lines
Quoted 2 lines
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.
Quoted 4 lines
If only there was a simple way to discover inside the
Makefilethe number of jobs given to the make command via the -j parameter, we could use -flto=$(JOBS).
Quoted 8 lines
Quoted 2 lines
I found this
https://blog.jgc.org/2015/03/gnu-make-insanity-finding-value-of-j.htmlWell, 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
PATCH 38/38 ARM: enable LTO for some boards
Quoted 239 lines · Marek Behun
Quoted 227 lines · On Fri, 12 Mar 2021 15:47:12 -0500 Tom Rini <[email protected]> wrote:
Quoted 211 lines · Marek Behun
Quoted 208 lines · On Fri, 12 Mar 2021 18:19:08 +0100 Heinrich Schuchardt <[email protected]>…
Quoted 206 lines · Marek Behun
Quoted 194 lines · On Fri, 12 Mar 2021 08:34:41 -0800 Tim Harvey <[email protected]> wrote:
Quoted 171 lines · Marek Beh?n
Enable LTO for some boards that were tested by people on U-Boot Mailing List.
Signed-off-by Marek Beh?n <[email protected]>Tested-by Adam Ford <[email protected]>Tested-by Pali Roh?r <[email protected]>Tested-by Tim Harvey <[email protected]>--- 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(+)configs/am3517_evm_defconfig +1
-0@@ -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 setconfigs/da850evm_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=yconfigs/da850evm_direct_nor_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_DAVINCI=yconfigs/da850evm_nand_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=yconfigs/imx6q_logic_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_MX6=y CONFIG_SYS_TEXT_BASE=0x17800000configs/imx8mm_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/imx8mm_venice_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/imx8mn_beacon_2g_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/imx8mn_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/nokia_rx51_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SYS_THUMB_BUILD is not set CONFIG_ARCH_OMAP2PLUS=yconfigs/omap3_logic_defconfig +1
-0@@ -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 setconfigs/r8a774a1_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000configs/r8a774b1_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000configs/r8a774e1_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000configs/turris_mox_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_MVEBU=yconfigs/turris_omnia_defconfig +1
-1@@ -1,3 +1,4 @@ +CONFIG_LTO=y>>> CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_SPL_SYS_THUMB_BUILD=y --Quoted 2 lines
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_LTObreaks 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 statusscripts/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 2Quoted 5 lines
I'm using your lto branch
Best Regards,
Tim
Tim, try compiling with only one job, i.e.
make -j1Quoted 5 lines
Quoted 2 lines
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.
Quoted 4 lines
If only there was a simple way to discover inside the
Makefilethe number of jobs given to the make command via the -j parameter, we could use -flto=$(JOBS).Quoted 8 lines
Quoted 2 lines
I found this
https://blog.jgc.org/2015/03/gnu-make-insanity-finding-value-of-j.htmlWell, 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.
Quoted 8 lines
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?
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210315/23806a45/attachment.sig>
PATCH 38/38 ARM: enable LTO for some boards
Quoted 244 lines · On Mon, 15 Mar 2021 21:12:32 -0400 Tom Rini <[email protected]> wrote:
Quoted 243 lines · Marek Behun
Quoted 227 lines · On Fri, 12 Mar 2021 15:47:12 -0500 Tom Rini <[email protected]> wrote:
Quoted 211 lines · Marek Behun
Quoted 208 lines · On Fri, 12 Mar 2021 18:19:08 +0100 Heinrich Schuchardt <[email protected]>…
Quoted 206 lines · Marek Behun
Quoted 194 lines · On Fri, 12 Mar 2021 08:34:41 -0800 Tim Harvey <[email protected]> wrote:
Quoted 171 lines · Marek Beh?n
Enable LTO for some boards that were tested by people on U-Boot Mailing List.
Signed-off-by Marek Beh?n <[email protected]>Tested-by Adam Ford <[email protected]>Tested-by Pali Roh?r <[email protected]>Tested-by Tim Harvey <[email protected]>--- 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(+)configs/am3517_evm_defconfig +1
-0@@ -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 setconfigs/da850evm_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=yconfigs/da850evm_direct_nor_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_DAVINCI=yconfigs/da850evm_nand_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_DAVINCI=yconfigs/imx6q_logic_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_MX6=y CONFIG_SYS_TEXT_BASE=0x17800000configs/imx8mm_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/imx8mm_venice_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/imx8mn_beacon_2g_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/imx8mn_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_IMX8M=y CONFIG_SYS_TEXT_BASE=0x40200000configs/nokia_rx51_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y # CONFIG_SYS_THUMB_BUILD is not set CONFIG_ARCH_OMAP2PLUS=yconfigs/omap3_logic_defconfig +1
-0@@ -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 setconfigs/r8a774a1_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000configs/r8a774b1_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000configs/r8a774e1_beacon_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_RMOBILE=y CONFIG_SYS_TEXT_BASE=0x50000000configs/turris_mox_defconfig +1
-0@@ -1,3 +1,4 @@ +CONFIG_LTO=y CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_MVEBU=yconfigs/turris_omnia_defconfig +1
-1@@ -1,3 +1,4 @@ +CONFIG_LTO=y>>> CONFIG_ARM=y CONFIG_ARCH_CPU_INIT=y CONFIG_SPL_SYS_THUMB_BUILD=y --Quoted 2 lines
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_LTObreaks 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 statusscripts/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 2Quoted 5 lines
I'm using your lto branch
Best Regards,
Tim
Tim, try compiling with only one job, i.e.
make -j1Quoted 5 lines
Quoted 2 lines
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.
Quoted 4 lines
If only there was a simple way to discover inside the
Makefilethe number of jobs given to the make command via the -j parameter, we could use -flto=$(JOBS).Quoted 8 lines
Quoted 2 lines
I found this
https://blog.jgc.org/2015/03/gnu-make-insanity-finding-value-of-j.htmlWell, 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.
Quoted 8 lines
Quoted 4 lines
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