Bug 16385 - Enable u-boot build with clang
Summary: Enable u-boot build with clang
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 6.1
Hardware: All Multiple
: Medium enhancement
Target Milestone: 6.1
Assignee: Ross Burton
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2026-08-04 11:45 UTC by Ross Burton
Modified: 2026-09-01 16:00 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
log.do_compile for u-boot (61.69 KB, application/x-gzip)
2026-08-25 20:04 UTC, Jon Mason
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ross Burton 2026-08-04 11:45:46 UTC
Our u-boot recipe only supports gcc, but upstream supports clang (the docs suggest it's harder than it is, as the magic options are enabled by default).  Notable, u-boot CI does clang builds.

So, we should also support clang in the recipe.

This will mean removing the TOOLCHAIN assignment and using generic assignments or overrides for CC etc.
Comment 1 Mathieu Dubois-Briand 2026-08-20 12:31:53 UTC
Ross, can you confirm this is fixed by https://git.openembedded.org/openembedded-core/commit/?id=321421117de088e6b23da9c746d16df0c6081323 ?
Comment 2 Jon Mason 2026-08-25 20:04:06 UTC
Created attachment 5244 [details]
log.do_compile for u-boot
Comment 3 Jon Mason 2026-08-25 20:07:01 UTC
I build qemuarm64 with clang (on the latest commit on the master branch, which contains the commit referenced in comment 1).  I attached the log.do_compile for u-boot.  The log shows clang being used to compile it (though there are some weird references to gcc still in there).  So, I believe this can be closed.
Comment 4 Ross Burton 2026-09-01 16:00:59 UTC
Confirmed, closing.