3 ms·
Rust seems neat but one thing I've always liked about Linux is how few dependencies it needs to compile. The current rust compiler is not small and depends on L
by swiley 6y ago
Rust seems neat but one thing I've always liked about Linux is how few dependencies it needs to compile. The current rust compiler is not small and depends on LLVM which is not great.
- cbmuser 6y agoThis is why gccrs development is now backed by a company: > https://rust-gcc.github.io/ https://rust-gcc.github.io/ With gccrs, the portability issues of rustc will go away and no extra toolchain will be needed for the Rust code in the kernel either.
- amelius 6y agoWhy is LLVM a problem?
- erik_seaberg 6y agoAccording to https://www.kernel.org/doc/html/latest/kbuild/llvm.html https://www.kernel.org/doc/html/latest/kbuild/llvm.html > LLVM does not target all of the architectures that Linux supports and just because a target is supported in LLVM does not mean that the kernel will build or work without any issues.
- dleslie 6y agoLLVM is a non-starter for _many_ small embedded targets. GCC is the go-to for anything not x86 or ARM.
- alexhutcheson 6y agoARM seems to have pretty thoroughly won the category of “embedded targets that are capable enough to run Linux”, though. Other than ARM and (presumably in the future) RISC-V, what other architectures are still relevant for new embedded designs that would run Linux? Obviously there is still significantly more diversity at the low end of the embedded world, but you wouldn’t run Linux on e.g. an MSP430, even if you somehow had a compiler that would support that.
- rocqua 6y agoThis is why the idea for Rust in the kernel, for now, only targets drivers. Drivers are target specific, so you can use it only for drivers on architectures that are LLVM capable.
- mkipper 6y agoYou can compile most common Linux kernel targets with clang, but the kernel was historically optimized with GCC in mind, so I believe there are still size and speed impacts from using LLVM. Not to mention plain ol' inertia. The vast majority of people compiling the kernel are using GCC. Switching to a different toolchain or maintaining two toolchains (assuming there are no subtle ABI issues between a GCC kernel and LLVM driver) isn't necessarily trivial, and requiring that just to build a single driver might rub some people the wrong way. That's not a _problem_ with LLVM, but it is an inconvenience.
- xvilka 6y agoIt's a problem with LLVM though - there is plenty of bugs[1] still. On the good side, more and more of them get fixed with every new LLVM release. [1] https://bugs.llvm.org/show_bug.cgi?id=4068 https://bugs.llvm.org/show_bug.cgi?id=4068
- rocqua 6y agoNote that the portability issue mentioned by many here is much less of an issue when writing drivers. After all drivers tend to be architecture specific. This is why the idea is to start using Rust in the kernel for drivers.
- nicoburns 6y ago> The current rust compiler is not small Is GCC really any smaller?