Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It works for pure Rust code but once you bring in C, you need another tool chain too. Same as Go, as far as I know.

Zig has both beat right now, as you do not need anything else in either case.



Even if you don't bring in C, you need a cross linker and some libraries to link against. Rust doesn't come with those, except maybe for the mingw target.


I don't think of downloading the libraries as being a "cross toolchain", but that is true.

Common cross-compiled components default to lld, which is a cross linker.

That said, yes, there are some *s here depending on what exactly you're doing.


AFAICT, rust doesn't ship lld, though.


If you are using the various ARM targets or wasm, it'll also include the llvm-tools component of rustup, which does.


Oh, my bad, now that I think about it, all my Rust projects have -sys dependencies so I somehow assumed a cross toolchain is always required.


Yeah. C deps are culturally tolerated by Rustaceans more than Gohers, so it can feel like this even if it isn’t literally the case.




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

Search: