u-boot/arch/arm/cpu/arm926ejs/mxs
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
..
clock.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
iomux.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
Makefile SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
mxs.c reset: Remove addr parameter from reset_cpu() 2021-03-02 14:03:02 -05:00
mxs_init.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
mxsimage-signed.cfg ARM: mxs: tools: Add support for boot progress display flag 2014-11-20 10:13:45 +01:00
mxsimage-spl.mx23.cfg ARM: mxs: support full SPL framework 2018-04-27 09:32:54 +02:00
mxsimage-spl.mx28.cfg ARM: mxs: support full SPL framework 2018-04-27 09:32:54 +02:00
mxsimage.mx23.cfg ARM: mxs: tools: Add support for boot progress display flag 2014-11-20 10:13:45 +01:00
mxsimage.mx28.cfg ARM: mxs: tools: Add support for boot progress display flag 2014-11-20 10:13:45 +01: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
spl_lradc_init.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
spl_mem_init.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
spl_power_init.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
start.S SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
timer.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
u-boot-imx23.bd kbuild,mxs: use short logs for MXS images 2014-03-12 17:04:37 -04:00
u-boot-imx28.bd kbuild,mxs: use short logs for MXS images 2014-03-12 17:04:37 -04:00
u-boot-spl.lds linker: Modify linker scripts to be more generic 2019-01-26 22:55:53 -05:00