3 ms·
GCC can still compile the components written in C. Only drivers for select hardware might be written in Rust in the future, optional components basically. And G
by est31 6y ago
GCC can still compile the components written in C. Only drivers for select hardware might be written in Rust in the future, optional components basically. And GCC won't be more disadvantaged than clang, as clang can't compile Rust code either. The only production compiler that can compile Rust is rustc.
- rwmj 6y agorustc uses LLVM like clang. That seems important because features like LTO require the whole kernel to be compiled with the same toolchain.
- polskibus 6y agoIs it possible to disable some features in rust to avoid full recompilation of the kernel?
- rwmj 6y agoI'm not sure what that means, but I can discuss the issue with LTO. LTO means that the normal compile step turns the source into an intermediate form. The final compilation doesn't happen until link time. The problem is this intermediate form which is a compiler (even compiler version) -specific internal format. GCC and LLVM use different formats so you cannot mix the two compilers on the same LTO program. I'm not certain but it might be possible to use ld -r to obtain a real compiled object from each toolchain and then link those together at the end, but of course that loses some benefits of LTO, especially cross-module inlining.
- est31 6y agoIt seems to me there isn't mainline LTO support yet?
- ndesaulniers 6y agoWork in progress. The series was resent two weeks so. We've been shipping it in production in kernels in Android for years.
- xg15 6y agoThis answer was a very "no"-sounding "yes". :)