From: Ross Burton <ross.burton@arm.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH] u-boot: always use GCC to build
Date: Tue, 4 Aug 2026 12:41:34 +0100 [thread overview]
Message-ID: <20260804114134.4028175-1-ross.burton@arm.com> (raw)
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>
---
meta/recipes-bsp/u-boot/u-boot.inc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc
index 3e2f5aa1a5f..00a12f1bb91 100644
--- a/meta/recipes-bsp/u-boot/u-boot.inc
+++ b/meta/recipes-bsp/u-boot/u-boot.inc
@@ -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 ''}"
--
2.43.0
next reply other threads:[~2026-08-04 11:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-04 11:41 Ross Burton [this message]
2026-08-05 1:08 ` [OE-core] [PATCH] u-boot: always use GCC to build Khem Raj
2026-08-05 9:44 ` Ross Burton
2026-08-06 8:20 ` Quentin Schulz
2026-08-06 13:07 ` Ross Burton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260804114134.4028175-1-ross.burton@arm.com \
--to=ross.burton@arm.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox