Openembedded Core Discussions
 help / color / mirror / Atom feed
From: mark.yang@lge.com
To: openembedded-core@lists.openembedded.org
Cc: "mark.yang" <mark.yang@lge.com>
Subject: [OE-core][PATCH 0/3] kernel: make the kernel toolchain switchable to clang
Date: Wed,  8 Jul 2026 11:28:53 +0900	[thread overview]
Message-ID: <20260708022856.2087339-1-mark.yang@lge.com> (raw)

From: "mark.yang" <mark.yang@lge.com>

Building the kernel with clang currently means overriding TOOLCHAIN and
the KERNEL_* variables in a bbappend. The kernel builds, but modules and
make-mod-scripts keep the gcc defaults and run the shared kernel build
tree with the other compiler. kbuild then re-runs syncconfig against the
shared .config and silently drops compiler-dependent options: a
CONFIG_CFI_CLANG kernel loses kCFI as soon as any module is built.
Documentation/kbuild/llvm.rst requires the same toolchain for every make
invocation against one tree.

This series adds a KERNEL_TOOLCHAIN switch so the kernel, modules and
make-mod-scripts move to clang together. gcc remains the default.

Tested on qemux86-64 with clang and gcc: both toolchains
build linux-yocto, make-mod-scripts and cryptodev-module, the shared
.config stays consistent across module builds (also with ld-is-lld),
and core-image-sato boots.

mark.yang (3):
  module.bbclass/make-mod-scripts: inhibit default dependencies
  kernel-yocto: export CLANG_FLAGS for the kconfiglib config audit
  kernel-arch: add KERNEL_TOOLCHAIN for building the kernel with clang

 meta/classes-recipe/kernel-arch.bbclass             | 13 ++++++++++++-
 meta/classes-recipe/kernel-yocto.bbclass            |  7 +++++++
 meta/classes-recipe/module.bbclass                  |  5 +++++
 .../make-mod-scripts/make-mod-scripts_1.0.bb        |  5 +++++
 4 files changed, 29 insertions(+), 1 deletion(-)



             reply	other threads:[~2026-07-08  2:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-08  2:28 mark.yang [this message]
2026-07-08  2:28 ` [OE-core][PATCH 1/3] module.bbclass/make-mod-scripts: inhibit default dependencies mark.yang
2026-07-08  2:28 ` [OE-core][PATCH 2/3] kernel-yocto: export CLANG_FLAGS for the kconfiglib config audit mark.yang
2026-07-08  2:28 ` [OE-core][PATCH 3/3] kernel-arch: add KERNEL_TOOLCHAIN for building the kernel with clang mark.yang
2026-07-08  2:37 ` [OE-core][PATCH 0/3] kernel: make the kernel toolchain switchable to clang Bruce Ashfield
2026-07-08  2:44   ` [PATCH " mark.yang

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=20260708022856.2087339-1-mark.yang@lge.com \
    --to=mark.yang@lge.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