Hacker News new | past | comments | ask | show | jobs | submit login

Not quite. Not all ISAs are equivalent and not all llvm backends are equivalent. Rust depends on a few features that are typically not found in embedded systems, like multiple return registers. I wouldn’t even call ARM an embedded ISA anymore.

Uh... multiple registers dedicated to return values is a feature of an ABI, not an architecture. The hardware doesn't care what you put in those registers, obviously. Rust defines its own ABI for internally-generated code, it doesn't need to care.

And in fact I'm not aware of any such systems. Existing 32+ bit embedded architectures like MIPS, RISC-V, Xtensa, and ARC all have robust instruction sets with large register files and a fully-defined SysV-style C ABI.

No, the reason is as stated elsewhere. Rust doesn't run on these systems because no one bothered to tool up LLVM for them.

> No, the reason is as stated elsewhere. Rust doesn't run on these systems because no one bothered to tool up LLVM for them.

Part of the problem is that LLVM developers themselves are apparently unwilling to release support for architectures that they see as liable to go unmaintained and bitrot in the future, even if someone shows up and does the work. There is a notion of "experimental arch's" but it doesn't seem to be actively used, or to suffice in addressing the issue.

Backend support is pruned for architectures that go dark. But if you showed up with support for a new one I'd be really surprised if it weren't included.

Experimental archs were just used recently for wasm and riscv to find maturity.

Are you referring to a specific discussion on the llvm-dev list? Last one that had a discussion in this area that I recall was Nios2.

Where is the SysV style C ABI defined if we wanted to go read more about it? Or, do you have a favorite reference for a work explaining it's design choices?

I'm interested in soft processors on FPGAs and their tools, and that sounds like it might make for good reading.

Nobody actually uses System V anymore, but because it's the thing other Unixy systems are based on, people keep extending the SysV ABI standard to processors ridiculously more powerful than System V itself could ever hope to run on.

As best I can make out, the only relevant portions of the original SysV ABI document are chapters 4 and 5, still available and maintained on the SCO website:


There are also separate documents defining the details of the SysV ABI for each processor family. This StackOverflow answer links to some:


... and the OSDev Wiki links to many more:


100%! My fault for conflating ABI and ISA. The C ABI that is first supported by a new llvm backend typically doesn’t have those features implemented. Which makes porting a higher level language like rust non trivial.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact