* [PATCH RFC v2 1/8] bindgen-cli: extend BBCLASSEXTEND to include nativesdk
2025-11-05 13:09 [PATCH RFC v2 0/8] Enable rust support for linux kernel Harish.Sadineni
@ 2025-11-05 13:09 ` Harish.Sadineni
2025-11-05 13:09 ` [PATCH RFC v2 2/8] linux-yocto: add clang-native,rust-native and bindgen-cli-native to DEPENDS Harish.Sadineni
` (7 subsequent siblings)
8 siblings, 0 replies; 21+ messages in thread
From: Harish.Sadineni @ 2025-11-05 13:09 UTC (permalink / raw)
To: openembedded-core
Cc: Randy.MacLeod, bruce.ashfield, sundeep.kokkonda, elmehdi.younes
From: Harish Sadineni <Harish.Sadineni@windriver.com>
To support building Rust bindings in the SDK environment, bindgen needs to
be available for the `nativesdk` class as well.
This is required as part of making Rust available, where bindgen is a common
dependency for generating Rust FFI bindings from C headers during cross-compilation.
Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
meta/recipes-devtools/bindgen-cli/bindgen-cli_0.72.1.bb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/recipes-devtools/bindgen-cli/bindgen-cli_0.72.1.bb b/meta/recipes-devtools/bindgen-cli/bindgen-cli_0.72.1.bb
index 2f3ec04e82..72dadfe52f 100644
--- a/meta/recipes-devtools/bindgen-cli/bindgen-cli_0.72.1.bb
+++ b/meta/recipes-devtools/bindgen-cli/bindgen-cli_0.72.1.bb
@@ -15,4 +15,4 @@ do_install:append:class-native() {
create_wrapper ${D}/${bindir}/bindgen LIBCLANG_PATH="${STAGING_LIBDIR_NATIVE}"
}
-BBCLASSEXTEND = "native"
+BBCLASSEXTEND = "native nativesdk"
--
2.49.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH RFC v2 2/8] linux-yocto: add clang-native,rust-native and bindgen-cli-native to DEPENDS
2025-11-05 13:09 [PATCH RFC v2 0/8] Enable rust support for linux kernel Harish.Sadineni
2025-11-05 13:09 ` [PATCH RFC v2 1/8] bindgen-cli: extend BBCLASSEXTEND to include nativesdk Harish.Sadineni
@ 2025-11-05 13:09 ` Harish.Sadineni
2025-11-05 13:30 ` Bruce Ashfield
2025-11-05 13:09 ` [PATCH RFC v2 3/8] rust: install Rust library sources for 'make rustavailable' support Harish.Sadineni
` (6 subsequent siblings)
8 siblings, 1 reply; 21+ messages in thread
From: Harish.Sadineni @ 2025-11-05 13:09 UTC (permalink / raw)
To: openembedded-core
Cc: Randy.MacLeod, bruce.ashfield, sundeep.kokkonda, elmehdi.younes
From: Harish Sadineni <Harish.Sadineni@windriver.com>
Add `clang-native`, `rust-native' and `bindgen-cli-native` to `DEPENDS` 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 | 1 +
1 file changed, 1 insertion(+)
diff --git a/meta/recipes-kernel/linux/linux-yocto.inc b/meta/recipes-kernel/linux/linux-yocto.inc
index 4d0a726bb6..e2ffd96b59 100644
--- a/meta/recipes-kernel/linux/linux-yocto.inc
+++ b/meta/recipes-kernel/linux/linux-yocto.inc
@@ -81,6 +81,7 @@ 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"
+DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', 'clang-native rust-native bindgen-cli-native', '', d)}"
# 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] 21+ messages in thread* Re: [PATCH RFC v2 2/8] linux-yocto: add clang-native,rust-native and bindgen-cli-native to DEPENDS
2025-11-05 13:09 ` [PATCH RFC v2 2/8] linux-yocto: add clang-native,rust-native and bindgen-cli-native to DEPENDS Harish.Sadineni
@ 2025-11-05 13:30 ` Bruce Ashfield
2025-11-05 16:25 ` Randy MacLeod
0 siblings, 1 reply; 21+ messages in thread
From: Bruce Ashfield @ 2025-11-05 13:30 UTC (permalink / raw)
To: Harish.Sadineni
Cc: openembedded-core, Randy.MacLeod, sundeep.kokkonda,
elmehdi.younes
[-- Attachment #1: Type: text/plain, Size: 1972 bytes --]
I'm reviewing both series that have come out for rust in the kernel.
I'll leave it up to the submitters to figure out if there are differences
between
the two series that need to be consolidated.
On Wed, Nov 5, 2025 at 8:10 AM <Harish.Sadineni@windriver.com> wrote:
> From: Harish Sadineni <Harish.Sadineni@windriver.com>
>
> Add `clang-native`, `rust-native' and `bindgen-cli-native` to `DEPENDS`
> 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 | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/meta/recipes-kernel/linux/linux-yocto.inc
> b/meta/recipes-kernel/linux/linux-yocto.inc
> index 4d0a726bb6..e2ffd96b59 100644
> --- a/meta/recipes-kernel/linux/linux-yocto.inc
> +++ b/meta/recipes-kernel/linux/linux-yocto.inc
> @@ -81,6 +81,7 @@ 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"
> +DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel',
> 'clang-native rust-native bindgen-cli-native', '', d)}"
>
I'd suggest that those dependencies should be in a variable, assigned with
?= and then use the
variable in the DEPENDS line. That makes it easier to adjust from
bbappends, etc.
Bruce
>
> # 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
>
>
--
- 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: 3467 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: [PATCH RFC v2 2/8] linux-yocto: add clang-native,rust-native and bindgen-cli-native to DEPENDS
2025-11-05 13:30 ` Bruce Ashfield
@ 2025-11-05 16:25 ` Randy MacLeod
0 siblings, 0 replies; 21+ messages in thread
From: Randy MacLeod @ 2025-11-05 16:25 UTC (permalink / raw)
To: Bruce Ashfield, Harish.Sadineni
Cc: openembedded-core, sundeep.kokkonda, elmehdi.younes, Yoann Congal
[-- Attachment #1: Type: text/plain, Size: 3927 bytes --]
On 2025-11-05 8:30 a.m., Bruce Ashfield wrote:
> I'm reviewing both series that have come out for rust in the kernel.
>
> I'll leave it up to the submitters to figure out if there are
> differences between
> the two series that need to be consolidated.
Yoann and I have been talking and unfortunately, Elmedhi doesn't have
time to
continue to work on enabling kernel Rust support. I've suggested to Harish
that we add Elmedhi's SOB line to the patches where it make sense.
Harish will continue the work and hopefully we will be ready to merge
early in 6.0.
Thanks for the prompt reviews Bruce.
Harish,
For v3 or even v4, it would be good to benchmark:
$ bitbake linux-yocto
before and after your patch set.
You should share the approximate build times and the FS usage.
We'll try to figure out how to speed up this workflow by optionally enabling
users to provide the Rust binaries using rust-up or something like that.
I don't really know how to go about that but I'm sure we'll figure it
out with some help
from the YP community.
../Randy
>
> On Wed, Nov 5, 2025 at 8:10 AM <Harish.Sadineni@windriver.com> wrote:
>
> From: Harish Sadineni <Harish.Sadineni@windriver.com>
>
> Add `clang-native`, `rust-native' and `bindgen-cli-native` to
> `DEPENDS` 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
> <https://urldefense.com/v3/__http://linux-yocto.inc__;!!AjveYdw8EvQ!ZIZow7znH24hp-Bzsr1MbyP1rpVYh0VDQlXOEul6CEdsYkpvfWwn9RxbJGBwCQ_KRh-xMdj9ROY77mn_TMYmdbyxGUmCRg$>
> | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/meta/recipes-kernel/linux/linux-yocto.inc
> <https://urldefense.com/v3/__http://linux-yocto.inc__;!!AjveYdw8EvQ!ZIZow7znH24hp-Bzsr1MbyP1rpVYh0VDQlXOEul6CEdsYkpvfWwn9RxbJGBwCQ_KRh-xMdj9ROY77mn_TMYmdbyxGUmCRg$>
> b/meta/recipes-kernel/linux/linux-yocto.inc
> <https://urldefense.com/v3/__http://linux-yocto.inc__;!!AjveYdw8EvQ!ZIZow7znH24hp-Bzsr1MbyP1rpVYh0VDQlXOEul6CEdsYkpvfWwn9RxbJGBwCQ_KRh-xMdj9ROY77mn_TMYmdbyxGUmCRg$>
> index 4d0a726bb6..e2ffd96b59 100644
> --- a/meta/recipes-kernel/linux/linux-yocto.inc
> <https://urldefense.com/v3/__http://linux-yocto.inc__;!!AjveYdw8EvQ!ZIZow7znH24hp-Bzsr1MbyP1rpVYh0VDQlXOEul6CEdsYkpvfWwn9RxbJGBwCQ_KRh-xMdj9ROY77mn_TMYmdbyxGUmCRg$>
> +++ b/meta/recipes-kernel/linux/linux-yocto.inc
> <https://urldefense.com/v3/__http://linux-yocto.inc__;!!AjveYdw8EvQ!ZIZow7znH24hp-Bzsr1MbyP1rpVYh0VDQlXOEul6CEdsYkpvfWwn9RxbJGBwCQ_KRh-xMdj9ROY77mn_TMYmdbyxGUmCRg$>
> @@ -81,6 +81,7 @@ 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"
> +DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES',
> 'rust-kernel', 'clang-native rust-native bindgen-cli-native', '', d)}"
>
>
> I'd suggest that those dependencies should be in a variable, assigned
> with ?= and then use the
> variable in the DEPENDS line. That makes it easier to adjust from
> bbappends, etc.
>
> Bruce
>
>
>
> # 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
>
>
>
> --
> - Thou shalt not follow the NULL pointer, for chaos and madness await
> thee at its end
> - "Use the force Harry" - Gandalf, Star Trek II
>
--
# Randy MacLeod
# Wind River Linux
[-- Attachment #2: Type: text/html, Size: 7564 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH RFC v2 3/8] rust: install Rust library sources for 'make rustavailable' support
2025-11-05 13:09 [PATCH RFC v2 0/8] Enable rust support for linux kernel Harish.Sadineni
2025-11-05 13:09 ` [PATCH RFC v2 1/8] bindgen-cli: extend BBCLASSEXTEND to include nativesdk Harish.Sadineni
2025-11-05 13:09 ` [PATCH RFC v2 2/8] linux-yocto: add clang-native,rust-native and bindgen-cli-native to DEPENDS Harish.Sadineni
@ 2025-11-05 13:09 ` Harish.Sadineni
2025-11-06 20:49 ` [OE-core] " Yoann Congal
2025-11-05 13:09 ` [PATCH RFC v2 4/8] rust: stage rustlib sources for linux-yocto make rustavailable support Harish.Sadineni
` (5 subsequent siblings)
8 siblings, 1 reply; 21+ messages in thread
From: Harish.Sadineni @ 2025-11-05 13:09 UTC (permalink / raw)
To: openembedded-core
Cc: Randy.MacLeod, bruce.ashfield, sundeep.kokkonda, elmehdi.younes
From: Harish Sadineni <Harish.Sadineni@windriver.com>
The `make rustavailable` process 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:
- Copying the `library/` directory from the Rust source tree into `${TMPDIR}/work-shared/rust`
during the snapshot setup.
- Installing the `library/` directory into `${SDKPATHNATIVE}/usr/lib/rustlib/src/rust` for the
`nativesdk` class, making them available in the SDK.
Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
meta/recipes-devtools/rust/rust_1.90.0.bb | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/meta/recipes-devtools/rust/rust_1.90.0.bb b/meta/recipes-devtools/rust/rust_1.90.0.bb
index e7f3985332..857d679e2b 100644
--- a/meta/recipes-devtools/rust/rust_1.90.0.bb
+++ b/meta/recipes-devtools/rust/rust_1.90.0.bb
@@ -54,6 +54,11 @@ do_rust_setup_snapshot () {
# and fail without it there.
mkdir -p ${RUSTSRC}/build/${RUST_BUILD_SYS}
ln -sf ${WORKDIR}/rust-snapshot/ ${RUSTSRC}/build/${RUST_BUILD_SYS}/stage0
+
+ if [ ! -d "${TMPDIR}/work-shared/rust" ]; then
+ mkdir -p ${TMPDIR}/work-shared/rust
+ cp -r ${RUSTSRC}/library ${TMPDIR}/work-shared/rust/.
+ fi
# Need to use uninative's loader if enabled/present since the library paths
# are used internally by rust and result in symbol mismatches if we don't
@@ -318,6 +323,13 @@ rust_do_install:class-nativesdk() {
FILES:${PN} += "${base_prefix}/environment-setup.d"
+do_install:append:class-nativesdk () {
+ if [ ! -d ${D}${SDKPATHNATIVE}/usr/lib/rustlib/src/rust ]; then
+ mkdir -p ${D}${SDKPATHNATIVE}/usr/lib/rustlib/src/rust
+ cp -r --no-preserve=ownership ${RUSTSRC}/library ${D}${SDKPATHNATIVE}/usr/lib/rustlib/src/rust/
+ fi
+}
+
EXTRA_TOOLS ?= "cargo-clippy clippy-driver rustfmt"
rust_do_install:class-target() {
export PSEUDO_UNLOAD=1
--
2.49.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [OE-core] [PATCH RFC v2 3/8] rust: install Rust library sources for 'make rustavailable' support
2025-11-05 13:09 ` [PATCH RFC v2 3/8] rust: install Rust library sources for 'make rustavailable' support Harish.Sadineni
@ 2025-11-06 20:49 ` Yoann Congal
0 siblings, 0 replies; 21+ messages in thread
From: Yoann Congal @ 2025-11-06 20:49 UTC (permalink / raw)
To: Harish.Sadineni, openembedded-core
Cc: Randy.MacLeod, bruce.ashfield, sundeep.kokkonda, elmehdi.younes
Le 05/11/2025 à 14:09, Sadineni, Harish via lists.openembedded.org a écrit :
> From: Harish Sadineni <Harish.Sadineni@windriver.com>
>
> The `make rustavailable` process 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:
> - Copying the `library/` directory from the Rust source tree into `${TMPDIR}/work-shared/rust`
> during the snapshot setup.
> - Installing the `library/` directory into `${SDKPATHNATIVE}/usr/lib/rustlib/src/rust` for the
> `nativesdk` class, making them available in the SDK.
>
> Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
> ---
> meta/recipes-devtools/rust/rust_1.90.0.bb | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/meta/recipes-devtools/rust/rust_1.90.0.bb b/meta/recipes-devtools/rust/rust_1.90.0.bb
> index e7f3985332..857d679e2b 100644
> --- a/meta/recipes-devtools/rust/rust_1.90.0.bb
> +++ b/meta/recipes-devtools/rust/rust_1.90.0.bb
> @@ -54,6 +54,11 @@ do_rust_setup_snapshot () {
> # and fail without it there.
> mkdir -p ${RUSTSRC}/build/${RUST_BUILD_SYS}
> ln -sf ${WORKDIR}/rust-snapshot/ ${RUSTSRC}/build/${RUST_BUILD_SYS}/stage0
> +
> + if [ ! -d "${TMPDIR}/work-shared/rust" ]; then
> + mkdir -p ${TMPDIR}/work-shared/rust
> + cp -r ${RUSTSRC}/library ${TMPDIR}/work-shared/rust/.
> + fi
>
> # Need to use uninative's loader if enabled/present since the library paths
> # are used internally by rust and result in symbol mismatches if we don't
> @@ -318,6 +323,13 @@ rust_do_install:class-nativesdk() {
>
> FILES:${PN} += "${base_prefix}/environment-setup.d"
>
> +do_install:append:class-nativesdk () {
> + if [ ! -d ${D}${SDKPATHNATIVE}/usr/lib/rustlib/src/rust ]; then
> + mkdir -p ${D}${SDKPATHNATIVE}/usr/lib/rustlib/src/rust
> + cp -r --no-preserve=ownership ${RUSTSRC}/library ${D}${SDKPATHNATIVE}/usr/lib/rustlib/src/rust/
> + fi
Why not just adding this code to the "rust_do_install:class-nativesdk()"
function defined just above?
> +}
> +
> EXTRA_TOOLS ?= "cargo-clippy clippy-driver rustfmt"
> rust_do_install:class-target() {
> export PSEUDO_UNLOAD=1
>
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#225761): https://lists.openembedded.org/g/openembedded-core/message/225761
> Mute This Topic: https://lists.openembedded.org/mt/116133830/4316185
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [yoann.congal@smile.fr]
> -=-=-=-=-=-=-=-=-=-=-=-
>
--
Yoann Congal
Smile ECS
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH RFC v2 4/8] rust: stage rustlib sources for linux-yocto make rustavailable support
2025-11-05 13:09 [PATCH RFC v2 0/8] Enable rust support for linux kernel Harish.Sadineni
` (2 preceding siblings ...)
2025-11-05 13:09 ` [PATCH RFC v2 3/8] rust: install Rust library sources for 'make rustavailable' support Harish.Sadineni
@ 2025-11-05 13:09 ` Harish.Sadineni
2025-11-05 13:32 ` Bruce Ashfield
2025-11-05 13:09 ` [PATCH RFC v2 5/8] kernel-yocto: add rust support via make rustavailable in do_kernel_configme Harish.Sadineni
` (4 subsequent siblings)
8 siblings, 1 reply; 21+ messages in thread
From: Harish.Sadineni @ 2025-11-05 13:09 UTC (permalink / raw)
To: openembedded-core
Cc: Randy.MacLeod, bruce.ashfield, sundeep.kokkonda, elmehdi.younes
From: Harish Sadineni <Harish.Sadineni@windriver.com>
When building the Linux kernel with Rust support enabled (e.g., via `make rustavailable`),
the build system expects the Rust standard library sources to be available under:
${STAGING_DIR_NATIVE}/usr/lib/rustlib/src/rust
Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
meta/recipes-kernel/linux/linux-yocto.inc | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/meta/recipes-kernel/linux/linux-yocto.inc b/meta/recipes-kernel/linux/linux-yocto.inc
index e2ffd96b59..05219d166e 100644
--- a/meta/recipes-kernel/linux/linux-yocto.inc
+++ b/meta/recipes-kernel/linux/linux-yocto.inc
@@ -71,6 +71,14 @@ do_install:append(){
rm -rf ${STAGING_KERNEL_DIR}/${KMETA}
fi
}
+do_patch:append(){
+ if ${@bb.utils.contains('DISTRO_FEATURES','rust-kernel','true','false',d)}; then
+ if [ ! -d ${STAGING_DIR_NATIVE}/usr/lib/rustlib/src/rust ]; then
+ mkdir -p ${STAGING_DIR_NATIVE}/usr/lib/rustlib/src/rust/
+ cp -r ${TMPDIR}/work-shared/rust ${STAGING_DIR_NATIVE}/usr/lib/rustlib/src/.
+ fi
+ fi
+}
# enable kernel-sample for oeqa/runtime/cases's ksample.py test
KERNEL_FEATURES:append:qemuall = " features/kernel-sample/kernel-sample.scc"
--
2.49.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH RFC v2 4/8] rust: stage rustlib sources for linux-yocto make rustavailable support
2025-11-05 13:09 ` [PATCH RFC v2 4/8] rust: stage rustlib sources for linux-yocto make rustavailable support Harish.Sadineni
@ 2025-11-05 13:32 ` Bruce Ashfield
2025-11-05 17:03 ` Randy MacLeod
0 siblings, 1 reply; 21+ messages in thread
From: Bruce Ashfield @ 2025-11-05 13:32 UTC (permalink / raw)
To: Harish.Sadineni
Cc: openembedded-core, Randy.MacLeod, sundeep.kokkonda,
elmehdi.younes
[-- Attachment #1: Type: text/plain, Size: 1866 bytes --]
On Wed, Nov 5, 2025 at 8:10 AM <Harish.Sadineni@windriver.com> wrote:
> From: Harish Sadineni <Harish.Sadineni@windriver.com>
>
> When building the Linux kernel with Rust support enabled (e.g., via `make
> rustavailable`),
> the build system expects the Rust standard library sources to be
> available under:
>
>
If that call is happening at configure time (in configme), then it would
better to have
this preparation step in the same location versus separate before do_patch.
Bruce
> ${STAGING_DIR_NATIVE}/usr/lib/rustlib/src/rust
>
> Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
> ---
> meta/recipes-kernel/linux/linux-yocto.inc | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/meta/recipes-kernel/linux/linux-yocto.inc
> b/meta/recipes-kernel/linux/linux-yocto.inc
> index e2ffd96b59..05219d166e 100644
> --- a/meta/recipes-kernel/linux/linux-yocto.inc
> +++ b/meta/recipes-kernel/linux/linux-yocto.inc
> @@ -71,6 +71,14 @@ do_install:append(){
> rm -rf ${STAGING_KERNEL_DIR}/${KMETA}
> fi
> }
> +do_patch:append(){
> + if
> ${@bb.utils.contains('DISTRO_FEATURES','rust-kernel','true','false',d)};
> then
> + if [ ! -d ${STAGING_DIR_NATIVE}/usr/lib/rustlib/src/rust
> ]; then
> + mkdir -p
> ${STAGING_DIR_NATIVE}/usr/lib/rustlib/src/rust/
> + cp -r ${TMPDIR}/work-shared/rust
> ${STAGING_DIR_NATIVE}/usr/lib/rustlib/src/.
> + fi
> + fi
> +}
>
> # enable kernel-sample for oeqa/runtime/cases's ksample.py test
> KERNEL_FEATURES:append:qemuall = "
> features/kernel-sample/kernel-sample.scc"
> --
> 2.49.0
>
>
--
- 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: 3102 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: [PATCH RFC v2 4/8] rust: stage rustlib sources for linux-yocto make rustavailable support
2025-11-05 13:32 ` Bruce Ashfield
@ 2025-11-05 17:03 ` Randy MacLeod
0 siblings, 0 replies; 21+ messages in thread
From: Randy MacLeod @ 2025-11-05 17:03 UTC (permalink / raw)
To: Harish.Sadineni
Cc: openembedded-core, sundeep.kokkonda, elmehdi.younes,
Bruce Ashfield
[-- Attachment #1: Type: text/plain, Size: 4128 bytes --]
On 2025-11-05 8:32 a.m., Bruce Ashfield wrote:
>
>
> On Wed, Nov 5, 2025 at 8:10 AM <Harish.Sadineni@windriver.com> wrote:
>
> From: Harish Sadineni <Harish.Sadineni@windriver.com>
>
> When building the Linux kernel with Rust support enabled (e.g.,
> via `make rustavailable`),
> the build system expects the Rust standard library sources to be
> available under:
>
>
> If that call is happening at configure time (in configme), then it
> would better to have
> this preparation step in the same location versus separate before
> do_patch.
>
> Bruce
>
> ${STAGING_DIR_NATIVE}/usr/lib/rustlib/src/rust
>
Don't use /usr/lib directly, pick one of:
❯ rg STAGING_.*NATIVE.*= meta/conf/bitbake.conf
422:STAGING_DIR_NATIVE = "${RECIPE_SYSROOT_NATIVE}"
423:STAGING_BINDIR_NATIVE = "${STAGING_DIR_NATIVE}${bindir_native}"
426:STAGING_LIBDIR_NATIVE = "${STAGING_DIR_NATIVE}${libdir_native}"
427:STAGING_LIBEXECDIR_NATIVE = "${STAGING_DIR_NATIVE}${libexecdir_native}"
428:STAGING_BASE_LIBDIR_NATIVE =
"${STAGING_DIR_NATIVE}${base_libdir_native}"
429:STAGING_SBINDIR_NATIVE = "${STAGING_DIR_NATIVE}${sbindir_native}"
430:STAGING_INCDIR_NATIVE = "${STAGING_DIR_NATIVE}${includedir_native}"
431:STAGING_ETCDIR_NATIVE = "${STAGING_DIR_NATIVE}${sysconfdir_native}"
432:STAGING_DATADIR_NATIVE = "${STAGING_DIR_NATIVE}${datadir_native}"
657: -ffile-prefix-map=${STAGING_DIR_NATIVE}= \
Same comment anywhere that you have ${VAR}/usr/foo/bar/baz hardcoded.
../Randy
>
> Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
> ---
> meta/recipes-kernel/linux/linux-yocto.inc
> <https://urldefense.com/v3/__http://linux-yocto.inc__;!!AjveYdw8EvQ!aQ1fra7eKRFm-_YXYz7UyG_3CWtTHXzhxMr5phBTi_YQ46IB27rIgqcyW8RJk9RxCbHBesM2rarbvOLRkywoZ9mfu8xuBA$>
> | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/meta/recipes-kernel/linux/linux-yocto.inc
> <https://urldefense.com/v3/__http://linux-yocto.inc__;!!AjveYdw8EvQ!aQ1fra7eKRFm-_YXYz7UyG_3CWtTHXzhxMr5phBTi_YQ46IB27rIgqcyW8RJk9RxCbHBesM2rarbvOLRkywoZ9mfu8xuBA$>
> b/meta/recipes-kernel/linux/linux-yocto.inc
> <https://urldefense.com/v3/__http://linux-yocto.inc__;!!AjveYdw8EvQ!aQ1fra7eKRFm-_YXYz7UyG_3CWtTHXzhxMr5phBTi_YQ46IB27rIgqcyW8RJk9RxCbHBesM2rarbvOLRkywoZ9mfu8xuBA$>
> index e2ffd96b59..05219d166e 100644
> --- a/meta/recipes-kernel/linux/linux-yocto.inc
> <https://urldefense.com/v3/__http://linux-yocto.inc__;!!AjveYdw8EvQ!aQ1fra7eKRFm-_YXYz7UyG_3CWtTHXzhxMr5phBTi_YQ46IB27rIgqcyW8RJk9RxCbHBesM2rarbvOLRkywoZ9mfu8xuBA$>
> +++ b/meta/recipes-kernel/linux/linux-yocto.inc
> <https://urldefense.com/v3/__http://linux-yocto.inc__;!!AjveYdw8EvQ!aQ1fra7eKRFm-_YXYz7UyG_3CWtTHXzhxMr5phBTi_YQ46IB27rIgqcyW8RJk9RxCbHBesM2rarbvOLRkywoZ9mfu8xuBA$>
> @@ -71,6 +71,14 @@ do_install:append(){
> rm -rf ${STAGING_KERNEL_DIR}/${KMETA}
> fi
> }
> +do_patch:append(){
> + if
> ${@bb.utils.contains('DISTRO_FEATURES','rust-kernel','true','false',d)};
> then
> + if [ ! -d
> ${STAGING_DIR_NATIVE}/usr/lib/rustlib/src/rust ]; then
> + mkdir -p
> ${STAGING_DIR_NATIVE}/usr/lib/rustlib/src/rust/
> + cp -r ${TMPDIR}/work-shared/rust
> ${STAGING_DIR_NATIVE}/usr/lib/rustlib/src/.
> + fi
> + fi
> +}
>
> # enable kernel-sample for oeqa/runtime/cases's ksample.py
> <https://urldefense.com/v3/__http://ksample.py__;!!AjveYdw8EvQ!aQ1fra7eKRFm-_YXYz7UyG_3CWtTHXzhxMr5phBTi_YQ46IB27rIgqcyW8RJk9RxCbHBesM2rarbvOLRkywoZ9m53T-LsA$>
> test
> KERNEL_FEATURES:append:qemuall = "
> features/kernel-sample/kernel-sample.scc"
> --
> 2.49.0
>
>
>
> --
> - Thou shalt not follow the NULL pointer, for chaos and madness await
> thee at its end
> - "Use the force Harry" - Gandalf, Star Trek II
>
--
# Randy MacLeod
# Wind River Linux
[-- Attachment #2: Type: text/html, Size: 7779 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH RFC v2 5/8] kernel-yocto: add rust support via make rustavailable in do_kernel_configme
2025-11-05 13:09 [PATCH RFC v2 0/8] Enable rust support for linux kernel Harish.Sadineni
` (3 preceding siblings ...)
2025-11-05 13:09 ` [PATCH RFC v2 4/8] rust: stage rustlib sources for linux-yocto make rustavailable support Harish.Sadineni
@ 2025-11-05 13:09 ` Harish.Sadineni
2025-11-05 13:34 ` Bruce Ashfield
2025-11-06 20:52 ` [OE-core] " Yoann Congal
2025-11-05 13:09 ` [PATCH RFC v2 6/8] linux-yocto: enable Rust support in kernel configuration Harish.Sadineni
` (3 subsequent siblings)
8 siblings, 2 replies; 21+ messages in thread
From: Harish.Sadineni @ 2025-11-05 13:09 UTC (permalink / raw)
To: openembedded-core
Cc: Randy.MacLeod, bruce.ashfield, sundeep.kokkonda, elmehdi.younes
From: Harish Sadineni <Harish.Sadineni@windriver.com>
To enable Rust integration in the Linux kernel build, this patch:
- Adds `rust-native`, `clang-native` and `bindgen-cli-native` to `do_kernel_configme[depends]`
to ensure required tools are available for Rust support.
- Invokes `make rustavailable` inside `do_kernel_configme()` to prepare
the kernel for building Rust-based modules or core components.
The `make rustavailable` target requires the Rust standard library sources to be
present under `${STAGING_DIR_NATIVE}/usr/lib/rustlib/src/rust`, which is handled
in the `rust` recipe via shared staging.
Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
meta/classes-recipe/kernel-yocto.bbclass | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/meta/classes-recipe/kernel-yocto.bbclass b/meta/classes-recipe/kernel-yocto.bbclass
index e53bf15194..7a115bdffd 100644
--- a/meta/classes-recipe/kernel-yocto.bbclass
+++ b/meta/classes-recipe/kernel-yocto.bbclass
@@ -463,6 +463,10 @@ 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"
+do_kernel_configme[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[dirs] += "${S} ${B}"
do_kernel_configme() {
do_kernel_metadata config
@@ -507,6 +511,11 @@ do_kernel_configme() {
echo "CONFIG_LOCALVERSION="\"${LINUX_VERSION_EXTENSION}\" >> ${B}/.config
fi
}
+do_kernel_configme:append() {
+ 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
addtask config_analysis
--
2.49.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH RFC v2 5/8] kernel-yocto: add rust support via make rustavailable in do_kernel_configme
2025-11-05 13:09 ` [PATCH RFC v2 5/8] kernel-yocto: add rust support via make rustavailable in do_kernel_configme Harish.Sadineni
@ 2025-11-05 13:34 ` Bruce Ashfield
2025-11-06 20:52 ` [OE-core] " Yoann Congal
1 sibling, 0 replies; 21+ messages in thread
From: Bruce Ashfield @ 2025-11-05 13:34 UTC (permalink / raw)
To: Harish.Sadineni
Cc: openembedded-core, Randy.MacLeod, sundeep.kokkonda,
elmehdi.younes
[-- Attachment #1: Type: text/plain, Size: 2781 bytes --]
On Wed, Nov 5, 2025 at 8:10 AM <Harish.Sadineni@windriver.com> wrote:
> From: Harish Sadineni <Harish.Sadineni@windriver.com>
>
> To enable Rust integration in the Linux kernel build, this patch:
>
> - Adds `rust-native`, `clang-native` and `bindgen-cli-native` to
> `do_kernel_configme[depends]`
> to ensure required tools are available for Rust support.
> - Invokes `make rustavailable` inside `do_kernel_configme()` to prepare
> the kernel for building Rust-based modules or core components.
>
> The `make rustavailable` target requires the Rust standard library sources
> to be
> present under `${STAGING_DIR_NATIVE}/usr/lib/rustlib/src/rust`, which is
> handled
> in the `rust` recipe via shared staging.
>
> Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
> ---
> meta/classes-recipe/kernel-yocto.bbclass | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/meta/classes-recipe/kernel-yocto.bbclass
> b/meta/classes-recipe/kernel-yocto.bbclass
> index e53bf15194..7a115bdffd 100644
> --- a/meta/classes-recipe/kernel-yocto.bbclass
> +++ b/meta/classes-recipe/kernel-yocto.bbclass
> @@ -463,6 +463,10 @@ 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"
> +do_kernel_configme[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)}"
>
for consistency (with the other rust changes), these could be assigned to a
variable first (?=) and then assigned. That allows them to be tweaked more
easily while the support is being developed.
Bruce
> do_kernel_configme[dirs] += "${S} ${B}"
> do_kernel_configme() {
> do_kernel_metadata config
> @@ -507,6 +511,11 @@ do_kernel_configme() {
> echo "CONFIG_LOCALVERSION="\"${LINUX_VERSION_EXTENSION}\"
> >> ${B}/.config
> fi
> }
> +do_kernel_configme:append() {
> + 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
> addtask config_analysis
> --
> 2.49.0
>
>
--
- 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: 4264 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: [OE-core] [PATCH RFC v2 5/8] kernel-yocto: add rust support via make rustavailable in do_kernel_configme
2025-11-05 13:09 ` [PATCH RFC v2 5/8] kernel-yocto: add rust support via make rustavailable in do_kernel_configme Harish.Sadineni
2025-11-05 13:34 ` Bruce Ashfield
@ 2025-11-06 20:52 ` Yoann Congal
1 sibling, 0 replies; 21+ messages in thread
From: Yoann Congal @ 2025-11-06 20:52 UTC (permalink / raw)
To: Harish.Sadineni, openembedded-core
Cc: Randy.MacLeod, bruce.ashfield, sundeep.kokkonda, elmehdi.younes
Le 05/11/2025 à 14:09, Sadineni, Harish via lists.openembedded.org a écrit :
> From: Harish Sadineni <Harish.Sadineni@windriver.com>
>
> To enable Rust integration in the Linux kernel build, this patch:
>
> - Adds `rust-native`, `clang-native` and `bindgen-cli-native` to `do_kernel_configme[depends]`
> to ensure required tools are available for Rust support.
> - Invokes `make rustavailable` inside `do_kernel_configme()` to prepare
> the kernel for building Rust-based modules or core components.
>
> The `make rustavailable` target requires the Rust standard library sources to be
> present under `${STAGING_DIR_NATIVE}/usr/lib/rustlib/src/rust`, which is handled
> in the `rust` recipe via shared staging.
>
> Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
> ---
> meta/classes-recipe/kernel-yocto.bbclass | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/meta/classes-recipe/kernel-yocto.bbclass b/meta/classes-recipe/kernel-yocto.bbclass
> index e53bf15194..7a115bdffd 100644
> --- a/meta/classes-recipe/kernel-yocto.bbclass
> +++ b/meta/classes-recipe/kernel-yocto.bbclass
> @@ -463,6 +463,10 @@ 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"
> +do_kernel_configme[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[dirs] += "${S} ${B}"
> do_kernel_configme() {
> do_kernel_metadata config
> @@ -507,6 +511,11 @@ do_kernel_configme() {
> echo "CONFIG_LOCALVERSION="\"${LINUX_VERSION_EXTENSION}\" >> ${B}/.config
> fi
> }
> +do_kernel_configme:append() {
> + if ${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', 'true', 'false', d)}; then
> + oe_runmake -C ${S} O=${B} rustavailable
> + fi
(same question as in a previous patch) Why not adding this code to
do_kernel_configme() defined just above?
> +}
>
> addtask kernel_configme before do_configure after do_patch
> addtask config_analysis
>
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#225762): https://lists.openembedded.org/g/openembedded-core/message/225762
> Mute This Topic: https://lists.openembedded.org/mt/116133831/4316185
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [yoann.congal@smile.fr]
> -=-=-=-=-=-=-=-=-=-=-=-
>
--
Yoann Congal
Smile ECS
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH RFC v2 6/8] linux-yocto: enable Rust support in kernel configuration
2025-11-05 13:09 [PATCH RFC v2 0/8] Enable rust support for linux kernel Harish.Sadineni
` (4 preceding siblings ...)
2025-11-05 13:09 ` [PATCH RFC v2 5/8] kernel-yocto: add rust support via make rustavailable in do_kernel_configme Harish.Sadineni
@ 2025-11-05 13:09 ` Harish.Sadineni
2025-11-05 13:34 ` Bruce Ashfield
2025-11-05 20:39 ` [OE-core] " Gyorgy Sarvari
2025-11-05 13:09 ` [PATCH RFC v2 7/8] kernel-yocto: Fix for buildpaths errors when rust is enabled for kernel Harish.Sadineni
` (2 subsequent siblings)
8 siblings, 2 replies; 21+ messages in thread
From: Harish.Sadineni @ 2025-11-05 13:09 UTC (permalink / raw)
To: openembedded-core
Cc: Randy.MacLeod, bruce.ashfield, sundeep.kokkonda, elmehdi.younes
From: Harish Sadineni <Harish.Sadineni@windriver.com>
Add initial support for building the Linux kernel with Rust enabled:
- Introduce `rust.cfg` to set Rust-related kernel config options, including:
- `CONFIG_RUST`, `CONFIG_HAVE_RUST`, and `CONFIG_RUST_IS_AVAILABLE`
- Rust sample modules and developer checks (overflow/debug assertions)
- Disable BTF and module versioning for compatibility
- Add `rust.scc` to include `rust.cfg` via `kconf` in the kernel feature stack
- Update `linux-yocto_${PV}.bb` to:
- Append `rust.scc` to `SRC_URI` and `KERNEL_FEATURES`
when sending non-RFC version, we will send kernel-config-fragment to the yocto-kenrel-cache
Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
meta/recipes-kernel/linux/files/rust.cfg | 9 +++++++++
meta/recipes-kernel/linux/files/rust.scc | 1 +
meta/recipes-kernel/linux/linux-yocto_6.16.bb | 3 +++
3 files changed, 13 insertions(+)
create mode 100644 meta/recipes-kernel/linux/files/rust.cfg
create mode 100644 meta/recipes-kernel/linux/files/rust.scc
diff --git a/meta/recipes-kernel/linux/files/rust.cfg b/meta/recipes-kernel/linux/files/rust.cfg
new file mode 100644
index 0000000000..a884f3cf6b
--- /dev/null
+++ b/meta/recipes-kernel/linux/files/rust.cfg
@@ -0,0 +1,9 @@
+CONFIG_RUST=y
+CONFIG_SAMPLES_RUST=y
+CONFIG_SAMPLE_RUST_MINIMAL=m
+CONFIG_SAMPLE_RUST_PRINT=y
+CONFIG_SAMPLE_RUST_HOSTPROGS=y
+CONFIG_RUST_DEBUG_ASSERTIONS=y
+CONFIG_RUST_OVERFLOW_CHECKS=y
+CONFIG_RUST_BUILD_ASSERT_ALLOW=y
+
diff --git a/meta/recipes-kernel/linux/files/rust.scc b/meta/recipes-kernel/linux/files/rust.scc
new file mode 100644
index 0000000000..4686d9ce5e
--- /dev/null
+++ b/meta/recipes-kernel/linux/files/rust.scc
@@ -0,0 +1 @@
+kconf hardware rust.cfg
diff --git a/meta/recipes-kernel/linux/linux-yocto_6.16.bb b/meta/recipes-kernel/linux/linux-yocto_6.16.bb
index 2188c7fed2..33bd8a92c3 100644
--- a/meta/recipes-kernel/linux/linux-yocto_6.16.bb
+++ b/meta/recipes-kernel/linux/linux-yocto_6.16.bb
@@ -77,3 +77,6 @@ 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"
+SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', ' file://rust.scc', '', d)}"
+KERNEL_FEATURES:append = " ${@bb.utils.contains("DISTRO_FEATURES", "RUST", "rust.scc", "", d)}"
+
--
2.49.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH RFC v2 6/8] linux-yocto: enable Rust support in kernel configuration
2025-11-05 13:09 ` [PATCH RFC v2 6/8] linux-yocto: enable Rust support in kernel configuration Harish.Sadineni
@ 2025-11-05 13:34 ` Bruce Ashfield
2025-11-05 20:39 ` [OE-core] " Gyorgy Sarvari
1 sibling, 0 replies; 21+ messages in thread
From: Bruce Ashfield @ 2025-11-05 13:34 UTC (permalink / raw)
To: Harish.Sadineni
Cc: openembedded-core, Randy.MacLeod, sundeep.kokkonda,
elmehdi.younes
[-- Attachment #1: Type: text/plain, Size: 2985 bytes --]
On Wed, Nov 5, 2025 at 8:10 AM <Harish.Sadineni@windriver.com> wrote:
> From: Harish Sadineni <Harish.Sadineni@windriver.com>
>
> Add initial support for building the Linux kernel with Rust enabled:
>
> - Introduce `rust.cfg` to set Rust-related kernel config options,
> including:
> - `CONFIG_RUST`, `CONFIG_HAVE_RUST`, and `CONFIG_RUST_IS_AVAILABLE`
> - Rust sample modules and developer checks (overflow/debug assertions)
> - Disable BTF and module versioning for compatibility
>
> - Add `rust.scc` to include `rust.cfg` via `kconf` in the kernel feature
> stack
>
> - Update `linux-yocto_${PV}.bb` to:
> - Append `rust.scc` to `SRC_URI` and `KERNEL_FEATURES`
>
> when sending non-RFC version, we will send kernel-config-fragment to the
> yocto-kenrel-cache
>
> Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
> ---
> meta/recipes-kernel/linux/files/rust.cfg | 9 +++++++++
> meta/recipes-kernel/linux/files/rust.scc | 1 +
> meta/recipes-kernel/linux/linux-yocto_6.16.bb | 3 +++
> 3 files changed, 13 insertions(+)
> create mode 100644 meta/recipes-kernel/linux/files/rust.cfg
> create mode 100644 meta/recipes-kernel/linux/files/rust.scc
>
> diff --git a/meta/recipes-kernel/linux/files/rust.cfg
> b/meta/recipes-kernel/linux/files/rust.cfg
> new file mode 100644
> index 0000000000..a884f3cf6b
> --- /dev/null
> +++ b/meta/recipes-kernel/linux/files/rust.cfg
> @@ -0,0 +1,9 @@
> +CONFIG_RUST=y
> +CONFIG_SAMPLES_RUST=y
> +CONFIG_SAMPLE_RUST_MINIMAL=m
> +CONFIG_SAMPLE_RUST_PRINT=y
> +CONFIG_SAMPLE_RUST_HOSTPROGS=y
> +CONFIG_RUST_DEBUG_ASSERTIONS=y
> +CONFIG_RUST_OVERFLOW_CHECKS=y
> +CONFIG_RUST_BUILD_ASSERT_ALLOW=y
>
The debug, samples and core support should be in separate fragments.
Bruce
> +
> diff --git a/meta/recipes-kernel/linux/files/rust.scc
> b/meta/recipes-kernel/linux/files/rust.scc
> new file mode 100644
> index 0000000000..4686d9ce5e
> --- /dev/null
> +++ b/meta/recipes-kernel/linux/files/rust.scc
> @@ -0,0 +1 @@
> +kconf hardware rust.cfg
> diff --git a/meta/recipes-kernel/linux/linux-yocto_6.16.bb
> b/meta/recipes-kernel/linux/linux-yocto_6.16.bb
> index 2188c7fed2..33bd8a92c3 100644
> --- a/meta/recipes-kernel/linux/linux-yocto_6.16.bb
> +++ b/meta/recipes-kernel/linux/linux-yocto_6.16.bb
> @@ -77,3 +77,6 @@ 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"
> +SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', '
> file://rust.scc', '', d)}"
> +KERNEL_FEATURES:append = " ${@bb.utils.contains("DISTRO_FEATURES",
> "RUST", "rust.scc", "", d)}"
> +
> --
> 2.49.0
>
>
--
- 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: 4619 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: [OE-core] [PATCH RFC v2 6/8] linux-yocto: enable Rust support in kernel configuration
2025-11-05 13:09 ` [PATCH RFC v2 6/8] linux-yocto: enable Rust support in kernel configuration Harish.Sadineni
2025-11-05 13:34 ` Bruce Ashfield
@ 2025-11-05 20:39 ` Gyorgy Sarvari
2025-11-06 7:11 ` Harish Sadineni
1 sibling, 1 reply; 21+ messages in thread
From: Gyorgy Sarvari @ 2025-11-05 20:39 UTC (permalink / raw)
To: Harish.Sadineni, openembedded-core
Cc: Randy.MacLeod, bruce.ashfield, sundeep.kokkonda, elmehdi.younes
On 11/5/25 14:09, Sadineni, Harish via lists.openembedded.org wrote:
> From: Harish Sadineni <Harish.Sadineni@windriver.com>
>
> Add initial support for building the Linux kernel with Rust enabled:
>
> - Introduce `rust.cfg` to set Rust-related kernel config options, including:
> - `CONFIG_RUST`, `CONFIG_HAVE_RUST`, and `CONFIG_RUST_IS_AVAILABLE`
> - Rust sample modules and developer checks (overflow/debug assertions)
> - Disable BTF and module versioning for compatibility
>
> - Add `rust.scc` to include `rust.cfg` via `kconf` in the kernel feature stack
>
> - Update `linux-yocto_${PV}.bb` to:
> - Append `rust.scc` to `SRC_URI` and `KERNEL_FEATURES`
>
> when sending non-RFC version, we will send kernel-config-fragment to the yocto-kenrel-cache
>
> Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
> ---
> meta/recipes-kernel/linux/files/rust.cfg | 9 +++++++++
> meta/recipes-kernel/linux/files/rust.scc | 1 +
> meta/recipes-kernel/linux/linux-yocto_6.16.bb | 3 +++
> 3 files changed, 13 insertions(+)
> create mode 100644 meta/recipes-kernel/linux/files/rust.cfg
> create mode 100644 meta/recipes-kernel/linux/files/rust.scc
>
> diff --git a/meta/recipes-kernel/linux/files/rust.cfg b/meta/recipes-kernel/linux/files/rust.cfg
> new file mode 100644
> index 0000000000..a884f3cf6b
> --- /dev/null
> +++ b/meta/recipes-kernel/linux/files/rust.cfg
> @@ -0,0 +1,9 @@
> +CONFIG_RUST=y
> +CONFIG_SAMPLES_RUST=y
> +CONFIG_SAMPLE_RUST_MINIMAL=m
> +CONFIG_SAMPLE_RUST_PRINT=y
> +CONFIG_SAMPLE_RUST_HOSTPROGS=y
> +CONFIG_RUST_DEBUG_ASSERTIONS=y
> +CONFIG_RUST_OVERFLOW_CHECKS=y
> +CONFIG_RUST_BUILD_ASSERT_ALLOW=y
> +
> diff --git a/meta/recipes-kernel/linux/files/rust.scc b/meta/recipes-kernel/linux/files/rust.scc
> new file mode 100644
> index 0000000000..4686d9ce5e
> --- /dev/null
> +++ b/meta/recipes-kernel/linux/files/rust.scc
> @@ -0,0 +1 @@
> +kconf hardware rust.cfg
> diff --git a/meta/recipes-kernel/linux/linux-yocto_6.16.bb b/meta/recipes-kernel/linux/linux-yocto_6.16.bb
> index 2188c7fed2..33bd8a92c3 100644
> --- a/meta/recipes-kernel/linux/linux-yocto_6.16.bb
> +++ b/meta/recipes-kernel/linux/linux-yocto_6.16.bb
> @@ -77,3 +77,6 @@ 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"
> +SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', ' file://rust.scc', '', d)}"
> +KERNEL_FEATURES:append = " ${@bb.utils.contains("DISTRO_FEATURES", "RUST", "rust.scc", "", d)}"
Shouldn't this check also for 'rust-kernel' instead of 'RUST'?
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: [OE-core] [PATCH RFC v2 6/8] linux-yocto: enable Rust support in kernel configuration
2025-11-05 20:39 ` [OE-core] " Gyorgy Sarvari
@ 2025-11-06 7:11 ` Harish Sadineni
0 siblings, 0 replies; 21+ messages in thread
From: Harish Sadineni @ 2025-11-06 7:11 UTC (permalink / raw)
To: Gyorgy Sarvari, openembedded-core
Cc: Randy.MacLeod, bruce.ashfield, sundeep.kokkonda, elmehdi.younes
On 11/6/2025 2:09 AM, Gyorgy Sarvari 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 11/5/25 14:09, Sadineni, Harish via lists.openembedded.org wrote:
>> From: Harish Sadineni <Harish.Sadineni@windriver.com>
>>
>> Add initial support for building the Linux kernel with Rust enabled:
>>
>> - Introduce `rust.cfg` to set Rust-related kernel config options, including:
>> - `CONFIG_RUST`, `CONFIG_HAVE_RUST`, and `CONFIG_RUST_IS_AVAILABLE`
>> - Rust sample modules and developer checks (overflow/debug assertions)
>> - Disable BTF and module versioning for compatibility
>>
>> - Add `rust.scc` to include `rust.cfg` via `kconf` in the kernel feature stack
>>
>> - Update `linux-yocto_${PV}.bb` to:
>> - Append `rust.scc` to `SRC_URI` and `KERNEL_FEATURES`
>>
>> when sending non-RFC version, we will send kernel-config-fragment to the yocto-kenrel-cache
>>
>> Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
>> ---
>> meta/recipes-kernel/linux/files/rust.cfg | 9 +++++++++
>> meta/recipes-kernel/linux/files/rust.scc | 1 +
>> meta/recipes-kernel/linux/linux-yocto_6.16.bb | 3 +++
>> 3 files changed, 13 insertions(+)
>> create mode 100644 meta/recipes-kernel/linux/files/rust.cfg
>> create mode 100644 meta/recipes-kernel/linux/files/rust.scc
>>
>> diff --git a/meta/recipes-kernel/linux/files/rust.cfg b/meta/recipes-kernel/linux/files/rust.cfg
>> new file mode 100644
>> index 0000000000..a884f3cf6b
>> --- /dev/null
>> +++ b/meta/recipes-kernel/linux/files/rust.cfg
>> @@ -0,0 +1,9 @@
>> +CONFIG_RUST=y
>> +CONFIG_SAMPLES_RUST=y
>> +CONFIG_SAMPLE_RUST_MINIMAL=m
>> +CONFIG_SAMPLE_RUST_PRINT=y
>> +CONFIG_SAMPLE_RUST_HOSTPROGS=y
>> +CONFIG_RUST_DEBUG_ASSERTIONS=y
>> +CONFIG_RUST_OVERFLOW_CHECKS=y
>> +CONFIG_RUST_BUILD_ASSERT_ALLOW=y
>> +
>> diff --git a/meta/recipes-kernel/linux/files/rust.scc b/meta/recipes-kernel/linux/files/rust.scc
>> new file mode 100644
>> index 0000000000..4686d9ce5e
>> --- /dev/null
>> +++ b/meta/recipes-kernel/linux/files/rust.scc
>> @@ -0,0 +1 @@
>> +kconf hardware rust.cfg
>> diff --git a/meta/recipes-kernel/linux/linux-yocto_6.16.bb b/meta/recipes-kernel/linux/linux-yocto_6.16.bb
>> index 2188c7fed2..33bd8a92c3 100644
>> --- a/meta/recipes-kernel/linux/linux-yocto_6.16.bb
>> +++ b/meta/recipes-kernel/linux/linux-yocto_6.16.bb
>> @@ -77,3 +77,6 @@ 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"
>> +SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', ' file://rust.scc', '', d)}"
>> +KERNEL_FEATURES:append = " ${@bb.utils.contains("DISTRO_FEATURES", "RUST", "rust.scc", "", d)}"
> Shouldn't this check also for 'rust-kernel' instead of 'RUST'?
Yes it should be 'rust-kernel' thanks for pointing it, we got missed it
while updating RFC we will correct it while sending v3.
Thanks
Harish
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH RFC v2 7/8] kernel-yocto: Fix for buildpaths errors when rust is enabled for kernel
2025-11-05 13:09 [PATCH RFC v2 0/8] Enable rust support for linux kernel Harish.Sadineni
` (5 preceding siblings ...)
2025-11-05 13:09 ` [PATCH RFC v2 6/8] linux-yocto: enable Rust support in kernel configuration Harish.Sadineni
@ 2025-11-05 13:09 ` Harish.Sadineni
2025-11-06 21:09 ` [OE-core] " Yoann Congal
2025-11-05 13:09 ` [PATCH RFC v2 8/8] kernel-devsrc: copying rust-kernel soucre to $kerneldir/build Harish.Sadineni
2025-11-06 21:29 ` [OE-core] [PATCH RFC v2 0/8] Enable rust support for linux kernel Yoann Congal
8 siblings, 1 reply; 21+ messages in thread
From: Harish.Sadineni @ 2025-11-05 13:09 UTC (permalink / raw)
To: openembedded-core
Cc: Randy.MacLeod, bruce.ashfield, sundeep.kokkonda, elmehdi.younes
From: Harish Sadineni <Harish.Sadineni@windriver.com>
Fixes for buildpaths errors after enabling rust for linux-kernel
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 7a115bdffd..98cc71e137 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] 21+ messages in thread* Re: [OE-core] [PATCH RFC v2 7/8] kernel-yocto: Fix for buildpaths errors when rust is enabled for kernel
2025-11-05 13:09 ` [PATCH RFC v2 7/8] kernel-yocto: Fix for buildpaths errors when rust is enabled for kernel Harish.Sadineni
@ 2025-11-06 21:09 ` Yoann Congal
0 siblings, 0 replies; 21+ messages in thread
From: Yoann Congal @ 2025-11-06 21:09 UTC (permalink / raw)
To: Harish.Sadineni
Cc: openembedded-core, Randy.MacLeod, bruce.ashfield,
sundeep.kokkonda, elmehdi.younes
Le Wed, Nov 05, 2025 at 05:09:41AM -0800, Sadineni, Harish via lists.openembedded.org a �crit :
> From: Harish Sadineni <Harish.Sadineni@windriver.com>
>
> Fixes for buildpaths errors after enabling rust for linux-kernel
>
> 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 7a115bdffd..98cc71e137 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)}"
I think the more usual way to write this is:
inherit_defer ${@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
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#225764): https://lists.openembedded.org/g/openembedded-core/message/225764
> Mute This Topic: https://lists.openembedded.org/mt/116133833/4316185
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [yoann.congal@smile.fr]
> -=-=-=-=-=-=-=-=-=-=-=-
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH RFC v2 8/8] kernel-devsrc: copying rust-kernel soucre to $kerneldir/build
2025-11-05 13:09 [PATCH RFC v2 0/8] Enable rust support for linux kernel Harish.Sadineni
` (6 preceding siblings ...)
2025-11-05 13:09 ` [PATCH RFC v2 7/8] kernel-yocto: Fix for buildpaths errors when rust is enabled for kernel Harish.Sadineni
@ 2025-11-05 13:09 ` Harish.Sadineni
2025-11-06 21:29 ` [OE-core] [PATCH RFC v2 0/8] Enable rust support for linux kernel Yoann Congal
8 siblings, 0 replies; 21+ messages in thread
From: Harish.Sadineni @ 2025-11-05 13:09 UTC (permalink / raw)
To: openembedded-core
Cc: Randy.MacLeod, bruce.ashfield, sundeep.kokkonda, elmehdi.younes
From: Harish Sadineni <Harish.Sadineni@windriver.com>
In sdk while running make prepare in kernel-source directory after rust
enabling rust config. it will throw erros since only makefile is present
in rust kernel souces.
Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
meta/recipes-kernel/linux/kernel-devsrc.bb | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
index 411c99ba30..b4bc9eaac2 100644
--- a/meta/recipes-kernel/linux/kernel-devsrc.bb
+++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
@@ -140,6 +140,10 @@ do_install() {
cp -a scripts $kerneldir/build
+ 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] 21+ messages in thread* Re: [OE-core] [PATCH RFC v2 0/8] Enable rust support for linux kernel
2025-11-05 13:09 [PATCH RFC v2 0/8] Enable rust support for linux kernel Harish.Sadineni
` (7 preceding siblings ...)
2025-11-05 13:09 ` [PATCH RFC v2 8/8] kernel-devsrc: copying rust-kernel soucre to $kerneldir/build Harish.Sadineni
@ 2025-11-06 21:29 ` Yoann Congal
8 siblings, 0 replies; 21+ messages in thread
From: Yoann Congal @ 2025-11-06 21:29 UTC (permalink / raw)
To: Harish.Sadineni, openembedded-core
Cc: Randy.MacLeod, bruce.ashfield, sundeep.kokkonda, elmehdi.younes
Hello,
Le 05/11/2025 à 14:09, Sadineni, Harish via lists.openembedded.org a écrit :
> From: Harish Sadineni <Harish.Sadineni@windriver.com>
>
> v2:
> - Addressed Bruce review comments for Making rust support for linux kernel as optional via distro feature.
> - Fixed buildpaths errors by appending --remap-path-prefix to RUST_DEBUG_REMAP
> - Removed unnecessary flags from rust.cfg
>
> 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 inside sdk.
>
> Summary of changes:
>
> - Patch 1: Extend 'bindgen-cli' to support 'nativesdk', allowing it to be available in the SDK environment.
> - Patch 2: Add required dependencies ('clang-native', 'rust-native', 'bindgen-cli-native') to the kernel to support Rust binding generation.
> - Patch 3: Install the Rust standard library source ('library/') into `work-shared` and which will be later copied to
> linux-yocto recipe-sysroot-native.
> - Patch 4: Stage the Rust sources into `recipe-sysroot-native` for kernel build compatibility, making them visible during native builds.
> - Patch 5: Update `kernel-yocto.bbclass` to invoke `make rustavailable` during 'do_kernel_configme', ensuring Rust readiness.
> - Patch 6: Add kernel configuration support for Rust (via 'rust.cfg' and 'rust.scc'), enabling the Rust build options in kernel config.
> - Patch 7: Fixed buildpaths errors when rust is enabled for kernel by appending --remap-path-prefix to RUST_DEBUG_REMAP
> - patch 8: Copy Rust kernel sources into kernel-devsrc build directory which will be required while running 'make prepare' in sdk.
>
> Harish Sadineni (8):
> bindgen-cli: extend BBCLASSEXTEND to include nativesdk
> linux-yocto: add clang-native,rust-native and bindgen-cli-native to
> DEPENDS
> rust: install Rust library sources for 'make rustavailable' support
> rust: stage rustlib sources for linux-yocto make rustavailable support
> kernel-yocto: add rust support via make rustavailable in
> do_kernel_configme
> linux-yocto: enable Rust support in kernel configuration
> kernel-yocto: Fix for buildpaths errors when rust is enabled for
> kernel
> kernel-devsrc: copying rust-kernel soucre to $kerneldir/build
>
> meta/classes-recipe/kernel-yocto.bbclass | 16 ++++++++++++++++
> .../bindgen-cli/bindgen-cli_0.72.1.bb | 2 +-
> meta/recipes-devtools/rust/rust_1.90.0.bb | 12 ++++++++++++
> meta/recipes-kernel/linux/files/rust.cfg | 9 +++++++++
> meta/recipes-kernel/linux/files/rust.scc | 1 +
> meta/recipes-kernel/linux/kernel-devsrc.bb | 4 ++++
> meta/recipes-kernel/linux/linux-yocto.inc | 9 +++++++++
> meta/recipes-kernel/linux/linux-yocto_6.16.bb | 3 +++
> 8 files changed, 55 insertions(+), 1 deletion(-)
> create mode 100644 meta/recipes-kernel/linux/files/rust.cfg
> create mode 100644 meta/recipes-kernel/linux/files/rust.scc
I made some comments inline in the patches.
I've tested the series with the rust samples inside the kernel sources:
In a basic(*) Yocto/Poky master build:
In local.conf:
DISTRO_FEATURES:append = ' rust-kernel'
CORE_IMAGE_EXTRA_INSTALL += "kernel-module-rust-minimal"
Then,
bitbake core-image-minimal
runqemu kvm snapshot nographic serial
root@qemux86-64:~# modprobe rust_minimal
[ 9.394264] rust_minimal: Rust minimal sample (init)
[ 9.394915] rust_minimal: Am I built-in? false
=> Samples are working. Nice!
(*) I lied, my setup is not entirely basic: I use ccache.
With ccache, I get this error:
| error: multiple input filenames provided (first two filenames are gcc and .../tmp/work-shared/qemux86-64/kernel-source/scripts/generate_rust_target.rs)
So I had to add in local.conf:
CCACHE_DISABLE:pn-linux-yocto = "1"
Can you integrate in your patch series the fix El Mehdi did for this?
In meta/recipes-kernel/linux/linux-yocto.inc, he added
+# TODO: Kernel rust code compilation breaks under ccache, disable it for now
+CCACHE_DISABLE ?= "${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', '1', '', d)}"
Obviously, we will need to investigate why that break and fix it but in
the meantime, that mean that your RFC is testable in more configuration
Thanks!
Regards,
--
Yoann Congal
Smile ECS
^ permalink raw reply [flat|nested] 21+ messages in thread