All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Clang compatibility improvements for RISC-V
@ 2025-04-27 14:50 Yao Zi
  2025-04-27 14:50 ` [PATCH 1/2] Makefile: Strip leading spaces when preprocessing generated_defconfig Yao Zi
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Yao Zi @ 2025-04-27 14:50 UTC (permalink / raw)
  To: Rick Chen, Leo, Tom Rini, Mayuresh Chitale, Anton Blanchard,
	Simon Glass, Ilias Apalodimas, Jerome Forissier, Evgeny Bachinin,
	Heinrich Schuchardt, Christian Marangi, Andrew Davis,
	Nishanth Menon
  Cc: u-boot, Nathaniel Hourt, Yao Zi

Originally reported by Nathaniel Hourt[1], U-Boot fails to boot on
JH7110 platforms (starfive_visionfive2_defconfig) when building with
Clang.

This series fixes configuration generation with Clang's preprocessor and
add an alternative codepath for RISC-V to access gd to workaround
misoptimization of Clang, which is sufficient for building images for
JH7110 boards.

Tested with

- starfive_visionfive2_defconfig
- qemu-riscv64_smode_defconfig
- sifive_unleashed_defconfig

built with either GCC 14 or LLVM 19.

Note that images built with LLVM lld are still broken and binutils ld
has to be used for now. To test the changes on JH7110 platforms, this
patch[2] must be applied for SPL to function.

[1]: https://lore.kernel.org/u-boot/932979cb47c4fded7ac19216ca172504@nathaniel.land/
[2]: https://lore.kernel.org/all/20250330162421.238483-1-heinrich.schuchardt@canonical.com/

Yao Zi (2):
  Makefile: Strip leading spaces when preprocessing generated_defconfig
  riscv: Access gd with inline assembly when building with LTO or Clang

 arch/riscv/cpu/cpu.c                 |  6 ++++++
 arch/riscv/include/asm/global_data.h | 19 +++++++++++++++++++
 common/board_r.c                     |  4 +++-
 common/init/board_init.c             |  7 +++++--
 scripts/kconfig/Makefile             |  1 +
 5 files changed, 34 insertions(+), 3 deletions(-)

-- 
2.49.0


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

end of thread, other threads:[~2025-05-12  9:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-27 14:50 [PATCH 0/2] Clang compatibility improvements for RISC-V Yao Zi
2025-04-27 14:50 ` [PATCH 1/2] Makefile: Strip leading spaces when preprocessing generated_defconfig Yao Zi
2025-04-27 15:19   ` Heinrich Schuchardt
2025-04-27 15:46     ` Yao Zi
2025-04-27 16:16       ` Tom Rini
2025-04-28  3:57         ` Yao Zi
2025-04-28 14:49           ` Tom Rini
2025-04-29 12:31             ` Yao Zi
2025-04-29 19:14               ` Tom Rini
2025-04-27 14:50 ` [PATCH 2/2] riscv: Access gd with inline assembly when building with LTO or Clang Yao Zi
2025-05-12  9:36   ` Leo Liang
2025-05-05 23:35 ` (subset) [PATCH 0/2] Clang compatibility improvements for RISC-V Tom Rini

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.