5 ms·
Does Rust support the same range of architectures as C? Or is there some way to compile Rust to C to support weird obscure systems? Forgive me if this is somet
by strken 2y ago
Does Rust support the same range of architectures as C? Or is there some way to compile Rust to C to support weird obscure systems?
Forgive me if this is something commonly known by the people involved. It just strikes me as the most obvious objection to Rust in the kernel and I haven't seen any explanation of what's going to happen.
- raggi 2y agorustc does not yet no, there's a lot of hope in the gcc rust frontend to help bridge the gap, but also there is increasing support in llvm for more architectures and things like this should drive interest in accelerating those projects.
- boulos 2y agoRustc lowers to LLVM IR, so it can target anything LLVM can. For a long while, that meant there were obscure architectures that were excluded, but IIRC coverage has improved and the Linux kernel has decided to drop support for them. The main push has actually been from the BSD family pushing clang (and thus LLVM) to support a broader swath of less common architectures.
- Palomides 2y agorust doesn't support alpha, parisc, or super-h, but afaict there are at least nominally functional back ends for the other platforms modern linux runs on
- steveklabnik 2y agoCurrently Rust is only acceptable in drivers. These are inherently platform specific, so there’s no issue with platform support. If Rust doesn’t support the platform, the driver won’t be written in it. Rust’s platform support is better than you might assume, but it is missing some platforms the kernel itself supports, so until that’s resolved, it can’t be in the core of things.
- BD103 2y agoCheck out the Rust's documentation page on platform support[0]. You'll be able to find the full list of supported platforms, as well as the target tier policy, and specific target requirements and maintainers. [0]: https://doc.rust-lang.org/rustc/platform-support.html https://doc.rust-lang.org/rustc/platform-support.html