Skip to content

Clang compatibility improvements for RISC-V

Yao Zi u-boot 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2Makefile: Strip leading spaces when preprocessing generated_defconfigscripts/kconfig/Makefile+1 -07 replies
2/2riscv: Access gd with inline assembly when building with LTO or Clangarch/riscv/cpu/cpu.c arch/riscv/include/asm/global_data.h common/board_r.c +1 more+33 -31 reply

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchLeo Yu-Chi Liang
1/2
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] Clang compatibility improvements for RISC-V

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/[email protected]/
[2]: https://lore.kernel.org/all/[email protected]/

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(-)
Signature · 1 line
2.49.0