[PATCH 0/2] Fix AArch32 compilation with Clang

Dmitrii Sharshakov d3dx12.xx at gmail.com
Sat Nov 8 21:55:00 CET 2025


Thank you for your reply.

Please review a fix for the aforementioned issue[1] and let me know
whether this enables your
local and CI builds with Clang!

Thank you!

Best regards,
Dmitrii

[1] https://lore.kernel.org/u-boot/20251108-clang-cross-fixes-v1-1-ea6c4282844a@gmail.com/


On Thu, Nov 6, 2025 at 11:13 PM Tom Rini <trini at konsulko.com> wrote:
>
> On Thu, Nov 06, 2025 at 03:57:48PM -0600, Tom Rini wrote:
>
> > On Sat, 01 Nov 2025 10:39:57 +0100, Dmitrii Sharshakov wrote:
> >
> > > I faced some minor compatibility issues when choosing Clang as the cross-compiler for my target.
> > >
> > > Please review these two fixes, aiming at enabling Clang-based builds (still using GNU binutils)
> > > for 32-bit ARM targets.
> > >
> > > Tested to fix build with (also run-tested on qemu arm and arm64 with clang):
> > >
> > > [...]
> >
> > Applied to u-boot/master, thanks!
> >
> > [1/2] arch: arm: build: only set -mgeneral-regs-only for AArch64
> >       commit: e8e3b38def93b5e5d53569961237ce215454e141
> > [2/2] build: fix building u-boot.lds with Clang as a cross-compiler
> >       commit: f7d177395d73f7747373dfd0ef7329834788106e
>
> So, I can replicate your success if I do:
> $ export PATH=${PATH}:/opt/gcc-14.2.0-nolibc/aarch64-linux/bin
> $ make O=/tmp/rpi4 CROSS_COMPILE=aarch64-linux- CC=clang-18 HOSTCC=clang-18 rpi_4_config all
>
> But if I instead use CROSS_COMPILE=/opt/gcc-.../bin/aarch64-linux-
> instead we get /usr/bin/as being used and fail. Any ideas where perhaps
> CROSS_COMPILE isn't being trimmed correctly and passed to clang maybe?
> Thanks!
>
> --
> Tom


More information about the U-Boot mailing list