public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: "Mathieu Dubois-Briand" <mathieu.dubois-briand@bootlin.com>
To: <Harish.Sadineni@windriver.com>,
	<openembedded-core@lists.openembedded.org>
Cc: <Sundeep.Kokkonda@windriver.com>
Subject: Re: [OE-core] [RFC PATCH 0/7] Enable rust support for linux kernel
Date: Mon, 27 Oct 2025 07:03:36 +0100	[thread overview]
Message-ID: <DDSVLCVN8K5F.RVYE5VTH4FQY@bootlin.com> (raw)
In-Reply-To: <20251023112547.4044904-1-Harish.Sadineni@windriver.com>

On Thu Oct 23, 2025 at 1:25 PM CEST, Harish via lists.openembedded.org Sadineni wrote:
> From: Harish Sadineni <Harish.Sadineni@windriver.com>
>
> 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', '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: Copy Rust kernel sources into kernel-devsrc build directory which will be required while runnig 'make prepare' in sdk.
>
> WIP - need inputs:
> 1. In patch-3, rust sources are copied from ${RUSTSRC} to ${TMPDIR}/work-shared, which is redundant and improving it in
>  more optimized way by extracting rust directly into ${TMPDIR}/work-shared and then use it for both rust & linux-yocto recipes.
>  
> 2. In patch-6, We've suppressed a few build path QA issues with INSANE_SKIP.
> We have tried fixing those using DEBUG_PREFIX_MAP & --remap-path-prefix but unable to resolve it.
> Are there any flags for kernel or any other inputs?
>  
> 3. If rust.cfg & rust.scc changes are ok, we will send kernel configuration fragment to yocto-kernel-cache.
>
> With above considerations, We did a successful build of Enabling rust in linux kernel and 
> Tested a rust-out-of-tree kernel module in sdk for x86-64 & arm64 architectures.
>
> Harish Sadineni (7):
>   bindgen-cli: extend BBCLASSEXTEND to include nativesdk
>   linux-yocto: add clang-native and bindgen-cli-native to DEPENDS
>   rust: install Rust standard 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-devsrc: copying rust-kernel soucre  to $kerneldir/build
>
>  meta/classes-recipe/kernel-yocto.bbclass      |  4 ++++
>  .../bindgen-cli/bindgen-cli_0.72.1.bb         |  2 +-
>  meta/recipes-devtools/rust/rust_1.90.0.bb     | 13 +++++++++++-
>  meta/recipes-kernel/linux/files/rust.cfg      | 20 +++++++++++++++++++
>  meta/recipes-kernel/linux/files/rust.scc      |  1 +
>  meta/recipes-kernel/linux/kernel-devsrc.bb    |  1 +
>  meta/recipes-kernel/linux/linux-yocto.inc     |  7 +++++++
>  meta/recipes-kernel/linux/linux-yocto_6.16.bb |  4 ++++
>  8 files changed, 50 insertions(+), 2 deletions(-)
>  create mode 100644 meta/recipes-kernel/linux/files/rust.cfg
>  create mode 100644 meta/recipes-kernel/linux/files/rust.scc

Hi Harish,

I know this is still an RFC, but I ran it on the autobuilder to check
how it goes. We had a some error with kernel build:

ERROR: linux-yocto-6.12.52+git-r0 do_patch: Execution of '/srv/pokybuild/yocto-worker/qemux86-alt/build/build/tmp/work/qemux86-poky-linux/linux-yocto/6.12.52+git/temp/run.do_patch.410367' failed with exit code 1
...
| cp: cannot stat '/srv/pokybuild/yocto-worker/qemux86-alt/build/build/tmp/work-shared/rust': No such file or directory

This happened in almost all builds as far as I can tell:

https://autobuilder.yoctoproject.org/valkyrie/#/builders/20/builds/2614
https://autobuilder.yoctoproject.org/valkyrie/#/builders/9/builds/2623
https://autobuilder.yoctoproject.org/valkyrie/#/builders/2/builds/2650

https://autobuilder.yoctoproject.org/valkyrie/#/builders/29/builds/2638

Thanks,
Mathieu


-- 
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



  parent reply	other threads:[~2025-10-27  6:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-23 11:25 [RFC PATCH 0/7] Enable rust support for linux kernel Harish.Sadineni
2025-10-23 11:25 ` [RFC PATCH 1/7] bindgen-cli: extend BBCLASSEXTEND to include nativesdk Harish.Sadineni
2025-10-23 11:25 ` [RFC PATCH 2/7] linux-yocto: add clang-native and bindgen-cli-native to DEPENDS Harish.Sadineni
2025-10-23 11:25 ` [RFC PATCH 3/7] rust: install Rust standard library sources for make rustavailable support Harish.Sadineni
2025-10-23 11:25 ` [RFC PATCH 4/7] rust: stage rustlib sources for linux-yocto " Harish.Sadineni
2025-10-23 11:25 ` [RFC PATCH 5/7] kernel-yocto: add rust support via make rustavailable in do_kernel_configme Harish.Sadineni
2025-10-23 11:25 ` [RFC PATCH 6/7] linux-yocto: enable Rust support in kernel configuration Harish.Sadineni
2025-10-23 15:10   ` El Mehdi YOUNES
2025-11-04 17:43   ` [OE-core] " Randy MacLeod
2025-10-23 11:25 ` [RFC PATCH 7/7] kernel-devsrc: copying rust-kernel soucre to $kerneldir/build Harish.Sadineni
2025-10-23 13:00 ` [OE-core] [RFC PATCH 0/7] Enable rust support for linux kernel Bruce Ashfield
2025-10-23 14:57 ` El Mehdi YOUNES
2025-10-27  6:03 ` Mathieu Dubois-Briand [this message]
2025-11-04 19:50   ` [OE-core] " Yoann Congal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DDSVLCVN8K5F.RVYE5VTH4FQY@bootlin.com \
    --to=mathieu.dubois-briand@bootlin.com \
    --cc=Harish.Sadineni@windriver.com \
    --cc=Sundeep.Kokkonda@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox