Can Rust Really Power Linux Kernel Drivers? Exploring the Challenges
The upcoming Linux 6.0 kernel hints at future Rust driver support, but significant hurdles remain such as compiler compatibility, LLVM vs GCC toolchains, and limited architecture support, making widespread Rust integration unlikely until later releases.
At the recent Open Source Summit, Linus Torvalds and Jonathan Corbet discussed ongoing efforts to use Rust modules in the Linux kernel.
The next major kernel release will be version 6.0, but the version number change does not imply major technical shifts; Torvalds admitted the headline "you can now write drivers in Rust" may only become reality in kernel 6.1.
A dedicated workgroup has been formed and a foundational patch submitted, along with two basic drivers written in the new language. Discussions on LWN have covered a Rust driver for NVMe devices and a kernel server for the Plan 9 9P network protocol.
Significant challenges remain, foremost the compiler issue: the Linux kernel is traditionally built with GCC, whereas Rust relies on the LLVM toolchain.
The kernel can also be compiled with the LLVM‑based Clang compiler, a method already used in Android, ChromeOS, and OpenMandriva. However, Clang’s support is solid only for x86 and ARM architectures; other architectures lack stable support.
Using Clang to compile the kernel introduces another problem: compiling Rust code with GCC.
An experimental Rust‑on‑GCC compiler exists, but its project page notes that the compiler is in a very early stage and cannot yet compile real Rust programs.
Although the project has been open‑source for years, Rust remains at version 0.9 in the kernel, and the Rust‑on‑GCC effort may only appear in GCC 13.
Related reading:
Rust creator Graydon Hoare on systems programming and safety
Skipping 5.x: Linux 6.0 release candidate announced
Rust team releases RLS 1.62
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
21CTO
21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
