From patchwork Tue Jul 14 13:26:40 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "mark.yang" X-Patchwork-Id: 92408 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1F14C43458 for ; Tue, 14 Jul 2026 13:26:52 +0000 (UTC) Received: from lgeamrelo12.lge.com (lgeamrelo12.lge.com [156.147.23.52]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.9432.1784035607377045722 for ; Tue, 14 Jul 2026 06:26:47 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: lge.com, ip: 156.147.23.52, mailfrom: mark.yang@lge.com) Received: from unknown (HELO lgemrelse6q.lge.com) (156.147.1.121) by 156.147.23.52 with ESMTP; 14 Jul 2026 22:26:44 +0900 X-Original-SENDERIP: 156.147.1.121 X-Original-MAILFROM: mark.yang@lge.com Received: from unknown (HELO markyang..) (10.177.127.86) by 156.147.1.121 with ESMTP; 14 Jul 2026 22:26:44 +0900 X-Original-SENDERIP: 10.177.127.86 X-Original-MAILFROM: mark.yang@lge.com From: mark.yang@lge.com To: openembedded-core@lists.openembedded.org Cc: "mark.yang" Subject: [PATCH v2 1/3] kernel-arch: fall back to GNU ld unless ld-is-lld is in DISTRO_FEATURES Date: Tue, 14 Jul 2026 22:26:40 +0900 Message-ID: <20260714132642.2225115-2-mark.yang@lge.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260714132642.2225115-1-mark.yang@lge.com> References: <20260714132642.2225115-1-mark.yang@lge.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 14 Jul 2026 13:26:52 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/240887 From: "mark.yang" Nothing stages a bare ld.lld unless ld-is-lld is in DISTRO_FEATURES, so a clang kernel fails its first linker check on any other setup. Use GNU ld.bfd from binutils-cross instead. Signed-off-by: mark.yang --- v2: new patch; the merged clang support uses a bare ld.lld which nothing stages without ld-is-lld meta/classes-recipe/kernel-arch.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/classes-recipe/kernel-arch.bbclass b/meta/classes-recipe/kernel-arch.bbclass index 6ebc0f13ea..321c9ed577 100644 --- a/meta/classes-recipe/kernel-arch.bbclass +++ b/meta/classes-recipe/kernel-arch.bbclass @@ -88,7 +88,7 @@ KERNEL_CC:toolchain-clang = "${CCACHE}clang ${HOST_CC_KERNEL_ARCH} \ -ffile-prefix-map=${STAGING_KERNEL_DIR}=${KERNEL_SRC_PATH} \ -ffile-prefix-map=${STAGING_KERNEL_BUILDDIR}=${KERNEL_SRC_PATH} \ " -KERNEL_LD:toolchain-clang = "ld.lld ${HOST_LD_KERNEL_ARCH}" +KERNEL_LD:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', 'ld.lld', '${HOST_PREFIX}ld.bfd', d)} ${HOST_LD_KERNEL_ARCH}" KERNEL_AR:toolchain-clang = "llvm-ar ${HOST_AR_KERNEL_ARCH}" KERNEL_OBJCOPY:toolchain-clang = "llvm-objcopy ${HOST_OBJCOPY_KERNEL_ARCH}" KERNEL_STRIP:toolchain-clang = "llvm-strip" From patchwork Tue Jul 14 13:26:41 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "mark.yang" X-Patchwork-Id: 92409 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30252C4450A for ; Tue, 14 Jul 2026 13:26:53 +0000 (UTC) Received: from lgeamrelo11.lge.com (lgeamrelo11.lge.com [156.147.23.51]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.9650.1784035607377518052 for ; Tue, 14 Jul 2026 06:26:48 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: lge.com, ip: 156.147.23.51, mailfrom: mark.yang@lge.com) Received: from unknown (HELO lgemrelse6q.lge.com) (156.147.1.121) by 156.147.23.51 with ESMTP; 14 Jul 2026 22:26:44 +0900 X-Original-SENDERIP: 156.147.1.121 X-Original-MAILFROM: mark.yang@lge.com Received: from unknown (HELO markyang..) (10.177.127.86) by 156.147.1.121 with ESMTP; 14 Jul 2026 22:26:44 +0900 X-Original-SENDERIP: 10.177.127.86 X-Original-MAILFROM: mark.yang@lge.com From: mark.yang@lge.com To: openembedded-core@lists.openembedded.org Cc: "mark.yang" Subject: [PATCH v2 2/3] module.bbclass/make-mod-scripts: inhibit default dependencies Date: Tue, 14 Jul 2026 22:26:41 +0900 Message-ID: <20260714132642.2225115-3-mark.yang@lge.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260714132642.2225115-1-mark.yang@lge.com> References: <20260714132642.2225115-1-mark.yang@lge.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 14 Jul 2026 13:26:53 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/240890 From: "mark.yang" Modules and make-mod-scripts build against the shared kernel build tree with the kernel toolchain, so the default virtual/libc and virtual/compilerlibs dependencies are unused. Inhibit them and add the cross toolchain explicitly, as kernel.bbclass does, which also keeps compiler-rt and libcxx out of module builds with clang. Signed-off-by: mark.yang --- v2: split out of the KERNEL_TOOLCHAIN patch meta/classes-recipe/module.bbclass | 3 +++ meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb | 3 +++ 2 files changed, 6 insertions(+) diff --git a/meta/classes-recipe/module.bbclass b/meta/classes-recipe/module.bbclass index 6b2c09f441..ce5898125b 100644 --- a/meta/classes-recipe/module.bbclass +++ b/meta/classes-recipe/module.bbclass @@ -6,6 +6,9 @@ inherit module-base kernel-module-split pkgconfig +INHIBIT_DEFAULT_DEPS = "1" +DEPENDS += "virtual/cross-cc virtual/cross-binutils" + EXTRA_OEMAKE += "KERNEL_SRC=${STAGING_KERNEL_DIR}" MODULES_INSTALL_TARGET ?= "modules_install" diff --git a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb index 4b0630313f..338a50de91 100644 --- a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb +++ b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb @@ -18,6 +18,9 @@ DEV_PKG_DEPENDENCY = "" DEPENDS += "bc-native bison-native" DEPENDS += "gmp-native" +INHIBIT_DEFAULT_DEPS = "1" +DEPENDS += "virtual/cross-cc virtual/cross-binutils" + EXTRA_OEMAKE = " HOSTCC="${BUILD_CC}" HOSTCFLAGS="${BUILD_CFLAGS}" HOSTLDFLAGS="${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}"" EXTRA_OEMAKE += " HOSTCXX="${BUILD_CXX} ${BUILD_CXXFLAGS} ${BUILD_LDFLAGS}" CROSS_COMPILE=${TARGET_PREFIX}" From patchwork Tue Jul 14 13:26:42 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "mark.yang" X-Patchwork-Id: 92410 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B6F9C44508 for ; Tue, 14 Jul 2026 13:26:53 +0000 (UTC) Received: from lgeamrelo11.lge.com (lgeamrelo11.lge.com [156.147.23.51]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.9431.1784035607119424762 for ; Tue, 14 Jul 2026 06:26:47 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: lge.com, ip: 156.147.23.51, mailfrom: mark.yang@lge.com) Received: from unknown (HELO lgemrelse6q.lge.com) (156.147.1.121) by 156.147.23.51 with ESMTP; 14 Jul 2026 22:26:45 +0900 X-Original-SENDERIP: 156.147.1.121 X-Original-MAILFROM: mark.yang@lge.com Received: from unknown (HELO markyang..) (10.177.127.86) by 156.147.1.121 with ESMTP; 14 Jul 2026 22:26:44 +0900 X-Original-SENDERIP: 10.177.127.86 X-Original-MAILFROM: mark.yang@lge.com From: mark.yang@lge.com To: openembedded-core@lists.openembedded.org Cc: "mark.yang" Subject: [PATCH v2 3/3] kernel-arch: add KERNEL_TOOLCHAIN to switch the whole kernel toolchain Date: Tue, 14 Jul 2026 22:26:42 +0900 Message-ID: <20260714132642.2225115-4-mark.yang@lge.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260714132642.2225115-1-mark.yang@lge.com> References: <20260714132642.2225115-1-mark.yang@lge.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 14 Jul 2026 13:26:53 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/240889 From: "mark.yang" Setting TOOLCHAIN on the kernel recipe alone leaves modules and make-mod-scripts running make against the shared build tree with gcc; kbuild spots the CC_VERSION_TEXT mismatch and silently regenerates the shared .config. Add a KERNEL_TOOLCHAIN switch covering all kernel-arch recipes so they change toolchain together, gcc by default. Signed-off-by: mark.yang --- v2: rebased on the merged clang toolchain support which supersedes the other v1 patches; dependency changes split out into patch 2 meta/classes-recipe/kernel-arch.bbclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta/classes-recipe/kernel-arch.bbclass b/meta/classes-recipe/kernel-arch.bbclass index 321c9ed577..5f8dbacc0c 100644 --- a/meta/classes-recipe/kernel-arch.bbclass +++ b/meta/classes-recipe/kernel-arch.bbclass @@ -92,4 +92,5 @@ KERNEL_LD:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld' KERNEL_AR:toolchain-clang = "llvm-ar ${HOST_AR_KERNEL_ARCH}" KERNEL_OBJCOPY:toolchain-clang = "llvm-objcopy ${HOST_OBJCOPY_KERNEL_ARCH}" KERNEL_STRIP:toolchain-clang = "llvm-strip" -TOOLCHAIN = "gcc" +KERNEL_TOOLCHAIN ?= "gcc" +TOOLCHAIN = "${KERNEL_TOOLCHAIN}"