[PATCH 0/2] Fix AArch32 compilation with Clang

Tom Rini trini at konsulko.com
Thu Nov 6 23:13:55 CET 2025


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
-------------- 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/20251106/4bc2b6bd/attachment.sig>


More information about the U-Boot mailing list