u-boot/arch/arm/mach-exynos
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
..
include/mach samsung: arndale: remove board_mmc_init function 2021-01-13 13:49:38 +09:00
clock.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
clock_init.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
clock_init_exynos4.c ARM: exynos: move SoC sources to mach-exynos 2015-08-17 13:06:52 +09:00
clock_init_exynos5.c exynos: Add proid_is_exynos542x() for common 542x 2018-12-13 16:36:30 -07:00
common_setup.h exynos: Add proid_is_exynos542x() for common 542x 2018-12-13 16:36:30 -07:00
config.mk SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
dmc_common.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
dmc_init_ddr3.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
dmc_init_exynos4.c ARM: exynos: move SoC sources to mach-exynos 2015-08-17 13:06:52 +09:00
exynos4_setup.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
exynos5_setup.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
Kconfig delete Kbuild "select" of long-dead SPL_DISABLE_OF_CONTROL 2019-05-04 13:04:18 -04:00
lowlevel_init.c common: Drop init.h from common header 2020-05-18 17:33:33 -04:00
Makefile arm: v7: Kconfig: Rename CPU_V7 as CPU_V7A 2018-05-07 15:53:24 -04:00
mmu-arm64.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
pinmux.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
power.c exynos: Add proid_is_exynos542x() for common 542x 2018-12-13 16:36:30 -07:00
sec_boot.S SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
soc.c reset: Remove addr parameter from reset_cpu() 2021-03-02 14:03:02 -05:00
spl_boot.c ARM: make gd a function call for LTO and set via set_gd() 2021-05-24 14:21:30 -04:00
system.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
tzpc.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00