4 ms·
Does this mean that all architectures that Linux supports but Rust doesn't are straight in the bin?
by amiga386 11mo ago
Does this mean that all architectures that Linux supports but Rust doesn't are straight in the bin?
- bmicraft 11mo agoWhich ones would that be?
- eru 11mo agoAnd more specifically which ones that anyone would use a new kernel on?
- kykat 11mo agoSome people talk about 68k not being supported being a problem
- pornel 11mo agom68k Linux is supported by Rust, even in the LLVM backend. Rust also has an experimental GCC-based codegen backend (based on libgccjit (which isn't used as a JIT)). So platforms that don't have either LLVM nor recent GCC are screwed.
- sakompella 11mo agohow on earth is linux being compiled for platforms without a GCC? additionally, I believe the GCC backend is incomplete. the `core` library is able to compile, but rust's `std` cannot be.
- dwattttt 11mo agoI don't believe Rust for Linux use std. I'm not sure how much of Rust for Linux the GCC/Rust effort(s) are able to compile, but if it was "all of it" I'm sure we'd have heard about it.
- dessimus 11mo ago>nor recent GCC are screwed. Not having a recent GCC and not having GCC are different things. There may be architectures that have older GCC versions, but are no longer supported for more current C specs like C11, C23, etc.
- muvlon 11mo agoIn order to figure this out I took the list of platforms supported by Rust from https://doc.rust-lang.org/nightly/rustc/platform-support.html https://doc.rust-lang.org/nightly/rustc/platform-support.htm... and those supported by Linux from https://docs.kernel.org/arch/index.html https://docs.kernel.org/arch/index.html, cleaned them up so they can be compared like for like and then put them into this python script: linux = { "alpha", "arc", "arm", "aarch64", "csky", "hexagon", "loongarch", "m68k", "microblaze", "mips", "mips64", "nios2", "openrisc", "parisc", "powerpc", "powerpc64", "riscv", "s390", "s390x", "sh", "sparc", "sparc64", "x86", "x86_64", "xtensa" } rust = { "arm", "aarch64", "amdcgn", "avr", "bpfeb", "bpfel", "csky", "hexagon", "x86", "x86_64", "loongarch", "m68k", "mips", "mips64", "msp430", "nvptx", "powerpc", "powerpc64", "riscv", "s390x", "sparc", "sparc64", "wasm32", "wasm64", "xtensa" } print(f"Both: {linux.intersection(rust)}") print(f"Linux, but not Rust: {linux.difference(rust)}") print(f"Rust, but not Linux: {rust.difference(linux)}") Which yields: Both: {'aarch64', 'xtensa', 'sparc', 'm68k', 'mips64', 'sparc64', 'csky', 'riscv', 'powerpc64', 's390x', 'x86', 'powerpc', 'loongarch', 'mips', 'hexagon', 'arm', 'x86_64'} Linux, but not Rust: {'nios2', 'microblaze', 'arc', 'openrisc', 'parisc', 's390', 'alpha', 'sh'} Rust, but not Linux: {'avr', 'bpfel', 'amdcgn', 'wasm32', 'msp430', 'bpfeb', 'nvptx', 'wasm64'} Personally, I've never used a computer from the "Linux, but not Rust" list, although I have gotten close to a DEC Alpha that was on display somewhere, and I know somebody who had a Sega Dreamcast (`sh`) at some point.
- Palomides 11mo agosome of the platforms on that list are not supported well enough to say they actually have usable rust, e.g m68k
- bmicraft 11mo agoWell, GCC 15 already ended support for the nios2 soft-core. The successor to it is Nios V which runs RISC-V. If users want us update the kernel, they'll also need to update their FPGA. Microblaze also is a soft-core, based on RISC-V, presumably it could support actual RISC-V if anyone cared. All others haven't received new hardware within the last 10 years, everybody using these will already be running an LTS kernel on there. It looks like there really are no reasons not to require rust for new versions of the kernel from now on then!
- amiga386 11mo agohttps://lwn.net/Articles/1045363/ https://lwn.net/Articles/1045363/ > Rust, which has been cited as a cause for concern around ensuring continuing support for old architectures, supports 14 of the kernel's 20-ish architectures, the exceptions being Alpha, Nios II, OpenRISC, PARISC, and SuperH.
- embedding-shape 11mo ago> supports 14 of the kernel's 20-ish architectures That's a lot better than I expected to be honest, I was thinking maybe Rust supported 6-7 architectures in total, but seems Rust already has pretty wide support. If you start considering all tiers, the scope of support seems enormous: https://doc.rust-lang.org/nightly/rustc/platform-support.html https://doc.rust-lang.org/nightly/rustc/platform-support.htm...
- chippiewill 11mo agoThey probably get a few for "free" from LLVM supporting them
- morkalork 11mo agoWasn't that a whole tent pole of LLVM?
- estebank 11mo agoLLVM platform support is neither sufficient (rustc needs to be taught about the platform) not technically necessary (you could write a rustc backend that targets a platform that LLVM doesn't, like modifying cranelift or once the gcc backend reaches maturity).
- Lariscus 11mo agoIts strange to me that Linux dropped Itanium two years ago but they decided to keep supporting Alpha and PA-RISC.
- 11mo ago
- vincentkriek 11mo agoNo, Rust is in the kernel for driver subsystems. Core linux parts can't be written in Rust yet for the problem you mention. But new drivers *can* be written in Rust
- hexo 11mo agoYes. Cooked.