3 ms·
m68k has a LLVM port already, so Rust can be implemented for that platform.[0] It would be nice to have LLVM backends for alpha, hppa and sh4 - these older arc
by zozbot234 1y ago
m68k has a LLVM port already, so Rust can be implemented for that platform.[0] It would be nice to have LLVM backends for alpha, hppa and sh4 - these older architectures tend to be quite simple so a working LLVM has plenty of value as a reference and for educational use.
(LLVM even used to have an in-tree DEC Alpha backend, though that was back in 2011 and not relevant to any version of Rust.)
[0] Looks like there is basic initial support but no 'core' or 'std' builds yet. https://doc.rust-lang.org/rustc/platform-support/m68k-unknown-linux-gnu.html https://doc.rust-lang.org/rustc/platform-support/m68k-unknow... This should potentially be fixable.
- curt15 1y agoShouldn't the codegen_gcc project[1] theoretically allow Rust to target backends that only GCC supports? [1] https://github.com/rust-lang/rustc_codegen_gcc https://github.com/rust-lang/rustc_codegen_gcc
- fweimer 1y agoLLVM is desirable for other reasons (LLVMpipe for example), so investing into an LLVM port is probably a better use of limited resources than improving and maintaining a retargeted rustc for GCC.
- dathinab 1y agoyes and no yes, from a pure code generation aspect no, as all conditional-compiled platform specific code is missing. So using it with #[no_core] should work (assuming the WIP part of the backend isn't a problem). But beyond that you have to first port libcore (should be doable) and then libstd (quite a bunch of work).
- CodesInChaos 1y agohttps://lists.debian.org/debian-devel/2025/11/msg00010.html https://lists.debian.org/debian-devel/2025/11/msg00010.html
- cbmuser 1y agoYes, that is being worked on.
- pornel 1y agoThe GCC backend makes Rust for Dreamcast work: https://www.dreamcast.rs/ https://www.dreamcast.rs/ (not relevant to Debian, but cool that it's already possible)
- fweimer 1y agoAs far as I understand it, the m68k LLVM port is not ABI-compatible with GCC on Linux because the alignment is wrong: https://wiki.debian.org/M68k/Alignment https://wiki.debian.org/M68k/Alignment (page says that the LLVM packages are FTBFS because of this)
- zozbot234 1y agoThe principled way to address this would be to define a new ABI suffix for the m68k-unknown-linux-gnu target triple, replacing the existing 'gnu' which would retain GCC compatibility with 2-byte alignment for int.