Enable Rust in the Linux kernel
Description:
Enable Rust in the kernel build for rust modules support.
Here i attached some possible changes to the config and PKGBUILD
files.
This will add rustc
and llvm
as a makedepend
.
Additional info:
- package version(s): 6.9.7.arch1-1
- it requires the rust toolchain version 1.76 as of kernel 6.9
-
it is setup automatically by running
rustup override set $(scripts/min-tool-version.sh rustc)
rustup component add rust-src
cargo install --locked --version $(scripts/min-tool-version.sh bindgen) bindgen-cli
-
- When building, pass
LLVM=1
to themake
command. - config file
- just enable rust from nconfig
-
PKGBUILD example
- from my limited testing if
make htdocs
is enabled the build freezes, as of now i don't know why ("WARNING: Duplicate C declaration") but after a while it starts back. As of now i have no idea of why id does that, it must be fixed.
- from my limited testing if
- Linux kernel documentation for Rust
Steps to reproduce:
- Build the kernel with the default PKGBUILD
- Try to load a kernel module written in Rust
- It fails to load