Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH v3 00/13] clang: Add clang C/C++ toolchain
@ 2025-05-23  3:52 Khem Raj
  2025-05-23  3:52 ` [PATCH v3 01/13] toolchain: Provide abstraction for choosing per-recipe toolchain Khem Raj
                   ` (12 more replies)
  0 siblings, 13 replies; 28+ messages in thread
From: Khem Raj @ 2025-05-23  3:52 UTC (permalink / raw)
  To: openembedded-core; +Cc: Khem Raj, Ross Burton

Clang also provided a full fledged C/C++ cross compiler which is
capable of building any C/C++ components.

A mechanism is added to select the toolchain using

TOOLCHAIN = "clang"

in config metadata. This will also add an entry into OVERRIDES
'toolchain-<COMPILER>', e.g. toolchain-clang which can be used
to define clang-specific aspects in metadata.

All packages are not full buildable with clang, e.g. glibc which
rely on some extentions which are only available in gcc. Such
exceptions are made in config metadata using a global file called

meta/conf/distro/include/default-toolchain.inc

This file can be added in every layer to define these details themselves
bitbake will include all such files auotmaticlally.

Defaults are kept as it is, nothing is expected to change if its not
enabled

World builds for qemuarm/qemuarm64/qemuppc/qemumips/qemux86_64
are successful with some exceptions

vulkan-samples - qemuarm64/qemux86-64
bluez - qemuppc
compiler-rt-sanitizers - qemumips

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Changes in v3:
- Split TCOVERRIDE into a separate patch.
- Move toolchain classes into classs/toolchain sub-directory.
- Extend systemd-boot clang fix to glibc as well.
- Link to v2: https://lore.kernel.org/r/20250520-clang-toolchain-v2-0-db97c2eb3756@gmail.com

Changes in v2:
- Move the changed from default-toolchains.inc file into respective recipes
- Drop adding libomp as toolchain-clang dependency for rpm, it will be
  needed when clang is used for rpm, as of now it does not
- Fix musl world builds for qemuarm/qemuarm64/qemuriscv64/qemuriscv32
- Link to v1: https://lore.kernel.org/r/20250518-clang-toolchain-v1-0-5be46f8c4af5@gmail.com

---
Khem Raj (13):
      toolchain: Provide abstraction for choosing per-recipe toolchain
      clang.bbclass: Specify ldso when using usermerge
      vte: Disable gi data generation when using clang on arm
      clang: Add compiler-rt to default deps when using clang compiler
      tcf-agent: Fix ranlib call when using llvm-ranlib
      libjpeg-turbo: Fix build on mips/clang
      pixman: Fix build with mips/clang
      vulkan-samples: Disable overriding-option as error
      bluez: Disable invalid-pp-token warning with clang
      systemtap: Pin to build with GCC
      seatd: Disable sign-compare warning as error on clang
      systemd-boot: Pin to use gcc toolchain on arm
      meta: Add TCOVERRIDE for toolchain selection at recipe scope

 meta/classes-global/base.bbclass                   |  5 ++++
 meta/classes-recipe/cross-canadian.bbclass         |  2 ++
 meta/classes-recipe/cross.bbclass                  |  2 ++
 meta/classes-recipe/crosssdk.bbclass               |  2 ++
 meta/classes-recipe/native.bbclass                 |  2 ++
 meta/classes-recipe/nativesdk.bbclass              |  2 ++
 meta/classes/toolchain/clang-native.bbclass        | 28 ++++++++++++++++++++++
 .../clang.inc => classes/toolchain/clang.bbclass}  | 17 +++++++++----
 .../toolchain/gcc-native.bbclass}                  |  1 -
 .../gcc.inc => classes/toolchain/gcc.bbclass}      |  1 +
 meta/conf/bitbake.conf                             |  7 +++---
 meta/recipes-connectivity/bluez5/bluez5.inc        |  1 +
 meta/recipes-core/seatd/seatd_0.9.1.bb             |  8 +++++++
 meta/recipes-core/systemd/systemd-boot_257.5.bb    |  3 +++
 meta/recipes-devtools/tcf-agent/tcf-agent_git.bb   |  5 ++++
 meta/recipes-graphics/jpeg/libjpeg-turbo_3.1.0.bb  |  6 +++++
 meta/recipes-graphics/vulkan/vulkan-samples_git.bb |  4 ++++
 meta/recipes-graphics/xorg-lib/pixman_0.46.0.bb    |  3 +++
 meta/recipes-kernel/systemtap/systemtap_git.bb     |  4 ++++
 meta/recipes-support/vte/vte_0.78.2.bb             |  4 ++++
 20 files changed, 98 insertions(+), 9 deletions(-)
---
base-commit: caea04becc791316498275f957af9ab28012eea3
change-id: 20250518-clang-toolchain-f9a8a0572306

Best regards,
-- 
Khem Raj <raj.khem@gmail.com>



^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2025-05-29 23:44 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-23  3:52 [PATCH v3 00/13] clang: Add clang C/C++ toolchain Khem Raj
2025-05-23  3:52 ` [PATCH v3 01/13] toolchain: Provide abstraction for choosing per-recipe toolchain Khem Raj
2025-05-29 14:10   ` [OE-core] " Richard Purdie
2025-05-29 23:44   ` Peter Kjellerstedt
2025-05-23  3:52 ` [PATCH v3 02/13] clang.bbclass: Specify ldso when using usermerge Khem Raj
2025-05-23  3:52 ` [PATCH v3 03/13] vte: Disable gi data generation when using clang on arm Khem Raj
2025-05-23  3:52 ` [PATCH v3 04/13] clang: Add compiler-rt to default deps when using clang compiler Khem Raj
2025-05-23  3:52 ` [PATCH v3 05/13] tcf-agent: Fix ranlib call when using llvm-ranlib Khem Raj
2025-05-29  9:20   ` [OE-core] " Richard Purdie
2025-05-29 17:59     ` Khem Raj
2025-05-29 20:15       ` Richard Purdie
2025-05-29 20:47         ` Khem Raj
2025-05-23  3:52 ` [PATCH v3 06/13] libjpeg-turbo: Fix build on mips/clang Khem Raj
2025-05-29  9:22   ` [OE-core] " Richard Purdie
2025-05-29 16:28     ` Khem Raj
2025-05-29 20:26       ` Richard Purdie
2025-05-29 20:48         ` Khem Raj
2025-05-23  3:52 ` [PATCH v3 07/13] pixman: Fix build with mips/clang Khem Raj
2025-05-29  9:23   ` [OE-core] " Richard Purdie
2025-05-29 20:05     ` Khem Raj
2025-05-29  9:24   ` Ross Burton
2025-05-29 20:43     ` Khem Raj
2025-05-23  3:52 ` [PATCH v3 08/13] vulkan-samples: Disable overriding-option as error Khem Raj
2025-05-23  3:52 ` [PATCH v3 09/13] bluez: Disable invalid-pp-token warning with clang Khem Raj
2025-05-23  3:52 ` [PATCH v3 10/13] systemtap: Pin to build with GCC Khem Raj
2025-05-23  3:52 ` [PATCH v3 11/13] seatd: Disable sign-compare warning as error on clang Khem Raj
2025-05-23  3:52 ` [PATCH v3 12/13] systemd-boot: Pin to use gcc toolchain on arm Khem Raj
2025-05-23  3:52 ` [PATCH v3 13/13] meta: Add TCOVERRIDE for toolchain selection at recipe scope Khem Raj

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox