logoalt Hacker News

blintztoday at 5:22 AM3 repliesview on HN

Doesn’t rustc emit LLVM IR? Are there a lot of systems that LLVM doesn’t support?


Replies

loegtoday at 6:58 AM

There are a number of oddball platforms LLVM doesn't support, yeah.

aw1621107today at 5:38 AM

rustc can use a few different backends. By my understanding, the LLVM backend is fully supported, the Cranelift backend is either fully supported or nearly so, and there's a GCC backend in the works. In addition, there's a separate project to create an independent Rust frontend as part of GCC.

Even then, there are still some systems that will support C but won't support Rust any time soon. Systems with old compilers/compiler forks, systems with unusual data types which violate Rust's assumptions (like 8 bit bytes IIRC)

einpoklumtoday at 8:28 AM

Many organizations and environments will not switch themselves to LLVM to hamfist compiled Rust code. Nor is the fact of LLVM supporting something in principle means that it's installed on the relevant OS distribution.

show 2 replies