-
-
Save loyd/185c8fa9b34d3dc5e143 to your computer and use it in GitHub Desktop.
Workaround for cross compiling with rust (rustc, cargo, etc.).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| RUST=~/builds/pi-rust | |
| TOOLCHAIN=~/builds/pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64 | |
| LINKER=arm-linux-gnueabihf-gcc | |
| # Rust uses `cc` as linker. | |
| if [ ! -f "$TOOLCHAIN/bin/cc" ]; then | |
| ln -s "$LINKER" "$TOOLCHAIN/bin/cc" | |
| fi | |
| # Usage. | |
| if [ $# -eq 0 ]; then | |
| echo "Usage:" | |
| echo " $(basename $0) cargo ..." | |
| for i in $(ls "$RUST/bin"); do | |
| echo " $(basename $0) $i ..." | |
| done | |
| exit 1; | |
| fi | |
| export LD_LIBRARY_PATH="$RUST/lib:$LD_LIBRARY_PATH" | |
| export PATH="$TOOLCHAIN/bin:$RUST/bin:$PATH" | |
| "$@" --target=arm-unknown-linux-gnueabihf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment