The C and C++ compilers use the same backends (and rust to, llvm), just try to build a module with clang for a kernel build with GCC, or it fails in compile phase or when you try to load the module. You can write a module in the lenguaje that you want if you use the same backend, but if we are talking about avoiding to use a kernel with rust, man is the default in the kernel, just read the config, rust is disabled
Help, I don’t know how to use anything different than gentoo
- 0 Posts
- 5 Comments
- groche@lemmy.rochegmr.comtoLinux@programming.dev•17k Lines Of New Rust Kernel Code Heading Into Linux 7.421·10 days ago
- groche@lemmy.rochegmr.comtoLinux@programming.dev•17k Lines Of New Rust Kernel Code Heading Into Linux 7.411·12 days ago
You can’t load modules built with a different compiler. The modules aren’t external programs, the modules are literally part of the kernel. And if you want to use a module wrote in rust you also need to have built in the rust support in the kernel
- groche@lemmy.rochegmr.comtoLinux@programming.dev•17k Lines Of New Rust Kernel Code Heading Into Linux 7.411·16 days ago
The default is GCC, and you need to build the kernel with clang to build the kernel with the rust support, how is possible rust arrives by default? https://docs.kernel.org/rust/quick-start.html
Maybe is the default in your distribution, but is not the default in the kernel
- groche@lemmy.rochegmr.comtoLinux@programming.dev•17k Lines Of New Rust Kernel Code Heading Into Linux 7.402·18 days ago
Is very easy to build the kernel without rust, and is the default scenario
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