diff mbox series

[1/3] module.bbclass/make-mod-scripts: inhibit default dependencies

Message ID 20260708022856.2087339-2-mark.yang@lge.com
State Changes Requested
Headers show
Series kernel: make the kernel toolchain switchable to clang | expand

Commit Message

mark.yang July 8, 2026, 2:28 a.m. UTC
From: "mark.yang" <mark.yang@lge.com>

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 like kernel.bbclass does.

This also avoids dragging compiler-rt and libcxx into every module
build when TOOLCHAIN is set to clang.

Signed-off-by: mark.yang <mark.yang@lge.com>
---
 meta/classes-recipe/module.bbclass                           | 5 +++++
 meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb | 5 +++++
 2 files changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/meta/classes-recipe/module.bbclass b/meta/classes-recipe/module.bbclass
index 6b2c09f441..a65744d33e 100644
--- a/meta/classes-recipe/module.bbclass
+++ b/meta/classes-recipe/module.bbclass
@@ -6,6 +6,11 @@ 
 
 inherit module-base kernel-module-split pkgconfig
 
+# Modules build with the kernel toolchain against the shared kernel build tree
+# and do not need the default userspace toolchain/libc dependencies.
+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..97521c89e9 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,11 @@  DEV_PKG_DEPENDENCY = ""
 DEPENDS += "bc-native bison-native"
 DEPENDS += "gmp-native"
 
+# The scripts build uses the kernel toolchain against the shared kernel build
+# tree and does not need the default userspace toolchain/libc dependencies.
+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}"