r/linux • • Dec 10 '25

Kernel "Rust in the kernel is no longer experimental — it is now a core part of the kernel and is here to stay."

https://lwn.net/Articles/1049831/
1.5k Upvotes

353 comments sorted by

View all comments

Show parent comments

52

u/NaheemSays Dec 10 '25

Rust is not available/stable on all platforms Linux runs on

97

u/zayatura Dec 10 '25

Then those platforms will not be able to use the kernel modules written in Rust. It's not like core parts of the kernel are being rewritten in Rust.

-55

u/dddurd Dec 10 '25

I'm sure rust people will try to rewrite existing core components to make rust a hard dependency for all.  

92

u/asmx85 Dec 10 '25

"Rust people" sounds like "Linux people" 15 years ago. I guess we did not learn as Linux got more acceptance and popularity.

→ More replies (1)

48

u/john0201 Dec 10 '25

I for one hope all new things end and nothing changes. Change is big and scary. Also what are them damn kids doing over there?!?!

→ More replies (1)

7

u/lestofante Dec 10 '25

Yes, when gcc-rs will be completed and so rust will hit all target.

But also I was reading an article on excarly what target would be dropped, and mostly is stuff that is barely supported anyway, I think they found out one target was borked by months and no one complained.

→ More replies (1)

24

u/Tusen_Takk Dec 10 '25

Is this not a large push towards the rust developers to make that not the case with great haste?

27

u/DHermit Dec 10 '25

It's dependent on LLVM. And there are projects for non-LLVM based building, but they obviously are huge undertakings.

32

u/tesfabpel Dec 10 '25

There are also efforts like gccrs and rustc_codegen_gcc (in the same GitHub organization as Rust).

The first is a frontend for GCC and replaces rustc.

The second is an alternative backend for rustc that uses libgccjit to use GCC as the underlying compiler, instead of LLVM (or cranelift). This IMHO is the best way forward but gccrs has also its reason to exist.

22

u/adnanclyde Dec 10 '25

With the prospect of Rust becoming a part of the Linux kernel's future, I can imagine a lot more resources getting poured in the alternatives. Whether it's a gcc based compatible compiler, or adding more targets supported into Cranelift.

13

u/DHermit Dec 10 '25 edited Dec 10 '25

That could be, but on the other hand, the targets where Rust isn't available aren't all that popular.

Edit: is -> isn't

9

u/Lower-Limit3695 Dec 10 '25 edited Dec 10 '25

Rust is available for:

  • x86

  • x86_64

  • arm

  • aarch64

  • riscv32

  • riscv64

  • mips

  • mips64 -powerpc

  • powerpc64

  • nvptx

  • wasm32

  • loongarch32

  • loongarch64

  • s390x

I would not say that the targets where Rust is available aren't all that popular. (Many of these are very popular).

I'd say that issue is that Rust doesn't support the same breadth of architectures as gcc

16

u/NighthawkFoo Dec 10 '25

That’s because gcc supports EVERYTHING, even architectures that have been long abandoned by their manufacturers.

7

u/DHermit Dec 10 '25

My bad, made a typo

1

u/cp5184 Dec 12 '25

Seems like this is putting the cart before the horse then...

13

u/wintrmt3 Dec 10 '25 edited Dec 10 '25

People who want to waste electricity running museum pieces should do it on a museum piece OS, and not holding back the the other 99.999% of the world.

3

u/PoL0 Dec 10 '25 edited Dec 10 '25

doesn't the rust tool chain require an internet connection so cargo can download dependencies? I suppose there's ways around it tho.

edit: thanks all for the insight. seems it's not an issue.

20

u/gmes78 Dec 10 '25 edited Dec 10 '25

You can just run cargo vendor to download dependencies beforehand.

This is irrelevant, though. The Linux kernel does not use Cargo, any dependencies it uses are part of the kernel tree.

6

u/PoL0 Dec 10 '25

The Linux kernel does not Cargo, any dependencies it uses are part of the kernel tree.

makes total sense. thanks for the insight!

28

u/syklemil Dec 10 '25

doesn't the rust tool chain require an internet connection so cargo can download dependencies?

No.

  1. If you want to add some dependency you need a way to have access to that dependency when you perform static compilation, no matter the language.

  2. If you have all the code you need, then you obviously also don't need internet access.

  3. You don't even have to use cargo, you can use rustc by hand or with other tools like make if that's your jam. People just tend to use cargo because they like it.

5

u/PoL0 Dec 10 '25

yeah assumed so, as long as the dependency is included there should be no problem.

tbh I never suffered this myself, but remember reading complaints about it (seems you can't trust everything you read on the interwebs heh)

8

u/wintrmt3 Dec 10 '25

Rust in the kernel doesn't use cargo, so that's a total non-issue.

3

u/AWonderingWizard Dec 10 '25

I don't understand enough about rust toolchains yet, but wasn't there bad implications for cargo with the recent npm malware?

4

u/steveklabnik1 Dec 11 '25

The kernel does not use cargo or crates.io, so even if that were true it's irrelevant in this case.

5

u/BidEnvironmental4301 Dec 10 '25

yes there are ways to build offline, if there wasn't, then Rust programs wouldn't exist in Nix (nixpkgs)