3 ms·
Any ideas how rust's cross compilation compares with golang? I am amazed with how easy it to cross compile to different platforms supported by golang. Curious
by dominotw 11y ago
Any ideas how rust's cross compilation compares with golang?
I am amazed with how easy it to cross compile to different platforms supported by golang. Curious how rust compares.
- steveklabnik 11y agoThe current situation is "it works, but is not as easy as we'd like." We have plans underway to make it very trivial, but the needed infrastructure work isn't quite there yet. A summary is "every Rust compiler is a cross-compiler, but you need a copy of the standard library for your target platform available." Getting said copy is what takes the work. In the future, we want it to be as easy as a call to the command-line, but for now, https://github.com/japaric/rust-cross https://github.com/japaric/rust-cross is a good resource. See also https://github.com/japaric/rust-everywhere https://github.com/japaric/rust-everywhere , which is very interesting.
- fabrice_d 11y agoI'm maintaining a docker image to cross-compile at https://hub.docker.com/r/fabricedesre/rustpi2/ https://hub.docker.com/r/fabricedesre/rustpi2/. It's Rasberry Pi2 specific since it relies on a tweaked sysroot to link against OpenSSL and a few other libraries. The way I'm using it is: docker run --name rustpi2 -v `pwd`:/home/rustpi2/dev/source -v $HOME/.cargo:/home/rustpi2/.cargo fabricedesre/rustpi2 cargopi build (cargopi is just equivalent to cargo --target=armv7-unknown-linux-gnueabihf)