this post was submitted on 23 Oct 2026
41 points (100.0% liked)

Linux

15396 readers
212 users here now

A community for everything relating to the GNU/Linux operating system (except the memes!)

Also, check out:

Original icon base courtesy of lewing@isc.tamu.edu and The GIMP

founded 3 years ago
MODERATORS
 

Miguel Ojeda sent out his pull request of the new Rust kernel code slated for introduction in Linux 7.4. It's a big one this round due to updating the Zerocopy vendored library plus updating other Rust crates for the kernel.

The Zerocopy crate update is a big one in jumping eight versions ahead. This is the code providing traits and macros to safely convert between raw byte sequences and structured types. Rust for Linux 7.4 also has other toolchain and infrastructure updates, enabling the unstable proc_macro_span feature for better diagnostics of all procedural macros, and more.

The Rust kernel create adds new "mem" and "ratelimit" modules while improving some of the existing modules. The pin-init crate is adding support for tuple structs as well as allowing for the safe creation of self-references. There is also much improved diagnostics.

More details on these central Rust code changes for Linux 7.4 can be found via this pull request. Via individual subsystem pull requests will also be more Rust code for Linux 7.4, like the NVIDIA Nova driver improvements for Linux 7.4 and the other Rust DRM infrastructure work that brings.

you are viewing a single comment's thread
view the rest of the comments
[โ€“] refalo@programming.dev 1 points 1 day ago (1 children)

just try to build a module with clang for a kernel build with GCC

I did just now, and it worked fine.

[โ€“] groche@lemmy.rochegmr.com 1 points 10 hours ago

Maybe depends for the configs, in my case I need to build the external modules with the same compiler, and in lkml you can see a few warnings about do not mix the compiles: https://lkml.iu.edu/hypermail/linux/kernel/2107.3/08102.html

For rust modules you need to use LVM=1 because you need to use all the LVM stack instead of the GCC stack, if I define in the Makefike the LVM=1 then the build fails with a lot of clang: error: unknown argument: ...

So for me is impossible to build my rust modules for a kernel build with a GCC kernel