* [PATCH v5 01/15] linux-yocto: conditionally add clang/rust/bindgen-cli-native to DEPENDS
2026-01-29 16:38 [PATCH v5 00/15] Enable rust support for linux kernel Harish.Sadineni
@ 2026-01-29 16:38 ` Harish.Sadineni
2026-01-29 16:38 ` [PATCH v5 02/15] rust: install Rust library sources for 'make rustavailable' support Harish.Sadineni
` (16 subsequent siblings)
17 siblings, 0 replies; 33+ messages in thread
From: Harish.Sadineni @ 2026-01-29 16:38 UTC (permalink / raw)
To: openembedded-core
Cc: Randy.MacLeod, Sundeep.Kokkonda, alistair.francis, bruce.ashfield,
yoann.congal, elmehdi.younes, richard.purdie
From: Harish Sadineni <Harish.Sadineni@windriver.com>
Conditionally add 'clang-native', 'rust-native' and 'bindgen-cli-native' to 'DEPENDS'
when rust-kernel distro feature is enabled to support Rust-based kernel modules or
features that require generating Rust FFI bindings using bindgen during the kernel
build process.
Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
meta/recipes-kernel/linux/linux-yocto.inc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/meta/recipes-kernel/linux/linux-yocto.inc b/meta/recipes-kernel/linux/linux-yocto.inc
index 4d0a726bb6..41b12b6f14 100644
--- a/meta/recipes-kernel/linux/linux-yocto.inc
+++ b/meta/recipes-kernel/linux/linux-yocto.inc
@@ -81,6 +81,8 @@ KERNEL_DEBUG ?= ""
DEPENDS += '${@bb.utils.contains_any("ARCH", [ "x86", "arm64", "powerpc" ], "elfutils-native", "", d)}'
DEPENDS += "openssl-native util-linux-native"
DEPENDS += "gmp-native libmpc-native"
+RUST_KERNEL_DEPENDS ?= "${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', 'clang-native rust-native bindgen-cli-native', '', d)}"
+DEPENDS += "${RUST_KERNEL_DEPENDS}"
# Some options depend on CONFIG_PAHOLE_VERSION, so need to make pahole-native available before do_kernel_configme
do_kernel_configme[depends] += '${@bb.utils.contains("KERNEL_DEBUG", "True", "pahole-native:do_populate_sysroot", "", d)}'
--
2.49.0
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH v5 02/15] rust: install Rust library sources for 'make rustavailable' support
2026-01-29 16:38 [PATCH v5 00/15] Enable rust support for linux kernel Harish.Sadineni
2026-01-29 16:38 ` [PATCH v5 01/15] linux-yocto: conditionally add clang/rust/bindgen-cli-native to DEPENDS Harish.Sadineni
@ 2026-01-29 16:38 ` Harish.Sadineni
2026-01-29 16:38 ` [PATCH v5 03/15] kernel-yocto: enable Rust kernel support via 'make rustavailable' Harish.Sadineni
` (15 subsequent siblings)
17 siblings, 0 replies; 33+ messages in thread
From: Harish.Sadineni @ 2026-01-29 16:38 UTC (permalink / raw)
To: openembedded-core
Cc: Randy.MacLeod, Sundeep.Kokkonda, alistair.francis, bruce.ashfield,
yoann.congal, elmehdi.younes, richard.purdie
From: Harish Sadineni <Harish.Sadineni@windriver.com>
The `make rustavailable` process (1) expects the Rust standard library source files (e.g., `lib.rs`)
to be present in the `library/` directory under `rustlib/src/rust/`.
This patch ensures the required sources are available by:
- Installing the `library/` directory (of size ~50MB) into `${D}${libdir}/rustlib/src/rust` for
making them available during `make rustavailable` for native, target & sdk.
- packaging `${libdir}/rustlib/src/rust` sepearately with `${PN}-src-lib`.
1) See the kernel tree for Documentation/rust/quick-start.rst in the section: Requirements: Building
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/rust/quick-start.rst#n145
Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
meta/recipes-devtools/rust/rust_1.92.0.bb | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/meta/recipes-devtools/rust/rust_1.92.0.bb b/meta/recipes-devtools/rust/rust_1.92.0.bb
index a25f65f674..0e9d21ff21 100644
--- a/meta/recipes-devtools/rust/rust_1.92.0.bb
+++ b/meta/recipes-devtools/rust/rust_1.92.0.bb
@@ -264,10 +264,11 @@ do_test_compile () {
ALLOW_EMPTY:${PN} = "1"
-PACKAGES =+ "${PN}-rustdoc ${PN}-tools-clippy ${PN}-tools-rustfmt"
+PACKAGES =+ "${PN}-rustdoc ${PN}-tools-clippy ${PN}-tools-rustfmt ${PN}-src-lib"
FILES:${PN}-rustdoc = "${bindir}/rustdoc"
FILES:${PN}-tools-clippy = "${bindir}/cargo-clippy ${bindir}/clippy-driver"
FILES:${PN}-tools-rustfmt = "${bindir}/rustfmt"
+FILES:${PN}-src-lib = "${libdir}/rustlib/src/rust"
RDEPENDS:${PN}-rustdoc = "${PN}"
RDEPENDS:${PN}-tools-clippy = "${PN}"
@@ -284,6 +285,12 @@ rust_do_install() {
rust_runx install
}
+rust_do_install:append:class-native() {
+ install -d ${D}${libdir}/rustlib/src/rust
+ cp -r ${S}/library ${D}${libdir}/rustlib/src/rust
+ find ${D}${libdir}/rustlib/src/rust/ -name "*.sh" -type f -delete
+}
+
rust_do_install:class-nativesdk() {
export PSEUDO_UNLOAD=1
rust_runx install
@@ -314,6 +321,11 @@ rust_do_install:class-nativesdk() {
export CARGO_TARGET_${RUST_HOST_TRIPLE}_RUNNER="\$OECORE_NATIVE_SYSROOT/lib/${SDKLOADER}"
export CC_$RUST_HOST_CC="${CCACHE}${HOST_PREFIX}gcc"
EOF
+
+ install -d ${D}${libdir}/rustlib/src/rust
+ cp -r ${S}/library ${D}${libdir}/rustlib/src/rust
+ find ${D}${libdir}/rustlib/src/rust/ -name "*.sh" -type f -delete
+
}
FILES:${PN} += "${base_prefix}/environment-setup.d"
@@ -334,6 +346,11 @@ rust_do_install:class-target() {
install -d ${D}${libdir}/rustlib/${RUST_HOST_SYS}
install -m 0644 ${WORKDIR}/rust-targets/${RUST_HOST_SYS}.json ${D}${libdir}/rustlib/${RUST_HOST_SYS}/target.json
+ install -d ${D}${libdir}/rustlib/src/rust
+ cp -r ${S}/library ${D}${libdir}/rustlib/src/rust
+ find ${D}${libdir}/rustlib/src/rust -name "*.sh" -type f -delete
+ install -m 0644 ${WORKDIR}/rust-targets/${RUST_HOST_SYS}.json ${D}${libdir}/rustlib/${RUST_HOST_SYS}/${RUST_HOST_SYS}.json
+
chown root:root ${D}/ -R
rm ${D}${libdir}/rustlib/uninstall.sh
--
2.49.0
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH v5 03/15] kernel-yocto: enable Rust kernel support via 'make rustavailable'.
2026-01-29 16:38 [PATCH v5 00/15] Enable rust support for linux kernel Harish.Sadineni
2026-01-29 16:38 ` [PATCH v5 01/15] linux-yocto: conditionally add clang/rust/bindgen-cli-native to DEPENDS Harish.Sadineni
2026-01-29 16:38 ` [PATCH v5 02/15] rust: install Rust library sources for 'make rustavailable' support Harish.Sadineni
@ 2026-01-29 16:38 ` Harish.Sadineni
2026-01-29 16:38 ` [PATCH v5 04/15] linux-yocto: enable Rust support in kernel configuration Harish.Sadineni
` (14 subsequent siblings)
17 siblings, 0 replies; 33+ messages in thread
From: Harish.Sadineni @ 2026-01-29 16:38 UTC (permalink / raw)
To: openembedded-core
Cc: Randy.MacLeod, Sundeep.Kokkonda, alistair.francis, bruce.ashfield,
yoann.congal, elmehdi.younes, richard.purdie
From: Harish Sadineni <Harish.Sadineni@windriver.com>
This change adds support for Rust-enabled kernel builds by:
-Extending do_kernel_configme dependencies to include rust-native,
clang-native, and bindgen-cli-native.
-Invoking make rustavailable during do_kernel_configme() to prepare the
kernel build environment for Rust.
Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
meta/classes-recipe/kernel-yocto.bbclass | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/meta/classes-recipe/kernel-yocto.bbclass b/meta/classes-recipe/kernel-yocto.bbclass
index e53bf15194..4323c4c80a 100644
--- a/meta/classes-recipe/kernel-yocto.bbclass
+++ b/meta/classes-recipe/kernel-yocto.bbclass
@@ -463,8 +463,14 @@ do_kernel_configme[depends] += "virtual/cross-binutils:do_populate_sysroot"
do_kernel_configme[depends] += "virtual/cross-cc:do_populate_sysroot"
do_kernel_configme[depends] += "bc-native:do_populate_sysroot bison-native:do_populate_sysroot"
do_kernel_configme[depends] += "kern-tools-native:do_populate_sysroot"
+RUST_KERNEL_TASK_DEPENDS ?= "${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', ' \
+ rust-native:do_populate_sysroot \
+ clang-native:do_populate_sysroot \
+ bindgen-cli-native:do_populate_sysroot', '', d)}"
+do_kernel_configme[depends] += "${RUST_KERNEL_TASK_DEPENDS}"
do_kernel_configme[dirs] += "${S} ${B}"
do_kernel_configme() {
+
do_kernel_metadata config
# translate the kconfig_mode into something that merge_config.sh
@@ -506,6 +512,10 @@ do_kernel_configme() {
echo "# Global settings from linux recipe" >> ${B}/.config
echo "CONFIG_LOCALVERSION="\"${LINUX_VERSION_EXTENSION}\" >> ${B}/.config
fi
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', 'true', 'false', d)}; then
+ oe_runmake -C ${S} O=${B} rustavailable
+ fi
}
addtask kernel_configme before do_configure after do_patch
--
2.49.0
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH v5 04/15] linux-yocto: enable Rust support in kernel configuration
2026-01-29 16:38 [PATCH v5 00/15] Enable rust support for linux kernel Harish.Sadineni
` (2 preceding siblings ...)
2026-01-29 16:38 ` [PATCH v5 03/15] kernel-yocto: enable Rust kernel support via 'make rustavailable' Harish.Sadineni
@ 2026-01-29 16:38 ` Harish.Sadineni
2026-01-29 16:39 ` [PATCH v5 05/15] kernel-yocto: Fix for buildpaths errors when rust is enabled for kernel Harish.Sadineni
` (13 subsequent siblings)
17 siblings, 0 replies; 33+ messages in thread
From: Harish.Sadineni @ 2026-01-29 16:38 UTC (permalink / raw)
To: openembedded-core
Cc: Randy.MacLeod, Sundeep.Kokkonda, alistair.francis, bruce.ashfield,
yoann.congal, elmehdi.younes, richard.purdie
From: Harish Sadineni <Harish.Sadineni@windriver.com>
Add initial support for building the Linux kernel with Rust enabled:
- Update `linux-yocto_${PV}.bb` to:
- Append `features/kernel-rust/kernel-rust.scc` to `KERNEL_FEATURES`.
Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
meta/recipes-kernel/linux/linux-yocto_6.16.bb | 1 +
meta/recipes-kernel/linux/linux-yocto_6.18.bb | 1 +
2 files changed, 2 insertions(+)
diff --git a/meta/recipes-kernel/linux/linux-yocto_6.16.bb b/meta/recipes-kernel/linux/linux-yocto_6.16.bb
index 408f14b451..e468fdc0d7 100644
--- a/meta/recipes-kernel/linux/linux-yocto_6.16.bb
+++ b/meta/recipes-kernel/linux/linux-yocto_6.16.bb
@@ -77,3 +77,4 @@ KERNEL_FEATURES:append:powerpc64le = " arch/powerpc/powerpc-debug.scc"
# Check again during next major version upgrade
KERNEL_FEATURES:remove:riscv32 = "features/debug/debug-kernel.scc"
INSANE_SKIP:kernel-vmlinux:qemuppc64 = "textrel"
+KERNEL_FEATURES:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', ' features/kernel-rust/kernel-rust.scc', '', d)}"
diff --git a/meta/recipes-kernel/linux/linux-yocto_6.18.bb b/meta/recipes-kernel/linux/linux-yocto_6.18.bb
index 599a3d13b8..3c2bf02221 100644
--- a/meta/recipes-kernel/linux/linux-yocto_6.18.bb
+++ b/meta/recipes-kernel/linux/linux-yocto_6.18.bb
@@ -77,3 +77,4 @@ KERNEL_FEATURES:append:powerpc64le = " arch/powerpc/powerpc-debug.scc"
# Check again during next major version upgrade
KERNEL_FEATURES:remove:riscv32 = "features/debug/debug-kernel.scc"
INSANE_SKIP:kernel-vmlinux:qemuppc64 = "textrel"
+KERNEL_FEATURES:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', ' features/kernel-rust/kernel-rust.scc', '', d)}"
--
2.49.0
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH v5 05/15] kernel-yocto: Fix for buildpaths errors when rust is enabled for kernel
2026-01-29 16:38 [PATCH v5 00/15] Enable rust support for linux kernel Harish.Sadineni
` (3 preceding siblings ...)
2026-01-29 16:38 ` [PATCH v5 04/15] linux-yocto: enable Rust support in kernel configuration Harish.Sadineni
@ 2026-01-29 16:39 ` Harish.Sadineni
2026-02-04 12:03 ` [OE-core] " Paul Barker
2026-01-29 16:39 ` [PATCH v5 06/15] make-mod-scripts: split `HOSTCC` flag to align with to linux-yocto Harish.Sadineni
` (12 subsequent siblings)
17 siblings, 1 reply; 33+ messages in thread
From: Harish.Sadineni @ 2026-01-29 16:39 UTC (permalink / raw)
To: openembedded-core
Cc: Randy.MacLeod, Sundeep.Kokkonda, alistair.francis, bruce.ashfield,
yoann.congal, elmehdi.younes, richard.purdie
From: Harish Sadineni <Harish.Sadineni@windriver.com>
Fixes for buildpaths errors after enabling rust for linux-kernel
Co-authored-by: El Mehdi YOUNES <elmehdi.younes@smile.fr>
Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
meta/classes-recipe/kernel-yocto.bbclass | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/meta/classes-recipe/kernel-yocto.bbclass b/meta/classes-recipe/kernel-yocto.bbclass
index 4323c4c80a..cd5daaf33b 100644
--- a/meta/classes-recipe/kernel-yocto.bbclass
+++ b/meta/classes-recipe/kernel-yocto.bbclass
@@ -4,6 +4,8 @@
# SPDX-License-Identifier: MIT
#
+INHERIT:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', ' rust-common', '', d)}"
+
# remove tasks that modify the source tree in case externalsrc is inherited
SRCTREECOVEREDTASKS += "do_validate_branches do_kernel_configcheck do_kernel_checkout do_fetch do_unpack do_patch"
PATCH_GIT_USER_EMAIL ?= "kernel-yocto@oe"
@@ -27,6 +29,11 @@ KMETA_AUDIT ?= "yes"
KMETA_AUDIT_WERROR ?= ""
KMETA_CONFIG_FEATURES ?= ""
+RUST_DEBUG_REMAP = "${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', '--remap-path-prefix=${WORKDIR}=${TARGET_DBGSRC_DIR} \
+ --remap-path-prefix=${TMPDIR}/work-shared=${TARGET_DBGSRC_DIR}', '',d)}"
+KRUSTFLAGS:append = " ${RUST_DEBUG_REMAP}"
+EXTRA_OEMAKE:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', ' KRUSTFLAGS="${KRUSTFLAGS}"', '',d)}"
+
# returns local (absolute) path names for all valid patches in the
# src_uri
def find_patches(d,subdir):
--
2.49.0
^ permalink raw reply related [flat|nested] 33+ messages in thread* Re: [OE-core] [PATCH v5 05/15] kernel-yocto: Fix for buildpaths errors when rust is enabled for kernel
2026-01-29 16:39 ` [PATCH v5 05/15] kernel-yocto: Fix for buildpaths errors when rust is enabled for kernel Harish.Sadineni
@ 2026-02-04 12:03 ` Paul Barker
0 siblings, 0 replies; 33+ messages in thread
From: Paul Barker @ 2026-02-04 12:03 UTC (permalink / raw)
To: Harish.Sadineni, openembedded-core
Cc: Randy.MacLeod, Sundeep.Kokkonda, alistair.francis, bruce.ashfield,
yoann.congal, elmehdi.younes, richard.purdie
[-- Attachment #1: Type: text/plain, Size: 1970 bytes --]
On Thu, 2026-01-29 at 08:39 -0800, Sadineni, Harish via
lists.openembedded.org wrote:
> From: Harish Sadineni <Harish.Sadineni@windriver.com>
>
> Fixes for buildpaths errors after enabling rust for linux-kernel
>
> Co-authored-by: El Mehdi YOUNES <elmehdi.younes@smile.fr>
> Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
The commit message here should explain the introduction of KRUSTFLAGS.
> ---
> meta/classes-recipe/kernel-yocto.bbclass | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/meta/classes-recipe/kernel-yocto.bbclass b/meta/classes-recipe/kernel-yocto.bbclass
> index 4323c4c80a..cd5daaf33b 100644
> --- a/meta/classes-recipe/kernel-yocto.bbclass
> +++ b/meta/classes-recipe/kernel-yocto.bbclass
> @@ -4,6 +4,8 @@
> # SPDX-License-Identifier: MIT
> #
>
> +INHERIT:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', ' rust-common', '', d)}"
> +
We should be able to use inherit_defer here instead of modifying
INHERIT.
> # remove tasks that modify the source tree in case externalsrc is inherited
> SRCTREECOVEREDTASKS += "do_validate_branches do_kernel_configcheck do_kernel_checkout do_fetch do_unpack do_patch"
> PATCH_GIT_USER_EMAIL ?= "kernel-yocto@oe"
> @@ -27,6 +29,11 @@ KMETA_AUDIT ?= "yes"
> KMETA_AUDIT_WERROR ?= ""
> KMETA_CONFIG_FEATURES ?= ""
>
> +RUST_DEBUG_REMAP = "${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', '--remap-path-prefix=${WORKDIR}=${TARGET_DBGSRC_DIR} \
> + --remap-path-prefix=${TMPDIR}/work-shared=${TARGET_DBGSRC_DIR}', '',d)}"
> +KRUSTFLAGS:append = " ${RUST_DEBUG_REMAP}"
Why do we use :append here?
> +EXTRA_OEMAKE:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', ' KRUSTFLAGS="${KRUSTFLAGS}"', '',d)}"
> +
> # returns local (absolute) path names for all valid patches in the
> # src_uri
> def find_patches(d,subdir):
Best regards,
--
Paul Barker
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* [PATCH v5 06/15] make-mod-scripts: split `HOSTCC` flag to align with to linux-yocto
2026-01-29 16:38 [PATCH v5 00/15] Enable rust support for linux kernel Harish.Sadineni
` (4 preceding siblings ...)
2026-01-29 16:39 ` [PATCH v5 05/15] kernel-yocto: Fix for buildpaths errors when rust is enabled for kernel Harish.Sadineni
@ 2026-01-29 16:39 ` Harish.Sadineni
2026-01-29 16:39 ` [PATCH v5 07/15] kernel-yocto.bbclass: Disable ccache when rust-kernel is enabled Harish.Sadineni
` (11 subsequent siblings)
17 siblings, 0 replies; 33+ messages in thread
From: Harish.Sadineni @ 2026-01-29 16:39 UTC (permalink / raw)
To: openembedded-core
Cc: Randy.MacLeod, Sundeep.Kokkonda, alistair.francis, bruce.ashfield,
yoann.congal, elmehdi.younes, richard.purdie
From: Harish Sadineni <Harish.Sadineni@windriver.com>
when compiling rust-out-of-tree module recipe 'make-mod-scripts' failing
with the following error:
HOSTRUSTC scripts/generate_rust_target
error: Unrecognized option: 'i'
This issue occurs because CFLAGS are being passed to HOSTRUSTC.
Updated the flags in the make-mod-scripts recipe to align with
the flags used by linux-yocto.
Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 8fcb5e6eb3..874e16e642 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,7 +18,7 @@ DEV_PKG_DEPENDENCY = ""
DEPENDS += "bc-native bison-native"
DEPENDS += "gmp-native"
-EXTRA_OEMAKE = " HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}""
+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}"
KERNEL_LOCALVERSION = "${@get_kernellocalversion_file("${STAGING_KERNEL_BUILDDIR}")}"
--
2.49.0
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH v5 07/15] kernel-yocto.bbclass: Disable ccache when rust-kernel is enabled
2026-01-29 16:38 [PATCH v5 00/15] Enable rust support for linux kernel Harish.Sadineni
` (5 preceding siblings ...)
2026-01-29 16:39 ` [PATCH v5 06/15] make-mod-scripts: split `HOSTCC` flag to align with to linux-yocto Harish.Sadineni
@ 2026-01-29 16:39 ` Harish.Sadineni
2026-02-04 12:05 ` [OE-core] " Paul Barker
2026-01-29 16:39 ` [PATCH v5 08/15] kernel-devsrc: copying rust-kernel source to $kerneldir/build Harish.Sadineni
` (10 subsequent siblings)
17 siblings, 1 reply; 33+ messages in thread
From: Harish.Sadineni @ 2026-01-29 16:39 UTC (permalink / raw)
To: openembedded-core
Cc: Randy.MacLeod, Sundeep.Kokkonda, alistair.francis, bruce.ashfield,
yoann.congal, elmehdi.younes, richard.purdie
From: Yoann Congal <yoann.congal@smile.fr>
Currently, a ccache enabled build fails with:
| HOSTRUSTC scripts/generate_rust_target
| HOSTCC scripts/kallsyms
| HOSTCC scripts/sorttable
| HOSTCC scripts/asn1_compiler
| TOUCH include/generated/gcc-plugins.h
| DESCEND objtool
| error: multiple input filenames provided (first two filenames are gcc and
.../tmp/work-shared/qemux86-64/kernel-source/scripts/generate_rust_target.rs)
when using ccache, value of "HOSTCC=cache gcc" when this value is passing
to rustc, It is thinking gcc is a input file. when ccache is not used "HOSTCC=gcc" is passed.
Disable ccache for kernel build if rust-kernel is enabled to workaround
this.
Signed-off-by: El Mehdi YOUNES <elmehdi.younes@smile.fr>
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
meta/classes-recipe/kernel-yocto.bbclass | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/meta/classes-recipe/kernel-yocto.bbclass b/meta/classes-recipe/kernel-yocto.bbclass
index cd5daaf33b..bfdafbee8c 100644
--- a/meta/classes-recipe/kernel-yocto.bbclass
+++ b/meta/classes-recipe/kernel-yocto.bbclass
@@ -34,6 +34,11 @@ RUST_DEBUG_REMAP = "${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', '--re
KRUSTFLAGS:append = " ${RUST_DEBUG_REMAP}"
EXTRA_OEMAKE:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', ' KRUSTFLAGS="${KRUSTFLAGS}"', '',d)}"
+# TODO: rust-kernel enabled kernel fails to build with:
+# | error: multiple input filenames provided (first two filenames are gcc and .../tmp/work-shared/qemux86-64/kernel-source/scripts/generate_rust_target.rs)
+# Disable ccache for kernel build if rust-kernel is enabled to workaround this.
+CCACHE_DISABLE ?= "${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', '1', '0', d)}"
+
# returns local (absolute) path names for all valid patches in the
# src_uri
def find_patches(d,subdir):
--
2.49.0
^ permalink raw reply related [flat|nested] 33+ messages in thread* Re: [OE-core] [PATCH v5 07/15] kernel-yocto.bbclass: Disable ccache when rust-kernel is enabled
2026-01-29 16:39 ` [PATCH v5 07/15] kernel-yocto.bbclass: Disable ccache when rust-kernel is enabled Harish.Sadineni
@ 2026-02-04 12:05 ` Paul Barker
2026-02-04 12:31 ` Yoann Congal
0 siblings, 1 reply; 33+ messages in thread
From: Paul Barker @ 2026-02-04 12:05 UTC (permalink / raw)
To: Harish.Sadineni, openembedded-core
Cc: Randy.MacLeod, Sundeep.Kokkonda, alistair.francis, bruce.ashfield,
yoann.congal, elmehdi.younes, richard.purdie
[-- Attachment #1: Type: text/plain, Size: 1282 bytes --]
On Thu, 2026-01-29 at 08:39 -0800, Sadineni, Harish via
lists.openembedded.org wrote:
> From: Yoann Congal <yoann.congal@smile.fr>
>
> Currently, a ccache enabled build fails with:
> | HOSTRUSTC scripts/generate_rust_target
> | HOSTCC scripts/kallsyms
> | HOSTCC scripts/sorttable
> | HOSTCC scripts/asn1_compiler
> | TOUCH include/generated/gcc-plugins.h
> | DESCEND objtool
> | error: multiple input filenames provided (first two filenames are gcc and
> .../tmp/work-shared/qemux86-64/kernel-source/scripts/generate_rust_target.rs)
>
> when using ccache, value of "HOSTCC=cache gcc" when this value is passing
> to rustc, It is thinking gcc is a input file. when ccache is not used "HOSTCC=gcc" is passed.
>
> Disable ccache for kernel build if rust-kernel is enabled to workaround
> this.
>
> Signed-off-by: El Mehdi YOUNES <elmehdi.younes@smile.fr>
> Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
> Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
This patch is good, but we should try to get the issue resolved upstream
if we can so that ccache can be used.
Has this been reported upstream yet? Could you also open a bug in our
bugzilla to track this?
Best regards,
--
Paul Barker
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [OE-core] [PATCH v5 07/15] kernel-yocto.bbclass: Disable ccache when rust-kernel is enabled
2026-02-04 12:05 ` [OE-core] " Paul Barker
@ 2026-02-04 12:31 ` Yoann Congal
2026-02-04 12:34 ` Richard Purdie
0 siblings, 1 reply; 33+ messages in thread
From: Yoann Congal @ 2026-02-04 12:31 UTC (permalink / raw)
To: Paul Barker, Harish.Sadineni, openembedded-core
Cc: Randy.MacLeod, Sundeep.Kokkonda, alistair.francis, bruce.ashfield,
elmehdi.younes, richard.purdie
On Wed Feb 4, 2026 at 1:05 PM CET, Paul Barker wrote:
> On Thu, 2026-01-29 at 08:39 -0800, Sadineni, Harish via
> lists.openembedded.org wrote:
>> From: Yoann Congal <yoann.congal@smile.fr>
>>
>> Currently, a ccache enabled build fails with:
>> | HOSTRUSTC scripts/generate_rust_target
>> | HOSTCC scripts/kallsyms
>> | HOSTCC scripts/sorttable
>> | HOSTCC scripts/asn1_compiler
>> | TOUCH include/generated/gcc-plugins.h
>> | DESCEND objtool
>> | error: multiple input filenames provided (first two filenames are gcc and
>> .../tmp/work-shared/qemux86-64/kernel-source/scripts/generate_rust_target.rs)
>>
>> when using ccache, value of "HOSTCC=cache gcc" when this value is passing
>> to rustc, It is thinking gcc is a input file. when ccache is not used "HOSTCC=gcc" is passed.
>>
>> Disable ccache for kernel build if rust-kernel is enabled to workaround
>> this.
>>
>> Signed-off-by: El Mehdi YOUNES <elmehdi.younes@smile.fr>
>> Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
>> Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
>
> This patch is good, but we should try to get the issue resolved upstream
> if we can so that ccache can be used.
>
> Has this been reported upstream yet? Could you also open a bug in our
> bugzilla to track this?
Hello,
For context, a lengthy discussion happened on this patch here:
https://lore.kernel.org/openembedded-core/CA+TGqK9Yd2WWKrhMkhofF-8N0cESCSefWD2DXr4sBO9fDQXyrg@mail.gmail.com/t/#u
And, sadly, we lack resources at the moment on our side to follow-up on this :-/
Regards,
--
Yoann Congal
Smile ECS
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [OE-core] [PATCH v5 07/15] kernel-yocto.bbclass: Disable ccache when rust-kernel is enabled
2026-02-04 12:31 ` Yoann Congal
@ 2026-02-04 12:34 ` Richard Purdie
2026-02-04 13:07 ` Yoann Congal
0 siblings, 1 reply; 33+ messages in thread
From: Richard Purdie @ 2026-02-04 12:34 UTC (permalink / raw)
To: Yoann Congal, Paul Barker, Harish.Sadineni, openembedded-core
Cc: Randy.MacLeod, Sundeep.Kokkonda, alistair.francis, bruce.ashfield,
elmehdi.younes
On Wed, 2026-02-04 at 13:31 +0100, Yoann Congal wrote:
> On Wed Feb 4, 2026 at 1:05 PM CET, Paul Barker wrote:
> > On Thu, 2026-01-29 at 08:39 -0800, Sadineni, Harish via
> > lists.openembedded.org wrote:
> > > From: Yoann Congal <yoann.congal@smile.fr>
> > >
> > > Currently, a ccache enabled build fails with:
> > > | HOSTRUSTC scripts/generate_rust_target
> > > | HOSTCC scripts/kallsyms
> > > | HOSTCC scripts/sorttable
> > > | HOSTCC scripts/asn1_compiler
> > > | TOUCH include/generated/gcc-plugins.h
> > > | DESCEND objtool
> > > | error: multiple input filenames provided (first two filenames are gcc and
> > > .../tmp/work-shared/qemux86-64/kernel-source/scripts/generate_rust_target.rs)
> > >
> > > when using ccache, value of "HOSTCC=cache gcc" when this value is passing
> > > to rustc, It is thinking gcc is a input file. when ccache is not used "HOSTCC=gcc" is passed.
> > >
> > > Disable ccache for kernel build if rust-kernel is enabled to workaround
> > > this.
> > >
> > > Signed-off-by: El Mehdi YOUNES <elmehdi.younes@smile.fr>
> > > Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
> > > Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
> >
> > This patch is good, but we should try to get the issue resolved upstream
> > if we can so that ccache can be used.
> >
> > Has this been reported upstream yet? Could you also open a bug in our
> > bugzilla to track this?
>
> Hello,
>
> For context, a lengthy discussion happened on this patch here:
> https://lore.kernel.org/openembedded-core/CA+TGqK9Yd2WWKrhMkhofF-8N0cESCSefWD2DXr4sBO9fDQXyrg@mail.gmail.com/t/#u
>
> And, sadly, we lack resources at the moment on our side to follow-up on this :-/
Putting some links alongside this to more details would probably at
least help a bit, particularly if ccache upstream documents it is
imcompatible with rust...
Cheers,
Richard
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [OE-core] [PATCH v5 07/15] kernel-yocto.bbclass: Disable ccache when rust-kernel is enabled
2026-02-04 12:34 ` Richard Purdie
@ 2026-02-04 13:07 ` Yoann Congal
2026-02-10 15:24 ` Yoann Congal
0 siblings, 1 reply; 33+ messages in thread
From: Yoann Congal @ 2026-02-04 13:07 UTC (permalink / raw)
To: Richard Purdie
Cc: Paul Barker, Harish.Sadineni, openembedded-core, Randy.MacLeod,
Sundeep.Kokkonda, alistair.francis, bruce.ashfield,
elmehdi.younes
[-- Attachment #1: Type: text/plain, Size: 2290 bytes --]
Le mer. 4 févr. 2026 à 13:34, Richard Purdie <
richard.purdie@linuxfoundation.org> a écrit :
> On Wed, 2026-02-04 at 13:31 +0100, Yoann Congal wrote:
> > On Wed Feb 4, 2026 at 1:05 PM CET, Paul Barker wrote:
> > > On Thu, 2026-01-29 at 08:39 -0800, Sadineni, Harish via
> > > lists.openembedded.org wrote:
> > > > From: Yoann Congal <yoann.congal@smile.fr>
> > > >
> > > > Currently, a ccache enabled build fails with:
> > > > | HOSTRUSTC scripts/generate_rust_target
> > > > | HOSTCC scripts/kallsyms
> > > > | HOSTCC scripts/sorttable
> > > > | HOSTCC scripts/asn1_compiler
> > > > | TOUCH include/generated/gcc-plugins.h
> > > > | DESCEND objtool
> > > > | error: multiple input filenames provided (first two filenames
> are gcc and
> > > >
> .../tmp/work-shared/qemux86-64/kernel-source/scripts/generate_rust_target.rs)
> > > >
> > > > when using ccache, value of "HOSTCC=cache gcc" when this value is
> passing
> > > > to rustc, It is thinking gcc is a input file. when ccache is not
> used "HOSTCC=gcc" is passed.
> > > >
> > > > Disable ccache for kernel build if rust-kernel is enabled to
> workaround
> > > > this.
> > > >
> > > > Signed-off-by: El Mehdi YOUNES <elmehdi.younes@smile.fr>
> > > > Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
> > > > Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
> > >
> > > This patch is good, but we should try to get the issue resolved
> upstream
> > > if we can so that ccache can be used.
> > >
> > > Has this been reported upstream yet? Could you also open a bug in our
> > > bugzilla to track this?
> >
> > Hello,
> >
> > For context, a lengthy discussion happened on this patch here:
> >
> https://lore.kernel.org/openembedded-core/CA+TGqK9Yd2WWKrhMkhofF-8N0cESCSefWD2DXr4sBO9fDQXyrg@mail.gmail.com/t/#u
> >
> > And, sadly, we lack resources at the moment on our side to follow-up on
> this :-/
>
> Putting some links alongside this to more details would probably at
> least help a bit, particularly if ccache upstream documents it is
> imcompatible with rust...
>
Ok, I'll send a more documented patch to Harish for him to integrate in his
next iteration.
> Cheers,
>
> Richard
>
>
--
Yoann Congal
Smile ECS
[-- Attachment #2: Type: text/html, Size: 3909 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [OE-core] [PATCH v5 07/15] kernel-yocto.bbclass: Disable ccache when rust-kernel is enabled
2026-02-04 13:07 ` Yoann Congal
@ 2026-02-10 15:24 ` Yoann Congal
2026-02-11 11:47 ` Harish Sadineni
0 siblings, 1 reply; 33+ messages in thread
From: Yoann Congal @ 2026-02-10 15:24 UTC (permalink / raw)
To: Yoann Congal, Richard Purdie
Cc: Paul Barker, Harish.Sadineni, openembedded-core, Randy.MacLeod,
Sundeep.Kokkonda, alistair.francis, bruce.ashfield,
elmehdi.younes
On Wed Feb 4, 2026 at 2:07 PM CET, Yoann Congal wrote:
> Le mer. 4 févr. 2026 à 13:34, Richard Purdie <
> richard.purdie@linuxfoundation.org> a écrit :
>
>> On Wed, 2026-02-04 at 13:31 +0100, Yoann Congal wrote:
>> > On Wed Feb 4, 2026 at 1:05 PM CET, Paul Barker wrote:
>> > > On Thu, 2026-01-29 at 08:39 -0800, Sadineni, Harish via
>> > > lists.openembedded.org wrote:
>> > > > From: Yoann Congal <yoann.congal@smile.fr>
>> > > >
>> > > > Currently, a ccache enabled build fails with:
>> > > > | HOSTRUSTC scripts/generate_rust_target
>> > > > | HOSTCC scripts/kallsyms
>> > > > | HOSTCC scripts/sorttable
>> > > > | HOSTCC scripts/asn1_compiler
>> > > > | TOUCH include/generated/gcc-plugins.h
>> > > > | DESCEND objtool
>> > > > | error: multiple input filenames provided (first two filenames
>> are gcc and
>> > > >
>> .../tmp/work-shared/qemux86-64/kernel-source/scripts/generate_rust_target.rs)
>> > > >
>> > > > when using ccache, value of "HOSTCC=cache gcc" when this value is
>> passing
>> > > > to rustc, It is thinking gcc is a input file. when ccache is not
>> used "HOSTCC=gcc" is passed.
>> > > >
>> > > > Disable ccache for kernel build if rust-kernel is enabled to
>> workaround
>> > > > this.
>> > > >
>> > > > Signed-off-by: El Mehdi YOUNES <elmehdi.younes@smile.fr>
>> > > > Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
>> > > > Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
>> > >
>> > > This patch is good, but we should try to get the issue resolved
>> upstream
>> > > if we can so that ccache can be used.
>> > >
>> > > Has this been reported upstream yet? Could you also open a bug in our
>> > > bugzilla to track this?
>> >
>> > Hello,
>> >
>> > For context, a lengthy discussion happened on this patch here:
>> >
>> https://lore.kernel.org/openembedded-core/CA+TGqK9Yd2WWKrhMkhofF-8N0cESCSefWD2DXr4sBO9fDQXyrg@mail.gmail.com/t/#u
>> >
>> > And, sadly, we lack resources at the moment on our side to follow-up on
>> this :-/
>>
>> Putting some links alongside this to more details would probably at
>> least help a bit, particularly if ccache upstream documents it is
>> imcompatible with rust...
>>
>
> Ok, I'll send a more documented patch to Harish for him to integrate in his
> next iteration.
I pushed a branch on contrib (v5 + this commit modified)
https://git.openembedded.org/openembedded-core-contrib/log/?h=ycongal/kernel-rust
The modified commit is:
https://git.openembedded.org/openembedded-core-contrib/commit/?h=ycongal/kernel-rust&id=794bdad82933ee112452c8c08c917cf235e07ada
Harish, are you OK taking this for your next iteration?
Regards,
--
Yoann Congal
Smile ECS
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [OE-core] [PATCH v5 07/15] kernel-yocto.bbclass: Disable ccache when rust-kernel is enabled
2026-02-10 15:24 ` Yoann Congal
@ 2026-02-11 11:47 ` Harish Sadineni
0 siblings, 0 replies; 33+ messages in thread
From: Harish Sadineni @ 2026-02-11 11:47 UTC (permalink / raw)
To: Yoann Congal, Richard Purdie
Cc: Paul Barker, openembedded-core, Randy.MacLeod, Sundeep.Kokkonda,
alistair.francis, bruce.ashfield, elmehdi.younes
On 2/10/2026 8:54 PM, Yoann Congal wrote:
> CAUTION: This email comes from a non Wind River email account!
> Do not click links or open attachments unless you recognize the sender and know the content is safe.
>
> On Wed Feb 4, 2026 at 2:07 PM CET, Yoann Congal wrote:
>> Le mer. 4 févr. 2026 à 13:34, Richard Purdie <
>> richard.purdie@linuxfoundation.org> a écrit :
>>
>>> On Wed, 2026-02-04 at 13:31 +0100, Yoann Congal wrote:
>>>> On Wed Feb 4, 2026 at 1:05 PM CET, Paul Barker wrote:
>>>>> On Thu, 2026-01-29 at 08:39 -0800, Sadineni, Harish via
>>>>> lists.openembedded.org wrote:
>>>>>> From: Yoann Congal <yoann.congal@smile.fr>
>>>>>>
>>>>>> Currently, a ccache enabled build fails with:
>>>>>> | HOSTRUSTC scripts/generate_rust_target
>>>>>> | HOSTCC scripts/kallsyms
>>>>>> | HOSTCC scripts/sorttable
>>>>>> | HOSTCC scripts/asn1_compiler
>>>>>> | TOUCH include/generated/gcc-plugins.h
>>>>>> | DESCEND objtool
>>>>>> | error: multiple input filenames provided (first two filenames
>>> are gcc and
>>> .../tmp/work-shared/qemux86-64/kernel-source/scripts/generate_rust_target.rs)
>>>>>> when using ccache, value of "HOSTCC=cache gcc" when this value is
>>> passing
>>>>>> to rustc, It is thinking gcc is a input file. when ccache is not
>>> used "HOSTCC=gcc" is passed.
>>>>>> Disable ccache for kernel build if rust-kernel is enabled to
>>> workaround
>>>>>> this.
>>>>>>
>>>>>> Signed-off-by: El Mehdi YOUNES <elmehdi.younes@smile.fr>
>>>>>> Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
>>>>>> Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
>>>>> This patch is good, but we should try to get the issue resolved
>>> upstream
>>>>> if we can so that ccache can be used.
>>>>>
>>>>> Has this been reported upstream yet? Could you also open a bug in our
>>>>> bugzilla to track this?
>>>> Hello,
>>>>
>>>> For context, a lengthy discussion happened on this patch here:
>>>>
>>> https://lore.kernel.org/openembedded-core/CA+TGqK9Yd2WWKrhMkhofF-8N0cESCSefWD2DXr4sBO9fDQXyrg@mail.gmail.com/t/#u
>>>> And, sadly, we lack resources at the moment on our side to follow-up on
>>> this :-/
>>>
>>> Putting some links alongside this to more details would probably at
>>> least help a bit, particularly if ccache upstream documents it is
>>> imcompatible with rust...
>>>
>> Ok, I'll send a more documented patch to Harish for him to integrate in his
>> next iteration.
> I pushed a branch on contrib (v5 + this commit modified)
> https://git.openembedded.org/openembedded-core-contrib/log/?h=ycongal/kernel-rust
>
> The modified commit is:
> https://git.openembedded.org/openembedded-core-contrib/commit/?h=ycongal/kernel-rust&id=794bdad82933ee112452c8c08c917cf235e07ada
>
> Harish, are you OK taking this for your next iteration?
Yes, I'm fine with this.
Thanks
Harish
>
> Regards,
> --
> Yoann Congal
> Smile ECS
>
^ permalink raw reply [flat|nested] 33+ messages in thread
* [PATCH v5 08/15] kernel-devsrc: copying rust-kernel source to $kerneldir/build
2026-01-29 16:38 [PATCH v5 00/15] Enable rust support for linux kernel Harish.Sadineni
` (6 preceding siblings ...)
2026-01-29 16:39 ` [PATCH v5 07/15] kernel-yocto.bbclass: Disable ccache when rust-kernel is enabled Harish.Sadineni
@ 2026-01-29 16:39 ` Harish.Sadineni
2026-01-29 16:39 ` [PATCH v5 09/15] selftest/cases/runtime_test: Add test for Linux Rust sample Harish.Sadineni
` (9 subsequent siblings)
17 siblings, 0 replies; 33+ messages in thread
From: Harish.Sadineni @ 2026-01-29 16:39 UTC (permalink / raw)
To: openembedded-core
Cc: Randy.MacLeod, Sundeep.Kokkonda, alistair.francis, bruce.ashfield,
yoann.congal, elmehdi.younes, richard.purdie
From: Harish Sadineni <Harish.Sadineni@windriver.com>
When CONFIG_RUST is enabled, running 'make prepare' in the target & SDK
fails because the Rust kernel infrastructure is incomplete in the staged
kernel sources.
The Rust build system requires a wider set of interdependent sources
during make prepare, including bindgen inputs, C helper sources,
generated headers, and other support files. These are all located under
the kernel rust/ directory.
To ensure make prepare succeeds and to support building Rust-based
kernel modules from the target & SDK, copy the full rust/ directory
(of size 2.5MB) into $kerneldir/build when the rust-kernel distro feature
is enabled.
Additionally, when Rust support is enabled, 'make prepare' generates
.rmeta files (crate metadata in a custom binary format) and shared
objects (.so) that are required for compiling Rust kernel modules.
Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
meta/recipes-kernel/linux/kernel-devsrc.bb | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
index 23a9093ede..07f082132b 100644
--- a/meta/recipes-kernel/linux/kernel-devsrc.bb
+++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
@@ -139,6 +139,15 @@ do_install() {
cd ${S}
cp -a scripts $kerneldir/build
+
+ # In sdk, when CONFIG_RUST is enabled, `make prepare` requires the full Rust
+ # kernel infrastructure. The Rust build system pulls in bindgen inputs, C helpers,
+ # generated headers, and generate crate metadata (.rmeta), and shared objects
+ # needed for building Rust kernel modules. Copy the entire rust/ directory (of size 2.5MB)
+ # to avoid failures with 'make prepare'.
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', 'true', 'false', d)}; then
+ cp -a rust ${kerneldir}/build
+ fi
# for v6.1+ (otherwise we are missing multiple default targets)
cp -a --parents Kbuild $kerneldir/build 2>/dev/null || :
--
2.49.0
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH v5 09/15] selftest/cases/runtime_test: Add test for Linux Rust sample
2026-01-29 16:38 [PATCH v5 00/15] Enable rust support for linux kernel Harish.Sadineni
` (7 preceding siblings ...)
2026-01-29 16:39 ` [PATCH v5 08/15] kernel-devsrc: copying rust-kernel source to $kerneldir/build Harish.Sadineni
@ 2026-01-29 16:39 ` Harish.Sadineni
2026-01-29 16:39 ` [PATCH v5 10/15] kernel.bbclass: Copy include/config/auto.conf in STAGING_KERNEL_BUILDDIR Harish.Sadineni
` (8 subsequent siblings)
17 siblings, 0 replies; 33+ messages in thread
From: Harish.Sadineni @ 2026-01-29 16:39 UTC (permalink / raw)
To: openembedded-core
Cc: Randy.MacLeod, Sundeep.Kokkonda, alistair.francis, bruce.ashfield,
yoann.congal, elmehdi.younes, richard.purdie
From: Yoann Congal <yoann.congal@smile.fr>
This new case tests that the rust_mininal sample inside the kernel source
tree is buildable and works properly: check that the module can be
loaded and that it prints correctly.
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
meta/lib/oeqa/selftest/cases/runtime_test.py | 25 ++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py
index d58ffa80f5..e8374606a4 100644
--- a/meta/lib/oeqa/selftest/cases/runtime_test.py
+++ b/meta/lib/oeqa/selftest/cases/runtime_test.py
@@ -481,3 +481,28 @@ IMAGE_INSTALL:append = " systemtap-runtime"
cmd = "crosstap -r root@192.168.7.2 -s %s/process/ syscalls_by_pid.stp" % systemtap_examples
result = runCmd(cmd)
self.assertEqual(0, result.status, 'crosstap syscalls_by_pid returned a non 0 status:%s' % result.output)
+
+@OETestTag("runqemu")
+class RustKernel(OESelftestTestCase):
+ @classmethod
+ def setUpClass(cls):
+ super(RustKernel, cls).setUpClass()
+ cls.image = "core-image-minimal"
+
+ def test_kernel_rust_sample(self):
+ import textwrap
+ self.write_config(textwrap.dedent("""
+ DISTRO_FEATURES:append = ' rust-kernel'
+ KERNEL_EXTRA_FEATURES:append = ' features/kernel-sample/kernel-rust-sample.scc'
+ CORE_IMAGE_EXTRA_INSTALL += "kernel-module-rust-minimal"
+ """))
+ bitbake(self.image)
+
+ with runqemu(self.image, runqemuparams = "nographic") as qemu:
+ qemu.run_serial("dmesg -c > /dev/null")
+ status, _ = qemu.run_serial("modprobe rust_minimal")
+ self.assertEqual(status, 1, "Loading rust_minimal module failed!")
+ _, output = qemu.run_serial("dmesg")
+ self.logger.debug(f"rust_minimal dmesg output:\n" + textwrap.indent(output, " "))
+ self.assertIn("Rust minimal sample", output, "Kernel Rust sample expected output not found in dmesg")
+
--
2.49.0
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH v5 10/15] kernel.bbclass: Copy include/config/auto.conf in STAGING_KERNEL_BUILDDIR
2026-01-29 16:38 [PATCH v5 00/15] Enable rust support for linux kernel Harish.Sadineni
` (8 preceding siblings ...)
2026-01-29 16:39 ` [PATCH v5 09/15] selftest/cases/runtime_test: Add test for Linux Rust sample Harish.Sadineni
@ 2026-01-29 16:39 ` Harish.Sadineni
2026-01-29 16:39 ` [PATCH v5 11/15] kernel.bbclass: Export artifacts needed for out-of-tree Rust compilation Harish.Sadineni
` (7 subsequent siblings)
17 siblings, 0 replies; 33+ messages in thread
From: Harish.Sadineni @ 2026-01-29 16:39 UTC (permalink / raw)
To: openembedded-core
Cc: Randy.MacLeod, Sundeep.Kokkonda, alistair.francis, bruce.ashfield,
yoann.congal, elmehdi.younes, richard.purdie
From: Yoann Congal <yoann.congal@smile.fr>
Linux commit aaed5c7739be ("kbuild: slim down package for building
external modules")[0] states that include/config/auto.conf is also a
file needed for out-of-tree build.
This avoids this error when building an out-of-tree Rust kernel module:
| make -C .../tmp/work-shared/qemux86-64/kernel-source M=$PWD
| make[1]: Entering directory '.../tmp/work-shared/qemux86-64/kernel-source'
| make[2]: Entering directory '.../tmp/work/qemux86_64-poky-linux/rust-out-of-tree-module/git/sources/rust-out-of-tree-module-git'
| .../tmp/work-shared/qemux86-64/kernel-source/Makefile:779: .../tmp/work-shared/qemux86-64/kernel-build-artifacts/include/config/auto.conf: No such file or directory
[0]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=aaed5c7739be81ebdd6008aedc8befd98c88e67a
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
meta/classes-recipe/kernel.bbclass | 1 +
1 file changed, 1 insertion(+)
diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
index f989b31c47..30a10b0801 100644
--- a/meta/classes-recipe/kernel.bbclass
+++ b/meta/classes-recipe/kernel.bbclass
@@ -570,6 +570,7 @@ do_shared_workdir () {
cp .config $kerneldir/
mkdir -p $kerneldir/include/config
cp include/config/kernel.release $kerneldir/include/config/kernel.release
+ cp include/config/auto.conf $kerneldir/include/config/auto.conf
if [ -e certs/signing_key.x509 ]; then
# The signing_key.* files are stored in the certs/ dir in
# newer Linux kernels
--
2.49.0
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH v5 11/15] kernel.bbclass: Export artifacts needed for out-of-tree Rust compilation
2026-01-29 16:38 [PATCH v5 00/15] Enable rust support for linux kernel Harish.Sadineni
` (9 preceding siblings ...)
2026-01-29 16:39 ` [PATCH v5 10/15] kernel.bbclass: Copy include/config/auto.conf in STAGING_KERNEL_BUILDDIR Harish.Sadineni
@ 2026-01-29 16:39 ` Harish.Sadineni
2026-01-29 16:39 ` [PATCH v5 12/15] module.bbclass: Prepare out-of-tree rust module compilation Harish.Sadineni
` (6 subsequent siblings)
17 siblings, 0 replies; 33+ messages in thread
From: Harish.Sadineni @ 2026-01-29 16:39 UTC (permalink / raw)
To: openembedded-core
Cc: Randy.MacLeod, Sundeep.Kokkonda, alistair.francis, bruce.ashfield,
yoann.congal, elmehdi.younes, richard.purdie
From: Yoann Congal <yoann.congal@smile.fr>
Publish artifacts from kernel compilation to allow out-of-tree Rust
compilation:
* scripts/target.json: target definition: architecture, ABI, compiler
options, ...
* rust/: the crates compiled by the kernel available to
out-of-tree-modules
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
meta/classes-recipe/kernel.bbclass | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
index 30a10b0801..dfb8604a68 100644
--- a/meta/classes-recipe/kernel.bbclass
+++ b/meta/classes-recipe/kernel.bbclass
@@ -632,6 +632,24 @@ do_shared_workdir () {
cp -r scripts/gcc-plugins ${kerneldir}/scripts
fi
+ if ${@bb.utils.contains("DISTRO_FEATURES", "rust-kernel", "true", "false", d)}; then
+ # Copy target.json file needed for out-of-tree rust modules
+ if [ -e scripts/target.json ]; then
+ bbnote "Copying scripts/target.json"
+ mkdir -p ${kerneldir}/scripts
+ cp scripts/target.json ${kerneldir}/scripts
+ else
+ bbwarn "scripts/target.json not found in compiled kernel. Out-of-tree rust modules will fail to build."
+ fi
+
+ # Copy rust/ needed by out-of-tree module (firstly for the core rust crate)
+ if [ -e rust/ ]; then
+ bbnote "Copying rust/"
+ cp -r rust ${kerneldir}/
+ else
+ bbwarn "rust/ not found in compiled kernel. Out-of-tree rust modules will fail to build."
+ fi
+ fi
}
# We don't need to stage anything, not the modules/firmware since those would clash with linux-firmware
--
2.49.0
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH v5 12/15] module.bbclass: Prepare out-of-tree rust module compilation
2026-01-29 16:38 [PATCH v5 00/15] Enable rust support for linux kernel Harish.Sadineni
` (10 preceding siblings ...)
2026-01-29 16:39 ` [PATCH v5 11/15] kernel.bbclass: Export artifacts needed for out-of-tree Rust compilation Harish.Sadineni
@ 2026-01-29 16:39 ` Harish.Sadineni
2026-01-29 16:39 ` [PATCH v5 13/15] meta-skeleton: Add rust-out-of-tree-module recipe Harish.Sadineni
` (5 subsequent siblings)
17 siblings, 0 replies; 33+ messages in thread
From: Harish.Sadineni @ 2026-01-29 16:39 UTC (permalink / raw)
To: openembedded-core
Cc: Randy.MacLeod, Sundeep.Kokkonda, alistair.francis, bruce.ashfield,
yoann.congal, elmehdi.younes, richard.purdie
From: Yoann Congal <yoann.congal@smile.fr>
Conditioned to the "rust-linux" DISTRO_FEATURES:
* Add dependency to rust-native
* Remap ${S} in compiled output to avoid buildpath errors
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
meta/classes-recipe/module.bbclass | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/meta/classes-recipe/module.bbclass b/meta/classes-recipe/module.bbclass
index 4948e995c5..7dbd4194d1 100644
--- a/meta/classes-recipe/module.bbclass
+++ b/meta/classes-recipe/module.bbclass
@@ -87,3 +87,11 @@ EXPORT_FUNCTIONS do_compile do_install
KERNEL_MODULES_META_PACKAGE = "${PN}"
FILES:${PN} = ""
ALLOW_EMPTY:${PN} = "1"
+
+# Rust module support
+DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', 'rust-native', '', d)}"
+
+RUST_DEBUG_REMAP ?= "--remap-path-prefix=${S}=${TARGET_DBGSRC_DIR}"
+KRUSTFLAGS:append = " ${RUST_DEBUG_REMAP}"
+EXTRA_OEMAKE:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', \
+ ' KRUSTFLAGS="${KRUSTFLAGS}"', '',d)}"
--
2.49.0
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH v5 13/15] meta-skeleton: Add rust-out-of-tree-module recipe
2026-01-29 16:38 [PATCH v5 00/15] Enable rust support for linux kernel Harish.Sadineni
` (11 preceding siblings ...)
2026-01-29 16:39 ` [PATCH v5 12/15] module.bbclass: Prepare out-of-tree rust module compilation Harish.Sadineni
@ 2026-01-29 16:39 ` Harish.Sadineni
2026-01-29 16:39 ` [PATCH v5 14/15] make-mod-scripts: fix for buildpath issues with rust-out-of-tree compilation Harish.Sadineni
` (4 subsequent siblings)
17 siblings, 0 replies; 33+ messages in thread
From: Harish.Sadineni @ 2026-01-29 16:39 UTC (permalink / raw)
To: openembedded-core
Cc: Randy.MacLeod, Sundeep.Kokkonda, alistair.francis, bruce.ashfield,
yoann.congal, elmehdi.younes, richard.purdie
From: Yoann Congal <yoann.congal@smile.fr>
Basic template for an out-of-tree Linux kernel module written in Rust.
Mainly to test Rust integration into the kernel.
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
.../rust-out-of-tree-module_git.bb | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
create mode 100644 meta-skeleton/recipes-kernel/rust-out-of-tree-module/rust-out-of-tree-module_git.bb
diff --git a/meta-skeleton/recipes-kernel/rust-out-of-tree-module/rust-out-of-tree-module_git.bb b/meta-skeleton/recipes-kernel/rust-out-of-tree-module/rust-out-of-tree-module_git.bb
new file mode 100644
index 0000000000..642fa80319
--- /dev/null
+++ b/meta-skeleton/recipes-kernel/rust-out-of-tree-module/rust-out-of-tree-module_git.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Basic template for an out-of-tree Linux kernel module written in Rust"
+HOMEPAGE = "https://github.com/Rust-for-Linux/rust-out-of-tree-module"
+
+LICENSE = "GPL-2.0-only"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+inherit module features_check
+REQUIRED_DISTRO_FEATURES = "rust-kernel"
+
+SRC_URI = "git://github.com/Rust-for-Linux/rust-out-of-tree-module.git;protocol=https;branch=main"
+SRCREV = "00b5a8ee2bf53532d115004d7636b61a54f49802"
+UPSTREAM_CHECK_COMMITS = "1"
+
+EXTRA_OEMAKE += "KDIR=${STAGING_KERNEL_DIR}"
+
+# The inherit of module.bbclass will automatically name module packages with
+# "kernel-module-" prefix as required by the oe-core build environment.
+RPROVIDES:${PN} += "kernel-module-rust-out-of-tree"
--
2.49.0
^ permalink raw reply related [flat|nested] 33+ messages in thread* [PATCH v5 14/15] make-mod-scripts: fix for buildpath issues with rust-out-of-tree compilation
2026-01-29 16:38 [PATCH v5 00/15] Enable rust support for linux kernel Harish.Sadineni
` (12 preceding siblings ...)
2026-01-29 16:39 ` [PATCH v5 13/15] meta-skeleton: Add rust-out-of-tree-module recipe Harish.Sadineni
@ 2026-01-29 16:39 ` Harish.Sadineni
2026-02-04 12:08 ` [OE-core] " Paul Barker
2026-01-29 16:39 ` [PATCH v5 15/15] runtime_test: Add rust-out-of-tree selftest Harish.Sadineni
` (3 subsequent siblings)
17 siblings, 1 reply; 33+ messages in thread
From: Harish.Sadineni @ 2026-01-29 16:39 UTC (permalink / raw)
To: openembedded-core
Cc: Randy.MacLeod, Sundeep.Kokkonda, alistair.francis, bruce.ashfield,
yoann.congal, elmehdi.younes, richard.purdie
From: Harish Sadineni <Harish.Sadineni@windriver.com>
Fixes buildpath issues when compiling rust-out-of-tree recipe.
Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
.../make-mod-scripts/make-mod-scripts_1.0.bb | 8 ++++++++
1 file changed, 8 insertions(+)
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 874e16e642..d6b2178767 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
@@ -36,3 +36,11 @@ do_configure() {
-C ${STAGING_KERNEL_DIR} O=${STAGING_KERNEL_BUILDDIR} $t
done
}
+
+RUST_DEBUG_REMAP ?= "--remap-path-prefix=${TMPDIR}/work-shared=${TARGET_DBGSRC_DIR} \
+ --remap-path-prefix=${TMPDIR}/work=${TARGET_DBGSRC_DIR} \
+"
+KRUSTFLAGS:append = " ${RUST_DEBUG_REMAP}"
+EXTRA_OEMAKE:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', \
+ ' KRUSTFLAGS="${KRUSTFLAGS}"', '',d)}"
+
--
2.49.0
^ permalink raw reply related [flat|nested] 33+ messages in thread* Re: [OE-core] [PATCH v5 14/15] make-mod-scripts: fix for buildpath issues with rust-out-of-tree compilation
2026-01-29 16:39 ` [PATCH v5 14/15] make-mod-scripts: fix for buildpath issues with rust-out-of-tree compilation Harish.Sadineni
@ 2026-02-04 12:08 ` Paul Barker
0 siblings, 0 replies; 33+ messages in thread
From: Paul Barker @ 2026-02-04 12:08 UTC (permalink / raw)
To: Harish.Sadineni, openembedded-core
Cc: Randy.MacLeod, Sundeep.Kokkonda, alistair.francis, bruce.ashfield,
yoann.congal, elmehdi.younes, richard.purdie
[-- Attachment #1: Type: text/plain, Size: 2070 bytes --]
On Thu, 2026-01-29 at 08:39 -0800, Sadineni, Harish via
lists.openembedded.org wrote:
> From: Harish Sadineni <Harish.Sadineni@windriver.com>
>
> Fixes buildpath issues when compiling rust-out-of-tree recipe.
>
> Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
> ---
> .../make-mod-scripts/make-mod-scripts_1.0.bb | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> 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 874e16e642..d6b2178767 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
> @@ -36,3 +36,11 @@ do_configure() {
> -C ${STAGING_KERNEL_DIR} O=${STAGING_KERNEL_BUILDDIR} $t
> done
> }
> +
> +RUST_DEBUG_REMAP ?= "--remap-path-prefix=${TMPDIR}/work-shared=${TARGET_DBGSRC_DIR} \
> + --remap-path-prefix=${TMPDIR}/work=${TARGET_DBGSRC_DIR} \
> +"
> +KRUSTFLAGS:append = " ${RUST_DEBUG_REMAP}"
> +EXTRA_OEMAKE:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', \
> + ' KRUSTFLAGS="${KRUSTFLAGS}"', '',d)}"
> +
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#230155): https://lists.openembedded.org/g/openembedded-core/message/230155
> Mute This Topic: https://lists.openembedded.org/mt/117528985/1826184
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [paul@pbarker.dev]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Looking at this, and the other uses of KRUSTFLAGS, could we just set
KRUSTFLAGS and add it to EXTRA_OEMAKE unconditionally in each recipe
where it is needed? There should be no harm in setting KRUSTFLAGS if no
Rust code actually gets built. For modules, this can be done in
module-rust.bbclass instead of in each Rust module recipe.
Best regards,
--
Paul Barker
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* [PATCH v5 15/15] runtime_test: Add rust-out-of-tree selftest
2026-01-29 16:38 [PATCH v5 00/15] Enable rust support for linux kernel Harish.Sadineni
` (13 preceding siblings ...)
2026-01-29 16:39 ` [PATCH v5 14/15] make-mod-scripts: fix for buildpath issues with rust-out-of-tree compilation Harish.Sadineni
@ 2026-01-29 16:39 ` Harish.Sadineni
2026-01-29 16:47 ` [PATCH v5 00/15] Enable rust support for linux kernel Sadineni, Harish
` (2 subsequent siblings)
17 siblings, 0 replies; 33+ messages in thread
From: Harish.Sadineni @ 2026-01-29 16:39 UTC (permalink / raw)
To: openembedded-core
Cc: Randy.MacLeod, Sundeep.Kokkonda, alistair.francis, bruce.ashfield,
yoann.congal, elmehdi.younes, richard.purdie
From: Yoann Congal <yoann.congal@smile.fr>
This new case tests that the rust-out-of-tree-module recipe compiles and
run properly: check that the dmesg output is as expected.
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
meta/lib/oeqa/selftest/cases/runtime_test.py | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py
index e8374606a4..461116601d 100644
--- a/meta/lib/oeqa/selftest/cases/runtime_test.py
+++ b/meta/lib/oeqa/selftest/cases/runtime_test.py
@@ -494,8 +494,11 @@ class RustKernel(OESelftestTestCase):
self.write_config(textwrap.dedent("""
DISTRO_FEATURES:append = ' rust-kernel'
KERNEL_EXTRA_FEATURES:append = ' features/kernel-sample/kernel-rust-sample.scc'
- CORE_IMAGE_EXTRA_INSTALL += "kernel-module-rust-minimal"
+ CORE_IMAGE_EXTRA_INSTALL += "kernel-module-rust-minimal kernel-module-rust-out-of-tree"
"""))
+
+ runCmd('bitbake-layers add-layer %s' % os.path.join(get_bb_var("COREBASE"), 'meta-skeleton'))
+ self.add_command_to_tearDown('bitbake-layers remove-layer */meta-skeleton')
bitbake(self.image)
with runqemu(self.image, runqemuparams = "nographic") as qemu:
@@ -506,3 +509,10 @@ class RustKernel(OESelftestTestCase):
self.logger.debug(f"rust_minimal dmesg output:\n" + textwrap.indent(output, " "))
self.assertIn("Rust minimal sample", output, "Kernel Rust sample expected output not found in dmesg")
+ qemu.run_serial("dmesg -c > /dev/null")
+ status, _ = qemu.run_serial("modprobe rust_out_of_tree")
+ self.assertEqual(status, 1, "Loading rust_out_of_tree module failed!")
+ _, output = qemu.run_serial("dmesg")
+ self.logger.debug(f"rust_out_of_tree dmesg output:\n" + textwrap.indent(output, " "))
+ self.assertIn("Rust out-of-tree sample", output, "Out-of-tree Rust sample expected output not found in dmesg")
+
--
2.49.0
^ permalink raw reply related [flat|nested] 33+ messages in thread* Re: [PATCH v5 00/15] Enable rust support for linux kernel
2026-01-29 16:38 [PATCH v5 00/15] Enable rust support for linux kernel Harish.Sadineni
` (14 preceding siblings ...)
2026-01-29 16:39 ` [PATCH v5 15/15] runtime_test: Add rust-out-of-tree selftest Harish.Sadineni
@ 2026-01-29 16:47 ` Sadineni, Harish
2026-02-04 12:00 ` [OE-core] " Paul Barker
[not found] ` <188F412032A5A3F8.3408700@lists.openembedded.org>
17 siblings, 0 replies; 33+ messages in thread
From: Sadineni, Harish @ 2026-01-29 16:47 UTC (permalink / raw)
To: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 509 bytes --]
This patch series was tested on Autobuilder:
https://autobuilder.yoctoproject.org/valkyrie/?#/builders/35/builds/3115 ( https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/3115%20https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/3238%20https://autobuilder.yoctoproject.org/valkyrie/#/builders/4/builds/3121 )
https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/3238
https://autobuilder.yoctoproject.org/valkyrie/#/builders/4/builds/3121
Thanks,
Harish
[-- Attachment #2: Type: text/html, Size: 834 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread* Re: [OE-core] [PATCH v5 00/15] Enable rust support for linux kernel
2026-01-29 16:38 [PATCH v5 00/15] Enable rust support for linux kernel Harish.Sadineni
` (15 preceding siblings ...)
2026-01-29 16:47 ` [PATCH v5 00/15] Enable rust support for linux kernel Sadineni, Harish
@ 2026-02-04 12:00 ` Paul Barker
2026-02-04 12:24 ` Paul Barker
2026-02-04 13:54 ` Bruce Ashfield
[not found] ` <188F412032A5A3F8.3408700@lists.openembedded.org>
17 siblings, 2 replies; 33+ messages in thread
From: Paul Barker @ 2026-02-04 12:00 UTC (permalink / raw)
To: Harish.Sadineni, bruce.ashfield
Cc: Randy.MacLeod, Sundeep.Kokkonda, alistair.francis, yoann.congal,
elmehdi.younes, richard.purdie,
openembedded-core@lists.openembedded.org
[-- Attachment #1: Type: text/plain, Size: 7146 bytes --]
On Thu, 2026-01-29 at 08:38 -0800, Sadineni, Harish via
lists.openembedded.org wrote:
> From: Harish Sadineni <Harish.Sadineni@windriver.com>
>
> v5:
> - Regression in autobuilder with v4 series is due to applying v4 series together with following patch
> "llvm: enable LLVMgold.so build by adding binutils dependency"(https://lists.openembedded.org/g/openembedded-core/message/229387)
> is fixed by droping Alistair Francis's patch(https://lists.openembedded.org/g/openembedded-core/message/229091).
> - Updated patch "rust: install Rust library sources for 'make rustavailable' support" to install
> rust standard library sources for rust-native.
>
> v4:
> - Resolved patchtest failures.
>
> v3:
> - Removed the DISTRO_FEATURES dependency for installing Rust library sources in the Rust recipe,
> - Extended support for on target rust kernel module developmet by installing Rust library sources and
> introduced packaging of the Rust standard library sources in a dedicated ${PN}-src-lib package.
> - Integrated Alistair Francis's patch(https://lists.openembedded.org/g/openembedded-core/message/229091)
> that uses the Rust bootstrap tool to install Rust library sources for rust-native.
> - Dropped the patch that added rust-kernel to native/nativesdk feature filters in bitbake.conf.
> - Updated flags in the make-mod-scripts recipe to fix build failures when building Rust out-of-tree
> module recipes.
> - Dropped the bindgen-cli patch extending BBCLASSEXTEND to include
> nativesdk, as it has been merged into oe-core.
>
> v2:
> - Combined [PATCH 05/16][0] & [PATCH 06/16][1] from v1.
> - Updated commit message and added in code comments for patch "[PATCH 09/15] kernel-devsrc: copying
> rust-kernel source to $kerneldir/build"
>
> [0] https://lists.openembedded.org/g/openembedded-core/message/228559
> [1] https://lists.openembedded.org/g/openembedded-core/message/228560
>
> v1:
> The previous series was RFC v4, "Enable Rust support for Linux kernel"
> (https://lists.openembedded.org/g/openembedded-core/message/226623).
>
> In addition, Yoann Congal posted RFC v2, "Kernel Rust out-of-tree module support"
> (https://lists.openembedded.org/g/openembedded-core/message/227281), which builds on top of RFC v4.
>
> The current patch series is a unified version that combines both efforts.
> Compared to the earlier series, the main changes are:
>
> -Kernel configuration fragments have been moved to yocto-kernel-cache.
> -The kernel fragments have been removed from SRC_URI and from the files
> directory previously stored underrecipes-kernel/linux/files.
> -Updated the "[PATCH 11/16] selftest/cases/runtime_test: Add test for Linux Rust sample"
> by appending KERNEL_EXTRA_FEATURES:append = 'features/kernel-sample/kernel-rust-sample.scc'
> instead of adding this directly in the linux-yocto recipe.
>
>
> This patch series introduces Rust support into the linux-yocto kernel recipe and
> related build infrastructure in the Yocto Project. The goal is to enable building
> the Linux kernel with Rust components and provide support for building kernel module
> which is written in rust and also provide support to build rust kernel modules in sdk.
>
> And this series adds test for Linux Rust sample and also added support
> for out-of-tree kernel module written in Rust as well as associated test.
>
> Summary of patches:
>
> - Patch 01: Add required dependencies ('clang-native', 'rust-native','bindgen-cli-native') to the kernel to support Rust binding generation.
> - Patch 02: Install the Rust standard library source ('library/') for native,target and sdk.
> - Patch 03: Updated `kernel-yocto.bbclass` to invoke `make rustavailable` during 'do_kernel_configme', ensuring Rust readiness.
> - Patch 04: Add kernel configuration support for Rust (via 'kernel-rust.scc'), enabling the Rust build options in kernel config.
> - Patch 05: Fixed buildpaths errors when rust is enabled for kernel by appending --remap-path-prefix to RUST_DEBUG_REMAP
> - Patch 06: split `HOSTCC` flag to align with to linux-yocto and fix build issue with make-mod-scripts recipe.
> - Patch 07: Disabling ccache when rust-kernel is enabled for linux-yocto.
> - Patch 08: Copy Rust kernel sources into kernel-devsrc build directory which will be required while running 'make prepare' in sdk.
> - Patch 09: Added oe-selftest case for the Linux Rust sample.
> - patch 10: Copying include/config/auto.conf in STAGING_KERNEL_BUILDDIR
> - patch 11: Export artifacts needed for out-of-tree Rust compilation
> - patch 12: Prepare out-of-tree rust module compilation
> - patch 13: Added rust-out-of-tree-module recipe in meta-skeleton layer
> - Patch 14: Fixed buildpaths errors for rust-out-of-tree-module recipe by appending --remap-path-prefix to RUST_DEBUG_REMAP
> - patch 15: Added rust-out-of-tree selftest
>
> Patches have been build-tested successfully on:
> - qemuarm64
> - qemux86-64
>
> Benchmark test-result for x86-64:
> +-------------------------------+------------+-----------+-----------+-----------+
> > DISTRO_FEATURES | real | user | sys | FS usage |
> +-------------------------------+------------+-----------+-----------+-----------+
> > rust-kernel (enabled) | 46m1.720s | 0m28.864s | 0m3.696s | 58 GB |
> > rust-kernel (disabled) | 30m1.053s | 0m20.091s | 0m2.748s | 33 GB |
> +-------------------------------+------------+-----------+-----------+-----------+
We discussed these patches on Monday and have some feedback on the
design. Things are nearly correct, we do want to ensure that the user
experience is good before merging this though as people will quickly
start to depend on it.
We think it would be better if Rust support was controlled by
KERNEL_FEATURES instead of DISTRO_FEATURES. This option now only impacts
the kernel and any kernel module recipes. It also may need to change
depending on MACHINE which makes it not a good fit for DISTRO_FEATURES -
e.g. one BSP may use an older LTS kernel with no required Rust code and
a different BSP may use a newer kernel and need a driver written in Rust
for the board to function.
We should add a new module-rust.bbclass instead of extending
module.bbclass with conditional logic. This can be included by any
modules which use Rust and handle any common setup. It can also check
for the presence of required files (scripts/target.json & rust/*) in the
kernel's shared workdir, and perhaps the kernel config so that we can
give a sensible error message if they are missing. This means that
module-rust.bbclass doesn't need to check KERNEL_FEATURES for
rust-kernel, it can just look at the shared workdir (probably in
do_configure) to make sure that we're ready to build a Rust module.
If we can't use KERNEL_FEATURES, then perhaps a new KERNEL_RUST_SUPPORT
variable would work. In either case, this should only be checked in the
kernel recipe itself.
Bruce - what do you think about KERNEL_FEATURES being used in this way?
Best regards,
--
Paul Barker
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread* Re: [OE-core] [PATCH v5 00/15] Enable rust support for linux kernel
2026-02-04 12:00 ` [OE-core] " Paul Barker
@ 2026-02-04 12:24 ` Paul Barker
2026-02-04 13:52 ` Bruce Ashfield
2026-02-12 18:13 ` Harish Sadineni
2026-02-04 13:54 ` Bruce Ashfield
1 sibling, 2 replies; 33+ messages in thread
From: Paul Barker @ 2026-02-04 12:24 UTC (permalink / raw)
To: Harish.Sadineni, bruce.ashfield
Cc: Randy.MacLeod, Sundeep.Kokkonda, alistair.francis, yoann.congal,
elmehdi.younes, richard.purdie,
openembedded-core@lists.openembedded.org
[-- Attachment #1: Type: text/plain, Size: 7760 bytes --]
On Wed, 2026-02-04 at 12:00 +0000, Paul Barker wrote:
> On Thu, 2026-01-29 at 08:38 -0800, Sadineni, Harish via
> lists.openembedded.org wrote:
> > From: Harish Sadineni <Harish.Sadineni@windriver.com>
> >
> > v5:
> > - Regression in autobuilder with v4 series is due to applying v4 series together with following patch
> > "llvm: enable LLVMgold.so build by adding binutils dependency"(https://lists.openembedded.org/g/openembedded-core/message/229387)
> > is fixed by droping Alistair Francis's patch(https://lists.openembedded.org/g/openembedded-core/message/229091).
> > - Updated patch "rust: install Rust library sources for 'make rustavailable' support" to install
> > rust standard library sources for rust-native.
> >
> > v4:
> > - Resolved patchtest failures.
> >
> > v3:
> > - Removed the DISTRO_FEATURES dependency for installing Rust library sources in the Rust recipe,
> > - Extended support for on target rust kernel module developmet by installing Rust library sources and
> > introduced packaging of the Rust standard library sources in a dedicated ${PN}-src-lib package.
> > - Integrated Alistair Francis's patch(https://lists.openembedded.org/g/openembedded-core/message/229091)
> > that uses the Rust bootstrap tool to install Rust library sources for rust-native.
> > - Dropped the patch that added rust-kernel to native/nativesdk feature filters in bitbake.conf.
> > - Updated flags in the make-mod-scripts recipe to fix build failures when building Rust out-of-tree
> > module recipes.
> > - Dropped the bindgen-cli patch extending BBCLASSEXTEND to include
> > nativesdk, as it has been merged into oe-core.
> >
> > v2:
> > - Combined [PATCH 05/16][0] & [PATCH 06/16][1] from v1.
> > - Updated commit message and added in code comments for patch "[PATCH 09/15] kernel-devsrc: copying
> > rust-kernel source to $kerneldir/build"
> >
> > [0] https://lists.openembedded.org/g/openembedded-core/message/228559
> > [1] https://lists.openembedded.org/g/openembedded-core/message/228560
> >
> > v1:
> > The previous series was RFC v4, "Enable Rust support for Linux kernel"
> > (https://lists.openembedded.org/g/openembedded-core/message/226623).
> >
> > In addition, Yoann Congal posted RFC v2, "Kernel Rust out-of-tree module support"
> > (https://lists.openembedded.org/g/openembedded-core/message/227281), which builds on top of RFC v4.
> >
> > The current patch series is a unified version that combines both efforts.
> > Compared to the earlier series, the main changes are:
> >
> > -Kernel configuration fragments have been moved to yocto-kernel-cache.
> > -The kernel fragments have been removed from SRC_URI and from the files
> > directory previously stored underrecipes-kernel/linux/files.
> > -Updated the "[PATCH 11/16] selftest/cases/runtime_test: Add test for Linux Rust sample"
> > by appending KERNEL_EXTRA_FEATURES:append = 'features/kernel-sample/kernel-rust-sample.scc'
> > instead of adding this directly in the linux-yocto recipe.
> >
> >
> > This patch series introduces Rust support into the linux-yocto kernel recipe and
> > related build infrastructure in the Yocto Project. The goal is to enable building
> > the Linux kernel with Rust components and provide support for building kernel module
> > which is written in rust and also provide support to build rust kernel modules in sdk.
> >
> > And this series adds test for Linux Rust sample and also added support
> > for out-of-tree kernel module written in Rust as well as associated test.
> >
> > Summary of patches:
> >
> > - Patch 01: Add required dependencies ('clang-native', 'rust-native','bindgen-cli-native') to the kernel to support Rust binding generation.
> > - Patch 02: Install the Rust standard library source ('library/') for native,target and sdk.
> > - Patch 03: Updated `kernel-yocto.bbclass` to invoke `make rustavailable` during 'do_kernel_configme', ensuring Rust readiness.
> > - Patch 04: Add kernel configuration support for Rust (via 'kernel-rust.scc'), enabling the Rust build options in kernel config.
> > - Patch 05: Fixed buildpaths errors when rust is enabled for kernel by appending --remap-path-prefix to RUST_DEBUG_REMAP
> > - Patch 06: split `HOSTCC` flag to align with to linux-yocto and fix build issue with make-mod-scripts recipe.
> > - Patch 07: Disabling ccache when rust-kernel is enabled for linux-yocto.
> > - Patch 08: Copy Rust kernel sources into kernel-devsrc build directory which will be required while running 'make prepare' in sdk.
> > - Patch 09: Added oe-selftest case for the Linux Rust sample.
> > - patch 10: Copying include/config/auto.conf in STAGING_KERNEL_BUILDDIR
> > - patch 11: Export artifacts needed for out-of-tree Rust compilation
> > - patch 12: Prepare out-of-tree rust module compilation
> > - patch 13: Added rust-out-of-tree-module recipe in meta-skeleton layer
> > - Patch 14: Fixed buildpaths errors for rust-out-of-tree-module recipe by appending --remap-path-prefix to RUST_DEBUG_REMAP
> > - patch 15: Added rust-out-of-tree selftest
> >
> > Patches have been build-tested successfully on:
> > - qemuarm64
> > - qemux86-64
> >
> > Benchmark test-result for x86-64:
> > +-------------------------------+------------+-----------+-----------+-----------+
> > > DISTRO_FEATURES | real | user | sys | FS usage |
> > +-------------------------------+------------+-----------+-----------+-----------+
> > > rust-kernel (enabled) | 46m1.720s | 0m28.864s | 0m3.696s | 58 GB |
> > > rust-kernel (disabled) | 30m1.053s | 0m20.091s | 0m2.748s | 33 GB |
> > +-------------------------------+------------+-----------+-----------+-----------+
>
> We discussed these patches on Monday and have some feedback on the
> design. Things are nearly correct, we do want to ensure that the user
> experience is good before merging this though as people will quickly
> start to depend on it.
>
> We think it would be better if Rust support was controlled by
> KERNEL_FEATURES instead of DISTRO_FEATURES. This option now only impacts
> the kernel and any kernel module recipes. It also may need to change
> depending on MACHINE which makes it not a good fit for DISTRO_FEATURES -
> e.g. one BSP may use an older LTS kernel with no required Rust code and
> a different BSP may use a newer kernel and need a driver written in Rust
> for the board to function.
>
> We should add a new module-rust.bbclass instead of extending
> module.bbclass with conditional logic. This can be included by any
> modules which use Rust and handle any common setup. It can also check
> for the presence of required files (scripts/target.json & rust/*) in the
> kernel's shared workdir, and perhaps the kernel config so that we can
> give a sensible error message if they are missing. This means that
> module-rust.bbclass doesn't need to check KERNEL_FEATURES for
> rust-kernel, it can just look at the shared workdir (probably in
> do_configure) to make sure that we're ready to build a Rust module.
After I sent this, I spotted a patch for module.bbclass to check that
CONFIG_MODULES is enabled [1]. Doing the same thing in a new
module-rust.bbclass to check for CONFIG_RUST may be exactly what we
need.
[1]: https://lore.kernel.org/openembedded-core/20260204020908.864912-1-kai.kang@windriver.com/T/#u
>
> If we can't use KERNEL_FEATURES, then perhaps a new KERNEL_RUST_SUPPORT
> variable would work. In either case, this should only be checked in the
> kernel recipe itself.
>
> Bruce - what do you think about KERNEL_FEATURES being used in this way?
>
> Best regards,
>
--
Paul Barker
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread* Re: [OE-core] [PATCH v5 00/15] Enable rust support for linux kernel
2026-02-04 12:24 ` Paul Barker
@ 2026-02-04 13:52 ` Bruce Ashfield
2026-02-12 18:13 ` Harish Sadineni
1 sibling, 0 replies; 33+ messages in thread
From: Bruce Ashfield @ 2026-02-04 13:52 UTC (permalink / raw)
To: Paul Barker
Cc: Harish.Sadineni, Randy.MacLeod, Sundeep.Kokkonda,
alistair.francis, yoann.congal, elmehdi.younes, richard.purdie,
openembedded-core@lists.openembedded.org
[-- Attachment #1: Type: text/plain, Size: 8548 bytes --]
On Wed, Feb 4, 2026 at 7:24 AM Paul Barker <paul@pbarker.dev> wrote:
> On Wed, 2026-02-04 at 12:00 +0000, Paul Barker wrote:
> > On Thu, 2026-01-29 at 08:38 -0800, Sadineni, Harish via
> > lists.openembedded.org wrote:
> > > From: Harish Sadineni <Harish.Sadineni@windriver.com>
> > >
> > > v5:
> > > - Regression in autobuilder with v4 series is due to applying v4
> series together with following patch
> > > "llvm: enable LLVMgold.so build by adding binutils dependency"(
> https://lists.openembedded.org/g/openembedded-core/message/229387)
> > > is fixed by droping Alistair Francis's patch(
> https://lists.openembedded.org/g/openembedded-core/message/229091).
> > > - Updated patch "rust: install Rust library sources for 'make
> rustavailable' support" to install
> > > rust standard library sources for rust-native.
> > >
> > > v4:
> > > - Resolved patchtest failures.
> > >
> > > v3:
> > > - Removed the DISTRO_FEATURES dependency for installing Rust library
> sources in the Rust recipe,
> > > - Extended support for on target rust kernel module developmet by
> installing Rust library sources and
> > > introduced packaging of the Rust standard library sources in a
> dedicated ${PN}-src-lib package.
> > > - Integrated Alistair Francis's patch(
> https://lists.openembedded.org/g/openembedded-core/message/229091)
> > > that uses the Rust bootstrap tool to install Rust library sources
> for rust-native.
> > > - Dropped the patch that added rust-kernel to native/nativesdk feature
> filters in bitbake.conf.
> > > - Updated flags in the make-mod-scripts recipe to fix build failures
> when building Rust out-of-tree
> > > module recipes.
> > > - Dropped the bindgen-cli patch extending BBCLASSEXTEND to include
> > > nativesdk, as it has been merged into oe-core.
> > >
> > > v2:
> > > - Combined [PATCH 05/16][0] & [PATCH 06/16][1] from v1.
> > > - Updated commit message and added in code comments for patch "[PATCH
> 09/15] kernel-devsrc: copying
> > > rust-kernel source to $kerneldir/build"
> > >
> > > [0] https://lists.openembedded.org/g/openembedded-core/message/228559
> > > [1] https://lists.openembedded.org/g/openembedded-core/message/228560
> > >
> > > v1:
> > > The previous series was RFC v4, "Enable Rust support for Linux kernel"
> > > (https://lists.openembedded.org/g/openembedded-core/message/226623).
> > >
> > > In addition, Yoann Congal posted RFC v2, "Kernel Rust out-of-tree
> module support"
> > > (https://lists.openembedded.org/g/openembedded-core/message/227281),
> which builds on top of RFC v4.
> > >
> > > The current patch series is a unified version that combines both
> efforts.
> > > Compared to the earlier series, the main changes are:
> > >
> > > -Kernel configuration fragments have been moved to yocto-kernel-cache.
> > > -The kernel fragments have been removed from SRC_URI and from the files
> > > directory previously stored underrecipes-kernel/linux/files.
> > > -Updated the "[PATCH 11/16] selftest/cases/runtime_test: Add test for
> Linux Rust sample"
> > > by appending KERNEL_EXTRA_FEATURES:append =
> 'features/kernel-sample/kernel-rust-sample.scc'
> > > instead of adding this directly in the linux-yocto recipe.
> > >
> > >
> > > This patch series introduces Rust support into the linux-yocto kernel
> recipe and
> > > related build infrastructure in the Yocto Project. The goal is to
> enable building
> > > the Linux kernel with Rust components and provide support for building
> kernel module
> > > which is written in rust and also provide support to build rust kernel
> modules in sdk.
> > >
> > > And this series adds test for Linux Rust sample and also added support
> > > for out-of-tree kernel module written in Rust as well as associated
> test.
> > >
> > > Summary of patches:
> > >
> > > - Patch 01: Add required dependencies ('clang-native',
> 'rust-native','bindgen-cli-native') to the kernel to support Rust binding
> generation.
> > > - Patch 02: Install the Rust standard library source ('library/') for
> native,target and sdk.
> > > - Patch 03: Updated `kernel-yocto.bbclass` to invoke `make
> rustavailable` during 'do_kernel_configme', ensuring Rust readiness.
> > > - Patch 04: Add kernel configuration support for Rust (via
> 'kernel-rust.scc'), enabling the Rust build options in kernel config.
> > > - Patch 05: Fixed buildpaths errors when rust is enabled for kernel by
> appending --remap-path-prefix to RUST_DEBUG_REMAP
> > > - Patch 06: split `HOSTCC` flag to align with to linux-yocto and fix
> build issue with make-mod-scripts recipe.
> > > - Patch 07: Disabling ccache when rust-kernel is enabled for
> linux-yocto.
> > > - Patch 08: Copy Rust kernel sources into kernel-devsrc build
> directory which will be required while running 'make prepare' in sdk.
> > > - Patch 09: Added oe-selftest case for the Linux Rust sample.
> > > - patch 10: Copying include/config/auto.conf in STAGING_KERNEL_BUILDDIR
> > > - patch 11: Export artifacts needed for out-of-tree Rust compilation
> > > - patch 12: Prepare out-of-tree rust module compilation
> > > - patch 13: Added rust-out-of-tree-module recipe in meta-skeleton layer
> > > - Patch 14: Fixed buildpaths errors for rust-out-of-tree-module recipe
> by appending --remap-path-prefix to RUST_DEBUG_REMAP
> > > - patch 15: Added rust-out-of-tree selftest
> > >
> > > Patches have been build-tested successfully on:
> > > - qemuarm64
> > > - qemux86-64
> > >
> > > Benchmark test-result for x86-64:
> > >
> +-------------------------------+------------+-----------+-----------+-----------+
> > > > DISTRO_FEATURES | real | user | sys
> | FS usage |
> > >
> +-------------------------------+------------+-----------+-----------+-----------+
> > > > rust-kernel (enabled) | 46m1.720s | 0m28.864s | 0m3.696s
> | 58 GB |
> > > > rust-kernel (disabled) | 30m1.053s | 0m20.091s | 0m2.748s
> | 33 GB |
> > >
> +-------------------------------+------------+-----------+-----------+-----------+
> >
> > We discussed these patches on Monday and have some feedback on the
> > design. Things are nearly correct, we do want to ensure that the user
> > experience is good before merging this though as people will quickly
> > start to depend on it.
> >
> > We think it would be better if Rust support was controlled by
> > KERNEL_FEATURES instead of DISTRO_FEATURES. This option now only impacts
> > the kernel and any kernel module recipes. It also may need to change
> > depending on MACHINE which makes it not a good fit for DISTRO_FEATURES -
> > e.g. one BSP may use an older LTS kernel with no required Rust code and
> > a different BSP may use a newer kernel and need a driver written in Rust
> > for the board to function.
> >
> > We should add a new module-rust.bbclass instead of extending
> > module.bbclass with conditional logic. This can be included by any
> > modules which use Rust and handle any common setup. It can also check
> > for the presence of required files (scripts/target.json & rust/*) in the
> > kernel's shared workdir, and perhaps the kernel config so that we can
> > give a sensible error message if they are missing. This means that
> > module-rust.bbclass doesn't need to check KERNEL_FEATURES for
> > rust-kernel, it can just look at the shared workdir (probably in
> > do_configure) to make sure that we're ready to build a Rust module.
>
> After I sent this, I spotted a patch for module.bbclass to check that
> CONFIG_MODULES is enabled [1]. Doing the same thing in a new
> module-rust.bbclass to check for CONFIG_RUST may be exactly what we
> need.
>
Except that I don't particularly like that check as it is in that patch,
so I wouldn't recommend copying it.
Make the invocation of the task conditional, not conditional checks
in the tasks.
Bruce
>
> [1]:
> https://lore.kernel.org/openembedded-core/20260204020908.864912-1-kai.kang@windriver.com/T/#u
>
> >
> > If we can't use KERNEL_FEATURES, then perhaps a new KERNEL_RUST_SUPPORT
> > variable would work. In either case, this should only be checked in the
> > kernel recipe itself.
> >
> > Bruce - what do you think about KERNEL_FEATURES being used in this way?
> >
> > Best regards,
> >
>
> --
> Paul Barker
>
>
--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end
- "Use the force Harry" - Gandalf, Star Trek II
[-- Attachment #2: Type: text/html, Size: 11723 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread* Re: [OE-core] [PATCH v5 00/15] Enable rust support for linux kernel
2026-02-04 12:24 ` Paul Barker
2026-02-04 13:52 ` Bruce Ashfield
@ 2026-02-12 18:13 ` Harish Sadineni
1 sibling, 0 replies; 33+ messages in thread
From: Harish Sadineni @ 2026-02-12 18:13 UTC (permalink / raw)
To: Paul Barker
Cc: Randy.MacLeod, Sundeep.Kokkonda,
openembedded-core@lists.openembedded.org, Bruce Ashfield
On 2/4/2026 5:54 PM, Paul Barker wrote:
> On Wed, 2026-02-04 at 12:00 +0000, Paul Barker wrote:
>> On Thu, 2026-01-29 at 08:38 -0800, Sadineni, Harish via
>> lists.openembedded.org wrote:
>>> From: Harish Sadineni <Harish.Sadineni@windriver.com>
>>>
>>> v5:
>>> - Regression in autobuilder with v4 series is due to applying v4 series together with following patch
>>> "llvm: enable LLVMgold.so build by adding binutils dependency"(https://lists.openembedded.org/g/openembedded-core/message/229387)
>>> is fixed by droping Alistair Francis's patch(https://lists.openembedded.org/g/openembedded-core/message/229091).
>>> - Updated patch "rust: install Rust library sources for 'make rustavailable' support" to install
>>> rust standard library sources for rust-native.
>>>
>>> v4:
>>> - Resolved patchtest failures.
>>>
>>> v3:
>>> - Removed the DISTRO_FEATURES dependency for installing Rust library sources in the Rust recipe,
>>> - Extended support for on target rust kernel module developmet by installing Rust library sources and
>>> introduced packaging of the Rust standard library sources in a dedicated ${PN}-src-lib package.
>>> - Integrated Alistair Francis's patch(https://lists.openembedded.org/g/openembedded-core/message/229091)
>>> that uses the Rust bootstrap tool to install Rust library sources for rust-native.
>>> - Dropped the patch that added rust-kernel to native/nativesdk feature filters in bitbake.conf.
>>> - Updated flags in the make-mod-scripts recipe to fix build failures when building Rust out-of-tree
>>> module recipes.
>>> - Dropped the bindgen-cli patch extending BBCLASSEXTEND to include
>>> nativesdk, as it has been merged into oe-core.
>>>
>>> v2:
>>> - Combined [PATCH 05/16][0] & [PATCH 06/16][1] from v1.
>>> - Updated commit message and added in code comments for patch "[PATCH 09/15] kernel-devsrc: copying
>>> rust-kernel source to $kerneldir/build"
>>>
>>> [0] https://lists.openembedded.org/g/openembedded-core/message/228559
>>> [1] https://lists.openembedded.org/g/openembedded-core/message/228560
>>>
>>> v1:
>>> The previous series was RFC v4, "Enable Rust support for Linux kernel"
>>> (https://lists.openembedded.org/g/openembedded-core/message/226623).
>>>
>>> In addition, Yoann Congal posted RFC v2, "Kernel Rust out-of-tree module support"
>>> (https://lists.openembedded.org/g/openembedded-core/message/227281), which builds on top of RFC v4.
>>>
>>> The current patch series is a unified version that combines both efforts.
>>> Compared to the earlier series, the main changes are:
>>>
>>> -Kernel configuration fragments have been moved to yocto-kernel-cache.
>>> -The kernel fragments have been removed from SRC_URI and from the files
>>> directory previously stored underrecipes-kernel/linux/files.
>>> -Updated the "[PATCH 11/16] selftest/cases/runtime_test: Add test for Linux Rust sample"
>>> by appending KERNEL_EXTRA_FEATURES:append = 'features/kernel-sample/kernel-rust-sample.scc'
>>> instead of adding this directly in the linux-yocto recipe.
>>>
>>>
>>> This patch series introduces Rust support into the linux-yocto kernel recipe and
>>> related build infrastructure in the Yocto Project. The goal is to enable building
>>> the Linux kernel with Rust components and provide support for building kernel module
>>> which is written in rust and also provide support to build rust kernel modules in sdk.
>>>
>>> And this series adds test for Linux Rust sample and also added support
>>> for out-of-tree kernel module written in Rust as well as associated test.
>>>
>>> Summary of patches:
>>>
>>> - Patch 01: Add required dependencies ('clang-native', 'rust-native','bindgen-cli-native') to the kernel to support Rust binding generation.
>>> - Patch 02: Install the Rust standard library source ('library/') for native,target and sdk.
>>> - Patch 03: Updated `kernel-yocto.bbclass` to invoke `make rustavailable` during 'do_kernel_configme', ensuring Rust readiness.
>>> - Patch 04: Add kernel configuration support for Rust (via 'kernel-rust.scc'), enabling the Rust build options in kernel config.
>>> - Patch 05: Fixed buildpaths errors when rust is enabled for kernel by appending --remap-path-prefix to RUST_DEBUG_REMAP
>>> - Patch 06: split `HOSTCC` flag to align with to linux-yocto and fix build issue with make-mod-scripts recipe.
>>> - Patch 07: Disabling ccache when rust-kernel is enabled for linux-yocto.
>>> - Patch 08: Copy Rust kernel sources into kernel-devsrc build directory which will be required while running 'make prepare' in sdk.
>>> - Patch 09: Added oe-selftest case for the Linux Rust sample.
>>> - patch 10: Copying include/config/auto.conf in STAGING_KERNEL_BUILDDIR
>>> - patch 11: Export artifacts needed for out-of-tree Rust compilation
>>> - patch 12: Prepare out-of-tree rust module compilation
>>> - patch 13: Added rust-out-of-tree-module recipe in meta-skeleton layer
>>> - Patch 14: Fixed buildpaths errors for rust-out-of-tree-module recipe by appending --remap-path-prefix to RUST_DEBUG_REMAP
>>> - patch 15: Added rust-out-of-tree selftest
>>>
>>> Patches have been build-tested successfully on:
>>> - qemuarm64
>>> - qemux86-64
>>>
>>> Benchmark test-result for x86-64:
>>> +-------------------------------+------------+-----------+-----------+-----------+
>>>> DISTRO_FEATURES | real | user | sys | FS usage |
>>> +-------------------------------+------------+-----------+-----------+-----------+
>>>> rust-kernel (enabled) | 46m1.720s | 0m28.864s | 0m3.696s | 58 GB |
>>>> rust-kernel (disabled) | 30m1.053s | 0m20.091s | 0m2.748s | 33 GB |
>>> +-------------------------------+------------+-----------+-----------+-----------+
>> We discussed these patches on Monday and have some feedback on the
>> design. Things are nearly correct, we do want to ensure that the user
>> experience is good before merging this though as people will quickly
>> start to depend on it.
>>
>> We think it would be better if Rust support was controlled by
>> KERNEL_FEATURES instead of DISTRO_FEATURES. This option now only impacts
>> the kernel and any kernel module recipes. It also may need to change
>> depending on MACHINE which makes it not a good fit for DISTRO_FEATURES -
>> e.g. one BSP may use an older LTS kernel with no required Rust code and
>> a different BSP may use a newer kernel and need a driver written in Rust
>> for the board to function.
>>
>> We should add a new module-rust.bbclass instead of extending
>> module.bbclass with conditional logic. This can be included by any
>> modules which use Rust and handle any common setup. It can also check
>> for the presence of required files (scripts/target.json & rust/*) in the
>> kernel's shared workdir, and perhaps the kernel config so that we can
>> give a sensible error message if they are missing. This means that
>> module-rust.bbclass doesn't need to check KERNEL_FEATURES for
>> rust-kernel, it can just look at the shared workdir (probably in
>> do_configure) to make sure that we're ready to build a Rust module.
> After I sent this, I spotted a patch for module.bbclass to check that
> CONFIG_MODULES is enabled [1]. Doing the same thing in a new
> module-rust.bbclass to check for CONFIG_RUST may be exactly what we
> need.
>
> [1]: https://lore.kernel.org/openembedded-core/20260204020908.864912-1-kai.kang@windriver.com/T/#u
Hi Paul,
I have incorporated the suggested changes and sent v6 of the series.
Thanks,
Harish
>> If we can't use KERNEL_FEATURES, then perhaps a new KERNEL_RUST_SUPPORT
>> variable would work. In either case, this should only be checked in the
>> kernel recipe itself.
>>
>> Bruce - what do you think about KERNEL_FEATURES being used in this way?
>>
>> Best regards,
>>
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [OE-core] [PATCH v5 00/15] Enable rust support for linux kernel
2026-02-04 12:00 ` [OE-core] " Paul Barker
2026-02-04 12:24 ` Paul Barker
@ 2026-02-04 13:54 ` Bruce Ashfield
1 sibling, 0 replies; 33+ messages in thread
From: Bruce Ashfield @ 2026-02-04 13:54 UTC (permalink / raw)
To: paul
Cc: Harish.Sadineni, Randy.MacLeod, Sundeep.Kokkonda,
alistair.francis, yoann.congal, elmehdi.younes, richard.purdie,
openembedded-core@lists.openembedded.org
[-- Attachment #1: Type: text/plain, Size: 8677 bytes --]
On Wed, Feb 4, 2026 at 7:00 AM Paul Barker via lists.openembedded.org <paul=
pbarker.dev@lists.openembedded.org> wrote:
> On Thu, 2026-01-29 at 08:38 -0800, Sadineni, Harish via
> lists.openembedded.org wrote:
> > From: Harish Sadineni <Harish.Sadineni@windriver.com>
> >
> > v5:
> > - Regression in autobuilder with v4 series is due to applying v4 series
> together with following patch
> > "llvm: enable LLVMgold.so build by adding binutils dependency"(
> https://lists.openembedded.org/g/openembedded-core/message/229387)
> > is fixed by droping Alistair Francis's patch(
> https://lists.openembedded.org/g/openembedded-core/message/229091).
> > - Updated patch "rust: install Rust library sources for 'make
> rustavailable' support" to install
> > rust standard library sources for rust-native.
> >
> > v4:
> > - Resolved patchtest failures.
> >
> > v3:
> > - Removed the DISTRO_FEATURES dependency for installing Rust library
> sources in the Rust recipe,
> > - Extended support for on target rust kernel module developmet by
> installing Rust library sources and
> > introduced packaging of the Rust standard library sources in a
> dedicated ${PN}-src-lib package.
> > - Integrated Alistair Francis's patch(
> https://lists.openembedded.org/g/openembedded-core/message/229091)
> > that uses the Rust bootstrap tool to install Rust library sources for
> rust-native.
> > - Dropped the patch that added rust-kernel to native/nativesdk feature
> filters in bitbake.conf.
> > - Updated flags in the make-mod-scripts recipe to fix build failures
> when building Rust out-of-tree
> > module recipes.
> > - Dropped the bindgen-cli patch extending BBCLASSEXTEND to include
> > nativesdk, as it has been merged into oe-core.
> >
> > v2:
> > - Combined [PATCH 05/16][0] & [PATCH 06/16][1] from v1.
> > - Updated commit message and added in code comments for patch "[PATCH
> 09/15] kernel-devsrc: copying
> > rust-kernel source to $kerneldir/build"
> >
> > [0] https://lists.openembedded.org/g/openembedded-core/message/228559
> > [1] https://lists.openembedded.org/g/openembedded-core/message/228560
> >
> > v1:
> > The previous series was RFC v4, "Enable Rust support for Linux kernel"
> > (https://lists.openembedded.org/g/openembedded-core/message/226623).
> >
> > In addition, Yoann Congal posted RFC v2, "Kernel Rust out-of-tree module
> support"
> > (https://lists.openembedded.org/g/openembedded-core/message/227281),
> which builds on top of RFC v4.
> >
> > The current patch series is a unified version that combines both efforts.
> > Compared to the earlier series, the main changes are:
> >
> > -Kernel configuration fragments have been moved to yocto-kernel-cache.
> > -The kernel fragments have been removed from SRC_URI and from the files
> > directory previously stored underrecipes-kernel/linux/files.
> > -Updated the "[PATCH 11/16] selftest/cases/runtime_test: Add test for
> Linux Rust sample"
> > by appending KERNEL_EXTRA_FEATURES:append =
> 'features/kernel-sample/kernel-rust-sample.scc'
> > instead of adding this directly in the linux-yocto recipe.
> >
> >
> > This patch series introduces Rust support into the linux-yocto kernel
> recipe and
> > related build infrastructure in the Yocto Project. The goal is to enable
> building
> > the Linux kernel with Rust components and provide support for building
> kernel module
> > which is written in rust and also provide support to build rust kernel
> modules in sdk.
> >
> > And this series adds test for Linux Rust sample and also added support
> > for out-of-tree kernel module written in Rust as well as associated test.
> >
> > Summary of patches:
> >
> > - Patch 01: Add required dependencies ('clang-native',
> 'rust-native','bindgen-cli-native') to the kernel to support Rust binding
> generation.
> > - Patch 02: Install the Rust standard library source ('library/') for
> native,target and sdk.
> > - Patch 03: Updated `kernel-yocto.bbclass` to invoke `make
> rustavailable` during 'do_kernel_configme', ensuring Rust readiness.
> > - Patch 04: Add kernel configuration support for Rust (via
> 'kernel-rust.scc'), enabling the Rust build options in kernel config.
> > - Patch 05: Fixed buildpaths errors when rust is enabled for kernel by
> appending --remap-path-prefix to RUST_DEBUG_REMAP
> > - Patch 06: split `HOSTCC` flag to align with to linux-yocto and fix
> build issue with make-mod-scripts recipe.
> > - Patch 07: Disabling ccache when rust-kernel is enabled for linux-yocto.
> > - Patch 08: Copy Rust kernel sources into kernel-devsrc build directory
> which will be required while running 'make prepare' in sdk.
> > - Patch 09: Added oe-selftest case for the Linux Rust sample.
> > - patch 10: Copying include/config/auto.conf in STAGING_KERNEL_BUILDDIR
> > - patch 11: Export artifacts needed for out-of-tree Rust compilation
> > - patch 12: Prepare out-of-tree rust module compilation
> > - patch 13: Added rust-out-of-tree-module recipe in meta-skeleton layer
> > - Patch 14: Fixed buildpaths errors for rust-out-of-tree-module recipe
> by appending --remap-path-prefix to RUST_DEBUG_REMAP
> > - patch 15: Added rust-out-of-tree selftest
> >
> > Patches have been build-tested successfully on:
> > - qemuarm64
> > - qemux86-64
> >
> > Benchmark test-result for x86-64:
> >
> +-------------------------------+------------+-----------+-----------+-----------+
> > > DISTRO_FEATURES | real | user | sys |
> FS usage |
> >
> +-------------------------------+------------+-----------+-----------+-----------+
> > > rust-kernel (enabled) | 46m1.720s | 0m28.864s | 0m3.696s |
> 58 GB |
> > > rust-kernel (disabled) | 30m1.053s | 0m20.091s | 0m2.748s |
> 33 GB |
> >
> +-------------------------------+------------+-----------+-----------+-----------+
>
> We discussed these patches on Monday and have some feedback on the
> design. Things are nearly correct, we do want to ensure that the user
> experience is good before merging this though as people will quickly
> start to depend on it.
>
> We think it would be better if Rust support was controlled by
> KERNEL_FEATURES instead of DISTRO_FEATURES. This option now only impacts
> the kernel and any kernel module recipes. It also may need to change
> depending on MACHINE which makes it not a good fit for DISTRO_FEATURES -
> e.g. one BSP may use an older LTS kernel with no required Rust code and
> a different BSP may use a newer kernel and need a driver written in Rust
> for the board to function.
>
> We should add a new module-rust.bbclass instead of extending
> module.bbclass with conditional logic. This can be included by any
> modules which use Rust and handle any common setup. It can also check
> for the presence of required files (scripts/target.json & rust/*) in the
> kernel's shared workdir, and perhaps the kernel config so that we can
> give a sensible error message if they are missing. This means that
> module-rust.bbclass doesn't need to check KERNEL_FEATURES for
> rust-kernel, it can just look at the shared workdir (probably in
> do_configure) to make sure that we're ready to build a Rust module.
>
> If we can't use KERNEL_FEATURES, then perhaps a new KERNEL_RUST_SUPPORT
> variable would work. In either case, this should only be checked in the
> kernel recipe itself.
>
> Bruce - what do you think about KERNEL_FEATURES being used in this way?
>
It's a reasonable idea. KERNEL_FEATURES are supposed to abstract
the individual CONFIG_ items from spreading throughout the code base
so checking KERNEL_FEATURES is acceptable for coordinating different
parts of kernel infrastructure.
I'll just repeat my feedback that I sent earlier (and also to your other
reply in this email), that I prefer to make the tasks in the bbclasses
conditional, not have them checking for conditionals within the tasks.
Bruce
>
> Best regards,
>
> --
> Paul Barker
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#230511):
> https://lists.openembedded.org/g/openembedded-core/message/230511
> Mute This Topic: https://lists.openembedded.org/mt/117528967/1050810
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> bruce.ashfield@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end
- "Use the force Harry" - Gandalf, Star Trek II
[-- Attachment #2: Type: text/html, Size: 12115 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
[parent not found: <188F412032A5A3F8.3408700@lists.openembedded.org>]
* Re: [OE-core] [PATCH v5 11/15] kernel.bbclass: Export artifacts needed for out-of-tree Rust compilation
[not found] ` <188F412032A5A3F8.3408700@lists.openembedded.org>
@ 2026-02-11 16:19 ` Harish Sadineni
2026-02-12 11:25 ` Yoann Congal
0 siblings, 1 reply; 33+ messages in thread
From: Harish Sadineni @ 2026-02-11 16:19 UTC (permalink / raw)
To: openembedded-core, Yoann Congal
Cc: Randy.MacLeod, Sundeep.Kokkonda, alistair.francis, bruce.ashfield,
elmehdi.younes, richard.purdie
On 1/29/2026 10:09 PM, Sadineni, Harish via lists.openembedded.org wrote:
> From: Yoann Congal <yoann.congal@smile.fr>
>
> Publish artifacts from kernel compilation to allow out-of-tree Rust
> compilation:
> * scripts/target.json: target definition: architecture, ABI, compiler
> options, ...
> * rust/: the crates compiled by the kernel available to
> out-of-tree-modules
Hi Yoann,
I am dropping this patch “kernel.bbclass: Export artifacts needed for
out-of-tree Rust compilation” from my v6 patch series.
Without this patch, target.json and the rust/ directory were already
getting published for x86_64. On arm64, target.json will not be created,
yet the module is still generated and works fine.
When building rust-out-f-tree-module for arm64 with this patch applied,
it emits a warning that Out-of-tree rust modules build will fail due to
a missing target.json in kernel. However, in practice, the build
completes successfully.
I have tested without this patch on both arm64 and x86_64, both tests
were successful.
So, this patch does not appear to be necessary. Are you OK with dropping
this patch?
I have pushed the updated changes to the below oe-contrib branch:
https://git.openembedded.org/openembedded-core-contrib/log/?h=deepesh/rust-in-kernel-v6
Additionally, I have extended the ccache disabling to make-mod-scripts
(as part of "kernel: Disable ccache when kernel rust support is enabled"
patch) and updated "meta-skeleton: Add rust-out-of-tree-module recipe"
to align with the new changes.
Thanks,
Harish
> Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
> Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
> ---
> meta/classes-recipe/kernel.bbclass | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
> index 30a10b0801..dfb8604a68 100644
> --- a/meta/classes-recipe/kernel.bbclass
> +++ b/meta/classes-recipe/kernel.bbclass
> @@ -632,6 +632,24 @@ do_shared_workdir () {
> cp -r scripts/gcc-plugins ${kerneldir}/scripts
> fi
>
> + if ${@bb.utils.contains("DISTRO_FEATURES", "rust-kernel", "true", "false", d)}; then
> + # Copy target.json file needed for out-of-tree rust modules
> + if [ -e scripts/target.json ]; then
> + bbnote "Copying scripts/target.json"
> + mkdir -p ${kerneldir}/scripts
> + cp scripts/target.json ${kerneldir}/scripts
> + else
> + bbwarn "scripts/target.json not found in compiled kernel. Out-of-tree rust modules will fail to build."
> + fi
> +
> + # Copy rust/ needed by out-of-tree module (firstly for the core rust crate)
> + if [ -e rust/ ]; then
> + bbnote "Copying rust/"
> + cp -r rust ${kerneldir}/
> + else
> + bbwarn "rust/ not found in compiled kernel. Out-of-tree rust modules will fail to build."
> + fi
> + fi
> }
>
> # We don't need to stage anything, not the modules/firmware since those would clash with linux-firmware
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#230151): https://lists.openembedded.org/g/openembedded-core/message/230151
> Mute This Topic: https://lists.openembedded.org/mt/117528980/8054390
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [Harish.Sadineni@windriver.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
^ permalink raw reply [flat|nested] 33+ messages in thread* Re: [OE-core] [PATCH v5 11/15] kernel.bbclass: Export artifacts needed for out-of-tree Rust compilation
2026-02-11 16:19 ` [OE-core] [PATCH v5 11/15] kernel.bbclass: Export artifacts needed for out-of-tree Rust compilation Harish Sadineni
@ 2026-02-12 11:25 ` Yoann Congal
2026-02-12 12:44 ` Harish Sadineni
0 siblings, 1 reply; 33+ messages in thread
From: Yoann Congal @ 2026-02-12 11:25 UTC (permalink / raw)
To: Harish Sadineni, openembedded-core
Cc: Randy.MacLeod, Sundeep.Kokkonda, alistair.francis, bruce.ashfield,
elmehdi.younes, richard.purdie
On Wed Feb 11, 2026 at 5:19 PM CET, Harish Sadineni wrote:
>
> On 1/29/2026 10:09 PM, Sadineni, Harish via lists.openembedded.org wrote:
>> From: Yoann Congal <yoann.congal@smile.fr>
>>
>> Publish artifacts from kernel compilation to allow out-of-tree Rust
>> compilation:
>> * scripts/target.json: target definition: architecture, ABI, compiler
>> options, ...
>> * rust/: the crates compiled by the kernel available to
>> out-of-tree-modules
> Hi Yoann,
>
> I am dropping this patch “kernel.bbclass: Export artifacts needed for
> out-of-tree Rust compilation” from my v6 patch series.
>
> Without this patch, target.json and the rust/ directory were already
> getting published for x86_64. On arm64, target.json will not be created,
> yet the module is still generated and works fine.
>
> When building rust-out-f-tree-module for arm64 with this patch applied,
> it emits a warning that Out-of-tree rust modules build will fail due to
> a missing target.json in kernel. However, in practice, the build
> completes successfully.
>
> I have tested without this patch on both arm64 and x86_64, both tests
> were successful.
>
> So, this patch does not appear to be necessary. Are you OK with dropping
> this patch?
Yes, as long as it builds without warnings and test succesfully, I'm fine with it.
> I have pushed the updated changes to the below oe-contrib branch:
> https://git.openembedded.org/openembedded-core-contrib/log/?h=deepesh/rust-in-kernel-v6
>
> Additionally, I have extended the ccache disabling to make-mod-scripts
> (as part of "kernel: Disable ccache when kernel rust support is enabled"
> patch) and updated "meta-skeleton: Add rust-out-of-tree-module recipe"
> to align with the new changes.
Shouldn't the KERNEL_RUST_SUPPORT check in
rust-out-of-tree-module_git.bb be moved to the module-rust class?
Generally, If you think that you rewrote some patches, I'm OK with you
taking authorship (leaving me as Co-developed-by). That should allow you
to edit patches more freely.
Regards,
> Thanks,
> Harish
>> Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
>> Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
>> ---
>> meta/classes-recipe/kernel.bbclass | 18 ++++++++++++++++++
>> 1 file changed, 18 insertions(+)
>>
>> diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
>> index 30a10b0801..dfb8604a68 100644
>> --- a/meta/classes-recipe/kernel.bbclass
>> +++ b/meta/classes-recipe/kernel.bbclass
>> @@ -632,6 +632,24 @@ do_shared_workdir () {
>> cp -r scripts/gcc-plugins ${kerneldir}/scripts
>> fi
>>
>> + if ${@bb.utils.contains("DISTRO_FEATURES", "rust-kernel", "true", "false", d)}; then
>> + # Copy target.json file needed for out-of-tree rust modules
>> + if [ -e scripts/target.json ]; then
>> + bbnote "Copying scripts/target.json"
>> + mkdir -p ${kerneldir}/scripts
>> + cp scripts/target.json ${kerneldir}/scripts
>> + else
>> + bbwarn "scripts/target.json not found in compiled kernel. Out-of-tree rust modules will fail to build."
>> + fi
>> +
>> + # Copy rust/ needed by out-of-tree module (firstly for the core rust crate)
>> + if [ -e rust/ ]; then
>> + bbnote "Copying rust/"
>> + cp -r rust ${kerneldir}/
>> + else
>> + bbwarn "rust/ not found in compiled kernel. Out-of-tree rust modules will fail to build."
>> + fi
>> + fi
>> }
>>
>> # We don't need to stage anything, not the modules/firmware since those would clash with linux-firmware
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#230151): https://lists.openembedded.org/g/openembedded-core/message/230151
>> Mute This Topic: https://lists.openembedded.org/mt/117528980/8054390
>> Group Owner: openembedded-core+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [Harish.Sadineni@windriver.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
--
Yoann Congal
Smile ECS
^ permalink raw reply [flat|nested] 33+ messages in thread* Re: [OE-core] [PATCH v5 11/15] kernel.bbclass: Export artifacts needed for out-of-tree Rust compilation
2026-02-12 11:25 ` Yoann Congal
@ 2026-02-12 12:44 ` Harish Sadineni
0 siblings, 0 replies; 33+ messages in thread
From: Harish Sadineni @ 2026-02-12 12:44 UTC (permalink / raw)
To: Yoann Congal, openembedded-core
Cc: Randy.MacLeod, Sundeep.Kokkonda, alistair.francis, bruce.ashfield,
elmehdi.younes, richard.purdie
On 2/12/2026 4:55 PM, Yoann Congal wrote:
> CAUTION: This email comes from a non Wind River email account!
> Do not click links or open attachments unless you recognize the sender and know the content is safe.
>
> On Wed Feb 11, 2026 at 5:19 PM CET, Harish Sadineni wrote:
>> On 1/29/2026 10:09 PM, Sadineni, Harish via lists.openembedded.org wrote:
>>> From: Yoann Congal <yoann.congal@smile.fr>
>>>
>>> Publish artifacts from kernel compilation to allow out-of-tree Rust
>>> compilation:
>>> * scripts/target.json: target definition: architecture, ABI, compiler
>>> options, ...
>>> * rust/: the crates compiled by the kernel available to
>>> out-of-tree-modules
>> Hi Yoann,
>>
>> I am dropping this patch “kernel.bbclass: Export artifacts needed for
>> out-of-tree Rust compilation” from my v6 patch series.
>>
>> Without this patch, target.json and the rust/ directory were already
>> getting published for x86_64. On arm64, target.json will not be created,
>> yet the module is still generated and works fine.
>>
>> When building rust-out-f-tree-module for arm64 with this patch applied,
>> it emits a warning that Out-of-tree rust modules build will fail due to
>> a missing target.json in kernel. However, in practice, the build
>> completes successfully.
>>
>> I have tested without this patch on both arm64 and x86_64, both tests
>> were successful.
>>
>> So, this patch does not appear to be necessary. Are you OK with dropping
>> this patch?
> Yes, as long as it builds without warnings and test succesfully, I'm fine with it.
>
>> I have pushed the updated changes to the below oe-contrib branch:
>> https://git.openembedded.org/openembedded-core-contrib/log/?h=deepesh/rust-in-kernel-v6
>>
>> Additionally, I have extended the ccache disabling to make-mod-scripts
>> (as part of "kernel: Disable ccache when kernel rust support is enabled"
>> patch) and updated "meta-skeleton: Add rust-out-of-tree-module recipe"
>> to align with the new changes.
> Shouldn't the KERNEL_RUST_SUPPORT check in
> rust-out-of-tree-module_git.bb be moved to the module-rust class?
Yes, that should be doable. Moving the 'KERNEL_RUST_SUPPORT' check to
the 'module-rust' class makes sense to centralize the logic.
I'll update that change.
>
> Generally, If you think that you rewrote some patches, I'm OK with you
> taking authorship (leaving me as Co-developed-by). That should allow you
> to edit patches more freely.
Thanks. I’ll take authorship for the rewritten patches and add you as
Co-developed-by.
Thanks,
Harish
>
> Regards,
>
>> Thanks,
>> Harish
>>> Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
>>> Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
>>> ---
>>> meta/classes-recipe/kernel.bbclass | 18 ++++++++++++++++++
>>> 1 file changed, 18 insertions(+)
>>>
>>> diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
>>> index 30a10b0801..dfb8604a68 100644
>>> --- a/meta/classes-recipe/kernel.bbclass
>>> +++ b/meta/classes-recipe/kernel.bbclass
>>> @@ -632,6 +632,24 @@ do_shared_workdir () {
>>> cp -r scripts/gcc-plugins ${kerneldir}/scripts
>>> fi
>>>
>>> + if ${@bb.utils.contains("DISTRO_FEATURES", "rust-kernel", "true", "false", d)}; then
>>> + # Copy target.json file needed for out-of-tree rust modules
>>> + if [ -e scripts/target.json ]; then
>>> + bbnote "Copying scripts/target.json"
>>> + mkdir -p ${kerneldir}/scripts
>>> + cp scripts/target.json ${kerneldir}/scripts
>>> + else
>>> + bbwarn "scripts/target.json not found in compiled kernel. Out-of-tree rust modules will fail to build."
>>> + fi
>>> +
>>> + # Copy rust/ needed by out-of-tree module (firstly for the core rust crate)
>>> + if [ -e rust/ ]; then
>>> + bbnote "Copying rust/"
>>> + cp -r rust ${kerneldir}/
>>> + else
>>> + bbwarn "rust/ not found in compiled kernel. Out-of-tree rust modules will fail to build."
>>> + fi
>>> + fi
>>> }
>>>
>>> # We don't need to stage anything, not the modules/firmware since those would clash with linux-firmware
>>>
>>> -=-=-=-=-=-=-=-=-=-=-=-
>>> Links: You receive all messages sent to this group.
>>> View/Reply Online (#230151): https://lists.openembedded.org/g/openembedded-core/message/230151
>>> Mute This Topic: https://lists.openembedded.org/mt/117528980/8054390
>>> Group Owner: openembedded-core+owner@lists.openembedded.org
>>> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [Harish.Sadineni@windriver.com]
>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>
>
> --
> Yoann Congal
> Smile ECS
>
^ permalink raw reply [flat|nested] 33+ messages in thread