]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
u-boot: always use GCC to build
authorRoss Burton <ross.burton@arm.com>
Tue, 4 Aug 2026 11:41:34 +0000 (12:41 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 4 Aug 2026 11:43:32 +0000 (12:43 +0100)
Previously, u-boot was almost always built with GCC because the
kernel-arch inherit set TOOLCHAIN to KERNEL_TOOLCHAIN, which defaulted
to 'gcc'.

However, since kernel-arch inherit was removed, u-boot in theory now
respects the default toolchain. In practise, the recipe hard-codes CC
to be gcc, and there are known caveats building u-boot with clang[2].

In the long term we should be able to make this recipe respect TOOLCHAIN,
as the upstream u-boot CI does build and test with clang, but for now
fix the build by restoring the explicit use of gcc.

[1] oe-core 8fb5470841b ("u-boot: Separate out from kernel-arch.bbclass")
[2] https://docs.u-boot-project.org/en/latest/build/clang.html

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-bsp/u-boot/u-boot.inc

index 3e2f5aa1a5fa28f59abc27ebf7d466b96a17298b..00a12f1bb9180f34e0573afad5b10c3b1c4e5df2 100644 (file)
@@ -3,6 +3,10 @@ PROVIDES = "virtual/bootloader"
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
+# u-boot is best built with gcc
+# https://docs.u-boot-project.org/en/latest/build/clang.html
+TOOLCHAIN = "gcc"
+
 DEPENDS += "${@bb.utils.contains('UBOOT_ENV_SUFFIX', 'scr', 'u-boot-mkimage-native', '', d)}"
 DEPENDS += "${@ 'u-boot-mkenvimage-native' if bb.utils.to_boolean(d.getVar('UBOOT_INITIAL_ENV_BINARY')) else ''}"