Yocto Project Summit 2025.12

Why do we need Clang/LLVM
2025-12-04 , Walnascar

Clang compiler recipes have been merged into OE-core layer with 5.3 release. Clang is used directly or indirectly in a lot of cases in Linux stack and increasingly in embedded linux systems. This talk will cover the rationale why it was promoted to OE-core. We will discuss the use cases where it is already used and how it is used.


Clang is another C/C++ compiler in addition to GCC which is now part of OpenEmbedded Core and yocto project users will get it out of box. This talk covers the needed know-how to use it in various capacities e.g. just for one package, system-wide builds with clang. Clang has additional tools which are good to have in the toolbox, eg. LLD is new linker implementation which is blazing fast linking large C++ programs. LibTooling based tools like clang-tidy provide needed checks close to static analyzers and it can be customized, clang-format is a lint'ing tool and clang-scan provides a static analyzer, with meta-clang it can be enabled to generate HTML reports.

Having clang moved out of meta-clang, the question why we still need it, will be answered, there still are distro build policy fragments e.g. LTO, Thin-LTO to enable distro-wide settings. Then there are recipes which need clang explicitly which have moved to different layers e.g. meta-oe but some tweaks still are needed for some cases.

LLVM is now shared across rust compiler, clang compiler and mesa and more use cases to come.

Finally, It will tackle information on building Clang based C/C++ SDKs. There might be more use cases for GPU toolchains in future that involves clang/MLIR which can be enabled in Yocto project.

Khem Raj, is a seasoned OpenSource developer. He has been involved in OpenSource for many years.
He is a Fellow at Comcast, helping several open source initiatives within the company: He is guiding the company's adoption of open source software, and becoming an active contributor to the open source components that are used in the RDK settop software stack. He has migrated RDK to an OE/Yocto-based framework for build system and embedded Linux distribution generation. He is also actively working on making the RDK community adopt the RDK framework for future TVs and CPE devices including broadband gateways and Wireless Access points. He is a Yocto Project advisory board member, and has served on the technical steering Committee for the OpenEmbedded project and Yocto Project. He is core maintainer for several key pieces in OpenEmbedded and yocto project, including core metadata, toolchains, and SDKs.