u-boot/arch/arm
Marek Behún 86c5e21013 ARM: make gd a function call for LTO and set via set_gd()
On ARM, the gd pointer is stored in registers r9 / x18. For this the
-ffixed-r9 / -ffixed-x18 flag is used when compiling, but using global
register variables causes errors when building with LTO, and these
errors are very difficult to overcome.

Richard Biener says [1]:
  Note that global register vars shouldn't be used with LTO and if they
  are restricted to just a few compilation units the recommended fix is
  to build those CUs without -flto.

We cannot do this for U-Boot since all CUs use -ffixed-reg flag.

It seems that with LTO we could in fact store the gd pointer differently
and gain performance or size benefit by allowing the compiler to use
r9 / x18. But this would need more work.

So for now, when building with LTO, go the clang way, and instead of
declaring gd a global register variable, we make it a function call via
macro.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68384

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-05-24 14:21:30 -04:00
..
cpu ARM: make gd a function call for LTO and set via set_gd() 2021-05-24 14:21:30 -04:00
dts arm: mvebu: armada-3720-uDPU.dts: Change back to phy-mode "2500base-x" 2021-05-20 13:05:31 +02:00
include ARM: make gd a function call for LTO and set via set_gd() 2021-05-24 14:21:30 -04:00
lib treewide: Convert macro and uses of __section(foo) to __section("foo") 2021-05-24 14:21:30 -04:00
mach-aspeed common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
mach-at91 treewide: Convert macro and uses of __section(foo) to __section("foo") 2021-05-24 14:21:30 -04:00
mach-bcm283x reset: Remove addr parameter from reset_cpu() 2021-03-02 14:03:02 -05:00
mach-bcmstb
mach-cortina
mach-davinci reset: Remove addr parameter from reset_cpu() 2021-03-02 14:03:02 -05:00
mach-exynos ARM: make gd a function call for LTO and set via set_gd() 2021-05-24 14:21:30 -04:00
mach-highbank
mach-imx ARM: make gd a function call for LTO and set via set_gd() 2021-05-24 14:21:30 -04:00
mach-integrator
mach-ipq40xx dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
mach-k3 treewide: Convert macro and uses of __section(foo) to __section("foo") 2021-05-24 14:21:30 -04:00
mach-keystone reset: Remove addr parameter from reset_cpu() 2021-03-02 14:03:02 -05:00
mach-kirkwood drivers: ata: Remove mvsata_ide driver 2021-04-10 07:59:30 -04:00
mach-lpc32xx reset: Remove addr parameter from reset_cpu() 2021-03-02 14:03:02 -05:00
mach-mediatek board: mt7629: enable compression of u-boot to reduce the size of final image 2021-03-20 16:24:27 -04:00
mach-meson arm: meson: remove static ethernet link setup 2021-04-06 11:10:29 +02:00
mach-mvebu treewide: Convert macro and uses of __section(foo) to __section("foo") 2021-05-24 14:21:30 -04:00
mach-nexell treewide: Convert macro and uses of __section(foo) to __section("foo") 2021-05-24 14:21:30 -04:00
mach-octeontx reset: Remove addr parameter from reset_cpu() 2021-03-02 14:03:02 -05:00
mach-octeontx2 reset: Remove addr parameter from reset_cpu() 2021-03-02 14:03:02 -05:00
mach-omap2 am335x: add support for cape detect functionality 2021-05-13 13:09:09 -04:00
mach-orion5x reset: Remove addr parameter from reset_cpu() 2021-03-02 14:03:02 -05:00
mach-owl reset: Remove addr parameter from reset_cpu() 2021-03-02 14:03:02 -05:00
mach-qemu qemu: arm: Initialise virtio devices in board_late_init 2020-12-31 14:41:31 +01:00
mach-rmobile ARM: renesas: Scrub duplicate memory nodes from DT on Gen3 2021-05-12 21:36:27 +02:00
mach-rockchip common: fit: Add weak board_fit_config_name_match 2021-04-14 15:23:01 -04:00
mach-s5pc1xx
mach-snapdragon common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
mach-socfpga treewide: Convert macro and uses of __section(foo) to __section("foo") 2021-05-24 14:21:30 -04:00
mach-sti
mach-stm32 board: Add rt-thread art-pi board support 2021-04-09 11:53:00 +02:00
mach-stm32mp Add rt-thread art-pi board support based on STM32H750 SoC 2021-04-09 13:10:59 -04:00
mach-sunxi treewide: Convert macro and uses of __section(foo) to __section("foo") 2021-05-24 14:21:30 -04:00
mach-tegra treewide: Convert macro and uses of __section(foo) to __section("foo") 2021-05-24 14:21:30 -04:00
mach-u8500
mach-uniphier reset: Remove addr parameter from reset_cpu() 2021-03-02 14:03:02 -05:00
mach-versal arm64: versal: Remove gd reference 2021-04-23 08:49:19 +02:00
mach-versatile
mach-zynq reset: Remove addr parameter from reset_cpu() 2021-03-02 14:03:02 -05:00
mach-zynqmp Xilinx changes for v2021.04-rc3 2021-02-23 10:45:55 -05:00
mach-zynqmp-r5 reset: Remove addr parameter from reset_cpu() 2021-03-02 14:03:02 -05:00
thumb1/include/asm/proc-armv
config.mk Add support for stack-protector 2021-04-20 07:31:12 -04:00
Kconfig arm: highbank: Do DRAM init from DT 2021-04-20 07:31:12 -04:00
Kconfig.debug
Makefile