[PATCH 0/2] Fix AArch32 compilation with Clang

Tom Rini trini at konsulko.com
Tue Nov 11 15:43:08 CET 2025


On Sat, Nov 08, 2025 at 09:55:00PM +0100, Dmitrii Sharshakov wrote:
> 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!

That fixed what I ran in to, thanks!

> 
> 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

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20251111/ff34be01/attachment.sig>


More information about the U-Boot mailing list