4 ms·
Ok. So... Will I need to have two compilers to build the kernel? gcc and rustc(LLVM)?
by slezyr 5y ago
Ok. So... Will I need to have two compilers to build the kernel? gcc and rustc(LLVM)?
- galgalesh 5y agoThe email also gives an update on ongoing work to add rust support to GCC.
- slimginz 5y agoNot familiar with C compiling besides a few small programs I wrote back in college but can Linux not be compiled currently with LLVM?
- gpm 5y agoLinux can be compiled with LLVM (clang), and the current rust code strongly prefers that you do so. It's possible to do gcc + rustc, but it's less supported, and if you pass the wrong gcc flags I believe it just won't work.
- edgyquant 5y agoIt can, but up until just a couple of years ago it could not as it used a lot of GCC specific syntax
- cesarb 5y ago> until just a couple of years ago it could not as it used a lot of GCC specific syntax Note that the kernel still uses a lot of GCC specific syntax; it's just that LLVM/clang was laboriously made to understand all of that (with a few exceptions where the kernel was changed instead). And when they were almost done, the kernel started requiring another new GCC specific syntax, so they had to chase after that too.
- varajelle 5y agoYou'll also need make, bash, perl, and more... [https://www.kernel.org/doc/html/v4.15/process/changes.html https://www.kernel.org/doc/html/v4.15/process/changes.html]
- pavon 5y agoAlso, rust is only being considered for kernel modules, not kernel core. And even then, only kernel modules that don't need to build on architectures rust doesn't support. So if you don't need any of those particular modules you can just disable them. In the long term, LLVM/Rust support for more architectures improves, and support for older architectures is dropped, this will become a larger fraction of kernel modules, but it will be a very long time until it is considered for something like ext5.