UPDATE: The xargo-lld-wrapper tool is no longer necessary--xargo v0.3.6 is now able to cross compile with Rustc 1.18.0-nightly on my Mac OS X 10.12.4 system to Raspberry Pi3 (ARM) without it.
For anyone else who may be trying to do this, here are the steps I took to cross-compile a "Hello, world" app in Rust from Mac to Raspberry Pi 3. This process should be readily adaptable to other target platforms:
1) Follow the On Other Systems instructions at https://github.com/japaric/steed with the following changes: UPDATE Docs have changed and reference is no longer valid. While the reference can be found at line 201 here, as mentioned above, xargo-lld-wrapper no longer appears necessary with the latest xargo and rustc.
2) Choose your target platform. For Raspberry Pi 3, wherever the instructions call for
x86_64-unknown-linux-steed, I instead chose
armv7-unknown-linux-steedeabihf. (The RPi3's CPU is an ARMv8 core, but armv7 seems to work. 'hf' at the end refers to hardware floating point.).
3) Continue through the last instruction (eg, xargo build --target armv7-unknown-linux-steedeabihf). It will build many things, but
hello will fail to link at the very end of the process.
4) Build llvm. Unfortunately building llvm will take hours (in the background). There's probably a way to just build ld.lld, but I stuck with the standard build instructions here: https://lld.llvm.org/, namely:
$ pushd <whereever-you-plan-to-build-llvm>
$ git clone https://github.com/llvm-project/llvm-project/
$ cd llvm-project
$ mkdir build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS=lld -DCMAKE_INSTALL_PREFIX=/usr/local ../llvm-project/llvm
$ make install
5) Now type the cc line which failed to link using xargo, replacing
ld.lld, removing all the
-Wl,... switches and adding the switches @japaric supplied above. I retained all the
-o switches. In my case the result was: (note all the local path prefixes below--you'll need to change these to wherever your system has placed these files)
$ <whereever-you-built-llvm>/llvm-project/build/bin/ld.lld --gc-sections "--as-needed" "--build-id=none" "-z,noexecstack" "-static" "-L" "/Users/bRad/.xargo/lib/rustlib/armv7-unknown-linux-steedeabihf/lib" "/Users/bRad/Development/toolchains/rust/hello/target/armv7-unknown-linux-steedeabihf/debug/deps/hello-0991cfa18062d722.0.o" "-o" "/Users/bRad/Development/toolchains/rust/hello/target/armv7-unknown-linux-steedeabihf/debug/hello" "-L" "/Users/bRad/Development/toolchains/rust/hello/target/armv7-unknown-linux-steedeabihf/debug/deps" "-L" "/Users/bRad/Development/toolchains/rust/hello/target/debug/deps" "-L" "/Users/bRad/.xargo/lib/rustlib/armv7-unknown-linux-steedeabihf/lib" "/Users/bRad/.xargo/lib/rustlib/armv7-unknown-linux-steedeabihf/lib/libstd-bb40cc9c3579a09c.rlib" "/Users/bRad/.xargo/lib/rustlib/armv7-unknown-linux-steedeabihf/lib/libcollections-ea247e9941d76447.rlib" "/Users/bRad/.xargo/lib/rustlib/armv7-unknown-linux-steedeabihf/lib/liballoc-8822446a17c83f7f.rlib" "/Users/bRad/.xargo/lib/rustlib/armv7-unknown-linux-steedeabihf/lib/libralloc-214b72e3110676fc.rlib" "/Users/bRad/.xargo/lib/rustlib/armv7-unknown-linux-steedeabihf/lib/librand-8fa86f69e7373826.rlib" "/Users/bRad/.xargo/lib/rustlib/armv7-unknown-linux-steedeabihf/lib/libstd_unicode-804e7337c69564ad.rlib" "/Users/bRad/.xargo/lib/rustlib/armv7-unknown-linux-steedeabihf/lib/libralloc_shim-094a5847d31d0a1d.rlib" "/Users/bRad/.xargo/lib/rustlib/armv7-unknown-linux-steedeabihf/lib/libsc-979258bc38534d78.rlib" "/Users/bRad/.xargo/lib/rustlib/armv7-unknown-linux-steedeabihf/lib/libcore-89b19dcb9372380f.rlib" "/Users/bRad/.xargo/lib/rustlib/armv7-unknown-linux-steedeabihf/lib/libcompiler_builtins-1f18d4142a8b01da.rlib"
scp ./target/armv7-unknown-linux-steedeabihf/debug/hello rpi: #(or your-raspberry pi device/ip)
ssh rpi #(or your raspberry pi device/ip)
From the Raspberry Pi:
bRad@rpi:~ $ ./hello
This is so exciting in many ways! Thank you for your help, @japaric! And I'll be in touch soon re: a good place for a Rust newb like me to help with steed.