All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH u-boot 00/39] U-Boot LTO (Sandbox + Some ARM boards)
@ 2021-03-07  4:24 Marek Behún
  2021-03-07  4:25 ` [PATCH u-boot-marvell 01/39] ddr: marvell: axp: align signature of mv_xor_mem_init() with a38x Marek Behún
                   ` (38 more replies)
  0 siblings, 39 replies; 139+ messages in thread
From: Marek Behún @ 2021-03-07  4:24 UTC (permalink / raw)
  To: u-boot

Hello,

so after the RFC I am now sending first version of patches adding
support for LTO to U-Boot.

This series was tested by Github/Azure CI at
  https://github.com/u-boot/u-boot/pull/57
and also by Pali Rohar and Adam Ford for some boards.

There is one test that fails and one that did not complete after 60
minutes, but these seem to be related to an issue regarding a race
condition with GNU Make's jobserver - I am using -flto=jobserver.
We could remove the jobserver option, but the linking is then painfully
slow, so I don't know.

Anyway the code size decrease is nice, approximately 15% for SPL.
It's lower on the main binary, only about 5%, but this is still nice
and needed for some boards, such as Nokia RX-51 (N900), because the
binary is otherwise on the boundary already.

I am satisfied with how even clang now links with LTO, at least for
sandbox, and passing all CI tests.

For sandbox I have added a patch that enables LTO by default.

For ARM, there is one patch that enables LTO for several boards -
these are tested to work (thanks Pali and Adam).

The last patch, which enables LTO for all ARM boards by default,
is prefixed "DO NOT MERGE!"

This patch series therefore should not (hopefully) cause regression
when applied.

Marek

Marek Beh?n (39):
  ddr: marvell: axp: align signature of mv_xor_mem_init() with a38x
  ddr: marvell: axp: fix array types have different bounds warning
  regmap: fix a serious pointer casting bug
  api: fix a potential serious bug caused by undef CONFIG_SYS_64BIT_LBA
  checkpatch: require quotes around section name in the __section()
    macro
  treewide: Convert macro and uses of __section(foo) to __section("foo")
  compiler.h: align the __ADDRESSABLE macro with Linux' version
  linker_lists: prepare macros to avoid code repetition
  test/py: improve regular expression for ut subtest symbol matcher
  linker_lists: declare lists and entries as __ADDRESSABLE for LTO
  binman: declare symbols externally visible
  string: make memcpy() and memset() visible to fix LTO linking errors
  efi_loader: fix warning when linking with LTO
  lib: crc32: make the crc_table variable non-const
  Makefile, Makefile.spl: cosmetic change
  build: use thin archives instead of incremental linking
  build: support building with Link Time Optimizations
  build: LTO: move platform libs into --start-group list
  sandbox: errno: avoid conflict with libc's errno
  sandbox: use sections instead of symbols for getopt array boundaries
  sandbox: make LTO available
  sandbox: enable LTO by default
  ARM: global_data: make set_gd() work for armv5 and armv6
  ARM: make gd a function call for LTO and set via set_gd()
  ARM: fix LTO build for some thumb-interwork cases
  ARM: fix LTO for imx28_xea
  ARM: fix LTO for apf27
  ARM: fix LTO for keystone
  ARM: kona: fix clk_bsc_enable() type mismatch for LTO
  ARM: imx6m: fix imx_eqos_txclk_set_rate() type mismatch for LTO
  ARM: fix LTO for seaboard
  ARM: fix LTO for rockchip and samsung
  ARM: omap3: fix LTO for DM3730 (and possibly other omap3 boards)
  armv8: SPL: discard relocation information
  ata: ahci: fix ahci_link_up() type mismatch for LTO
  ARM: make LTO available
  ARM: don't use -ffunction-sections/-fdata-sections with LTO build
  ARM: enable LTO for some boards
  ARM: enable LTO by default

 Kbuild                                     |  2 +
 Kconfig                                    | 19 +++++++
 Makefile                                   | 49 ++++++++++++++--
 arch/Kconfig                               |  4 ++
 arch/arm/config.mk                         |  8 ++-
 arch/arm/cpu/arm926ejs/Makefile            |  2 +
 arch/arm/cpu/arm926ejs/mxs/mxs.c           |  2 +-
 arch/arm/cpu/arm926ejs/mxs/spl_boot.c      |  4 +-
 arch/arm/cpu/arm926ejs/spear/spl.c         |  2 +-
 arch/arm/cpu/armv7/kona-common/clk-stubs.c |  2 +-
 arch/arm/cpu/armv7/ls102xa/ls102xa_psci.c  |  2 +-
 arch/arm/cpu/armv8/fsl-layerscape/spl.c    |  2 +-
 arch/arm/cpu/armv8/spl_data.c              |  4 +-
 arch/arm/cpu/armv8/u-boot-spl.lds          |  1 +
 arch/arm/include/asm/global_data.h         |  6 +-
 arch/arm/include/asm/secure.h              |  6 +-
 arch/arm/include/asm/setup.h               |  2 +-
 arch/arm/lib/Makefile                      |  3 +
 arch/arm/lib/sections.c                    | 31 +++++-----
 arch/arm/lib/spl.c                         |  2 +-
 arch/arm/mach-at91/spl.c                   |  2 +-
 arch/arm/mach-exynos/spl_boot.c            |  2 +-
 arch/arm/mach-imx/imx8m/clock_imx8mm.c     |  2 +-
 arch/arm/mach-imx/imx8m/soc.c              |  2 +-
 arch/arm/mach-imx/spl_imx_romapi.c         | 16 +++---
 arch/arm/mach-k3/am6_init.c                |  2 +-
 arch/arm/mach-k3/j721e_init.c              |  4 +-
 arch/arm/mach-keystone/Makefile            |  1 +
 arch/arm/mach-mvebu/mbus.c                 |  4 +-
 arch/arm/mach-mvebu/timer.c                |  2 +-
 arch/arm/mach-nexell/clock.c               |  6 +-
 arch/arm/mach-nexell/timer.c               |  6 +-
 arch/arm/mach-omap2/omap3/Makefile         |  2 +
 arch/arm/mach-rockchip/board.c             |  2 +-
 arch/arm/mach-socfpga/spl_a10.c            |  2 +-
 arch/arm/mach-sunxi/board.c                |  2 +-
 arch/arm/mach-tegra/board.c                |  2 +-
 arch/arm/mach-tegra/cboot.c                |  8 +--
 arch/arm/mach-tegra/tegra20/Makefile       |  1 +
 arch/mips/mach-jz47xx/jz4780/jz4780.c      |  2 +-
 arch/nds32/include/asm/setup.h             |  6 +-
 arch/powerpc/include/asm/cache.h           |  4 +-
 arch/riscv/cpu/cpu.c                       |  4 +-
 arch/sandbox/config.mk                     | 12 +++-
 arch/sandbox/cpu/os.c                      |  3 +-
 arch/sandbox/cpu/start.c                   |  3 +-
 arch/sandbox/cpu/u-boot-spl.lds            |  8 ++-
 arch/sandbox/cpu/u-boot.lds                |  8 ++-
 arch/sandbox/include/asm/getopt.h          |  2 +-
 arch/sandbox/include/asm/sections.h        | 21 ++++++-
 arch/sandbox/lib/sections.c                |  9 +--
 arch/x86/cpu/coreboot/tables.c             |  2 +-
 arch/x86/cpu/coreboot/timestamp.c          |  2 +-
 arch/x86/lib/sections.c                    |  9 +--
 arch/xtensa/cpu/cpu.c                      |  2 +-
 board/bosch/shc/board.c                    |  2 +-
 board/broadcom/bcmstb/bcmstb.c             |  2 +-
 board/samsung/arndale/arndale_spl.c        |  2 +-
 board/samsung/common/exynos5-dt.c          |  2 +-
 board/samsung/smdk5250/smdk5250_spl.c      |  2 +-
 board/samsung/smdk5420/smdk5420_spl.c      |  2 +-
 board/siemens/draco/board.c                |  2 +-
 board/xilinx/common/fru_ops.c              |  2 +-
 configs/da850evm_defconfig                 |  1 +
 configs/da850evm_direct_nor_defconfig      |  1 +
 configs/da850evm_nand_defconfig            |  1 +
 configs/imx6q_logic_defconfig              |  1 +
 configs/imx8mn_beacon_2g_defconfig         |  1 +
 configs/imx8mn_beacon_defconfig            |  1 +
 configs/nokia_rx51_defconfig               |  1 +
 configs/turris_mox_defconfig               |  1 +
 configs/turris_omnia_defconfig             |  1 +
 drivers/ata/ahci.c                         |  2 +-
 drivers/bios_emulator/biosemu.c            |  4 +-
 drivers/core/regmap.c                      | 13 ++++-
 drivers/ddr/marvell/axp/ddr3_dfs.c         |  4 +-
 drivers/ddr/marvell/axp/ddr3_sdram.c       |  2 +-
 drivers/ddr/marvell/axp/xor.c              |  4 +-
 drivers/ddr/marvell/axp/xor.h              |  4 +-
 drivers/firmware/psci.c                    |  2 +-
 drivers/mtd/nand/raw/mxc_nand_spl.c        |  2 +-
 drivers/pinctrl/nxp/pinctrl-imx5.c         |  2 +-
 drivers/pinctrl/nxp/pinctrl-imx7.c         |  2 +-
 drivers/pinctrl/nxp/pinctrl-imx8m.c        |  2 +-
 drivers/power/pmic/pmic_tps62362.c         |  2 +-
 drivers/power/pmic/pmic_tps65217.c         |  2 +-
 drivers/power/pmic/pmic_tps65218.c         |  2 +-
 drivers/power/pmic/pmic_tps65910.c         |  2 +-
 drivers/serial/serial_pl01x.c              |  4 +-
 include/api_public.h                       | 23 ++++++--
 include/binman_sym.h                       |  5 +-
 include/efi_loader.h                       |  8 +--
 include/errno.h                            |  8 ++-
 include/linker_lists.h                     | 66 ++++++++++++++--------
 include/linux/compiler.h                   | 10 ++--
 include/linux/compiler_attributes.h        |  2 +-
 lib/crc32.c                                |  2 +-
 lib/errno.c                                |  4 +-
 lib/string.c                               |  5 +-
 lib/trace.c                                |  4 +-
 scripts/Makefile.build                     | 16 +++---
 scripts/Makefile.lib                       |  3 +
 scripts/Makefile.spl                       | 30 ++++++++--
 scripts/checkpatch.pl                      |  2 +-
 test/py/conftest.py                        |  2 +-
 105 files changed, 391 insertions(+), 197 deletions(-)

-- 
2.26.2

^ permalink raw reply	[flat|nested] 139+ messages in thread

end of thread, other threads:[~2021-03-12 13:52 UTC | newest]

Thread overview: 139+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-07  4:24 [PATCH u-boot 00/39] U-Boot LTO (Sandbox + Some ARM boards) Marek Behún
2021-03-07  4:25 ` [PATCH u-boot-marvell 01/39] ddr: marvell: axp: align signature of mv_xor_mem_init() with a38x Marek Behún
2021-03-08  6:50   ` Bin Meng
2021-03-07  4:25 ` [PATCH u-boot-marvell 02/39] ddr: marvell: axp: fix array types have different bounds warning Marek Behún
2021-03-08  6:41   ` Stefan Roese
2021-03-08  6:45     ` Marek Behun
2021-03-08  6:50       ` Stefan Roese
2021-03-09 13:54         ` Tom Rini
2021-03-12  8:54           ` Stefan Roese
2021-03-08  6:46     ` Marek Behun
2021-03-08  6:58       ` Stefan Roese
2021-03-08  7:04         ` Marek Behun
2021-03-08  6:50   ` Bin Meng
2021-03-07  4:25 ` [PATCH u-boot-dm 03/39] regmap: fix a serious pointer casting bug Marek Behún
2021-03-08  7:10   ` Bin Meng
2021-03-07  4:25 ` [PATCH u-boot 04/39] api: fix a potential serious bug caused by undef CONFIG_SYS_64BIT_LBA Marek Behún
2021-03-08  7:09   ` Bin Meng
2021-03-08  7:21     ` Marek Behun
2021-03-07  4:25 ` [PATCH u-boot 05/39] checkpatch: require quotes around section name in the __section() macro Marek Behún
2021-03-07  4:47   ` Marek Vasut
2021-03-07  4:55     ` Marek Behun
2021-03-07  4:25 ` [PATCH u-boot 06/39] treewide: Convert macro and uses of __section(foo) to __section("foo") Marek Behún
2021-03-08  7:27   ` Bin Meng
2021-03-07  4:25 ` [PATCH u-boot 07/39] compiler.h: align the __ADDRESSABLE macro with Linux' version Marek Behún
2021-03-08  7:27   ` Bin Meng
2021-03-08  9:23     ` Marek Behun
2021-03-08 10:29       ` Bin Meng
2021-03-08 11:04         ` Marek Behun
2021-03-07  4:25 ` [PATCH u-boot 08/39] linker_lists: prepare macros to avoid code repetition Marek Behún
2021-03-08  7:44   ` Bin Meng
2021-03-07  4:25 ` [PATCH u-boot 09/39] test/py: improve regular expression for ut subtest symbol matcher Marek Behún
2021-03-07  4:25 ` [PATCH u-boot 10/39] linker_lists: declare lists and entries as __ADDRESSABLE for LTO Marek Behún
2021-03-08  7:44   ` Bin Meng
2021-03-07  4:25 ` [PATCH u-boot 11/39] binman: declare symbols externally visible Marek Behún
2021-03-07  4:59   ` Marek Behun
2021-03-08  7:47     ` Bin Meng
2021-03-08  9:26       ` Marek Behun
2021-03-08 10:31         ` Bin Meng
2021-03-08 11:07           ` Marek Behun
2021-03-07  4:25 ` [PATCH u-boot 12/39] string: make memcpy() and memset() visible to fix LTO linking errors Marek Behún
2021-03-08  7:56   ` Bin Meng
2021-03-08 10:19     ` Marek Behun
2021-03-08 10:23       ` Pali Rohár
2021-03-08 10:40         ` Bin Meng
2021-03-08 10:55           ` Pali Rohár
2021-03-08 11:31             ` Marek Behun
2021-03-08 11:36             ` Marek Behun
2021-03-12 10:09             ` Marek Behun
2021-03-12 11:11               ` Bin Meng
2021-03-07  4:25 ` [PATCH u-boot 13/39] efi_loader: fix warning when linking with LTO Marek Behún
2021-03-08  7:56   ` Bin Meng
2021-03-07  4:25 ` [PATCH u-boot 14/39] lib: crc32: make the crc_table variable non-const Marek Behún
2021-03-07  4:46   ` Marek Vasut
2021-03-07  4:58     ` Marek Behun
2021-03-07  5:02       ` Marek Vasut
2021-03-07 12:26         ` Marek Behun
2021-03-07 12:31           ` Pali Rohár
2021-03-07 12:42             ` Marek Behun
2021-03-07 12:52             ` [PATCH u-boot 14/39] lib: crc32: put the crc_table variable into efi_runtime_rodata section Marek Behún
2021-03-07 13:04               ` Marek Behun
2021-03-07 20:49                 ` Marek Behun
2021-03-08  7:01                 ` [PATCH u-boot v1.1 14.1/39] efi_loader: add macro for const EFI runtime data Marek Behún
2021-03-08  7:36                   ` Heinrich Schuchardt
2021-03-08  9:54                     ` [PATCH u-boot v1.2 14.1/39] efi_loader: add Sphinx doc for __efi_runtime and __efi_runtime_data Marek Behún
2021-03-08  9:54                     ` [PATCH u-boot v1.2 14.2/39] efi_loader: add macro for const EFI runtime data Marek Behún
2021-03-08  9:54                     ` [PATCH u-boot v1.2 14.3/39] lib: crc32: put the crc_table variable into efi_runtime_rodata section Marek Behún
2021-03-08  7:01                 ` [PATCH u-boot v1.1 14.2/39] " Marek Behún
2021-03-08  8:43                   ` Marek Vasut
2021-03-07  4:25 ` [PATCH u-boot 15/39] Makefile, Makefile.spl: cosmetic change Marek Behún
2021-03-08  9:11   ` Bin Meng
2021-03-08 10:12     ` [PATCH u-boot v1.1 " Marek Behún
2021-03-08 10:42       ` Bin Meng
2021-03-07  4:25 ` [PATCH u-boot 16/39] build: use thin archives instead of incremental linking Marek Behún
2021-03-08  9:16   ` Bin Meng
2021-03-08 10:11     ` Marek Behun
2021-03-08 10:44       ` Bin Meng
2021-03-08 11:00         ` Pali Rohár
2021-03-08 11:41           ` Bin Meng
2021-03-08 11:18         ` Marek Behun
2021-03-08 11:32           ` Bin Meng
2021-03-08 11:52             ` Marek Behun
2021-03-08 13:24             ` Marek Behún
2021-03-08 14:30               ` Bin Meng
2021-03-08 15:22                 ` Marek Behún
2021-03-09  1:24                   ` Bin Meng
2021-03-09  3:42                     ` Bin Meng
2021-03-09 10:36                       ` Marek Behun
2021-03-09 13:00   ` Bin Meng
2021-03-11 12:42     ` Marek Behun
2021-03-07  4:25 ` [PATCH u-boot 17/39] build: support building with Link Time Optimizations Marek Behún
2021-03-09 13:30   ` Bin Meng
2021-03-11 12:45     ` Marek Behun
2021-03-07  4:25 ` [PATCH u-boot 18/39] build: LTO: move platform libs into --start-group list Marek Behún
2021-03-09 15:24   ` Bin Meng
2021-03-11 19:41     ` Marek Behun
2021-03-07  4:25 ` [PATCH u-boot 19/39] sandbox: errno: avoid conflict with libc's errno Marek Behún
2021-03-09 15:28   ` Bin Meng
2021-03-07  4:25 ` [PATCH u-boot 20/39] sandbox: use sections instead of symbols for getopt array boundaries Marek Behún
2021-03-07  4:25 ` [PATCH u-boot 21/39] sandbox: make LTO available Marek Behún
2021-03-10  5:36   ` Bin Meng
2021-03-07  4:25 ` [PATCH u-boot 22/39] sandbox: enable LTO by default Marek Behún
2021-03-10  5:33   ` Bin Meng
2021-03-07  4:25 ` [PATCH u-boot 23/39] ARM: global_data: make set_gd() work for armv5 and armv6 Marek Behún
2021-03-07  4:25 ` [PATCH u-boot 24/39] ARM: make gd a function call for LTO and set via set_gd() Marek Behún
2021-03-07  4:25 ` [PATCH u-boot 25/39] ARM: fix LTO build for some thumb-interwork cases Marek Behún
2021-03-07  4:25 ` [PATCH u-boot 26/39] ARM: fix LTO for imx28_xea Marek Behún
2021-03-10  5:31   ` Bin Meng
2021-03-07  4:25 ` [PATCH u-boot 27/39] ARM: fix LTO for apf27 Marek Behún
2021-03-07  4:25 ` [PATCH u-boot 28/39] ARM: fix LTO for keystone Marek Behún
2021-03-07  4:25 ` [PATCH u-boot 29/39] ARM: kona: fix clk_bsc_enable() type mismatch for LTO Marek Behún
2021-03-10  5:29   ` Bin Meng
2021-03-07  4:25 ` [PATCH u-boot 30/39] ARM: imx6m: fix imx_eqos_txclk_set_rate() " Marek Behún
2021-03-07  5:33   ` Sean Anderson
2021-03-07 12:13     ` Marek Behun
2021-03-10  5:27   ` Bin Meng
2021-03-07  4:25 ` [PATCH u-boot 31/39] ARM: fix LTO for seaboard Marek Behún
2021-03-07  4:25 ` [PATCH u-boot 32/39] ARM: fix LTO for rockchip and samsung Marek Behún
2021-03-10  5:25   ` Bin Meng
2021-03-07  4:25 ` [PATCH u-boot 33/39] ARM: omap3: fix LTO for DM3730 (and possibly other omap3 boards) Marek Behún
2021-03-07 10:40   ` Adam Ford
2021-03-07  4:25 ` [PATCH u-boot 34/39] armv8: SPL: discard relocation information Marek Behún
2021-03-07  4:25 ` [PATCH u-boot 35/39] ata: ahci: fix ahci_link_up() type mismatch for LTO Marek Behún
2021-03-10  5:23   ` Bin Meng
2021-03-07  4:25 ` [PATCH u-boot 36/39] ARM: make LTO available Marek Behún
2021-03-07  4:25 ` [PATCH u-boot 37/39] ARM: don't use -ffunction-sections/-fdata-sections with LTO build Marek Behún
2021-03-10  3:40   ` Bin Meng
2021-03-12  6:45     ` Marek Behun
2021-03-12  6:48       ` Bin Meng
2021-03-12  7:00         ` Marek Behun
2021-03-12  7:11         ` Marek Behun
2021-03-12  7:19           ` Bin Meng
2021-03-12  7:29             ` Marek Behun
2021-03-12 13:18               ` Tom Rini
2021-03-12 13:44                 ` Marek Behun
2021-03-12 13:52                   ` Tom Rini
2021-03-07  4:25 ` [PATCH u-boot 38/39] ARM: enable LTO for some boards Marek Behún
2021-03-07 16:14   ` Adam Ford
2021-03-07 20:49     ` Marek Behun
2021-03-07  4:25 ` [PATCH u-boot 39/39] DO NOT MERGE! ARM: enable LTO by default Marek Behún

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.