Merge pull request #40 from snobu/master
Added ARMhf target. This is out of scope, but I'd love to use Rust on the Raspberry Pi, too, so let's merge it. :-)
This commit is contained in:
commit
32a8d3818d
|
@ -27,6 +27,7 @@ RUN apt-get update && \
|
|||
pkgconf \
|
||||
sudo \
|
||||
xutils-dev \
|
||||
gcc-4.7-multilib-arm-linux-gnueabihf \
|
||||
&& \
|
||||
apt-get clean && rm -rf /var/lib/apt/lists/* && \
|
||||
useradd rust --user-group --create-home --shell /bin/bash --groups sudo
|
||||
|
@ -50,7 +51,8 @@ ENV PATH=/home/rust/.cargo/bin:/usr/local/musl/bin:/usr/local/sbin:/usr/local/bi
|
|||
# manually.
|
||||
RUN curl https://sh.rustup.rs -sSf | \
|
||||
sh -s -- -y --default-toolchain $TOOLCHAIN && \
|
||||
rustup target add x86_64-unknown-linux-musl
|
||||
rustup target add x86_64-unknown-linux-musl && \
|
||||
rustup target add armv7-unknown-linux-gnueabihf
|
||||
ADD cargo-config.toml /home/rust/.cargo/config
|
||||
|
||||
# Set up a `git credentials` helper for using GH_USER and GH_TOKEN to access
|
||||
|
|
|
@ -9,6 +9,11 @@ alias rust-musl-builder='docker run --rm -it -v "$(pwd)":/home/rust/src ekidd/ru
|
|||
rust-musl-builder cargo build --release
|
||||
```
|
||||
|
||||
To target ARM hard float (Raspberry Pi):
|
||||
```sh
|
||||
rust-musl-builder cargo build --target=armv7-unknown-linux-gnueabihf --release
|
||||
```
|
||||
|
||||
This command assumes that `$(pwd)` is readable and writable by uid 1000, gid 1000. It will output binaries in `target/x86_64-unknown-linux-musl/release`. At the moment, it doesn't attempt to cache libraries between builds, so this is best reserved for making final release builds.
|
||||
|
||||
## Deploying your Rust application
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
[build]
|
||||
# Target musl-libc by default when running Cargo.
|
||||
target = "x86_64-unknown-linux-musl"
|
||||
|
||||
[target.armv7-unknown-linux-gnueabihf]
|
||||
linker = "arm-linux-gnueabihf-gcc-4.7"
|
||||
|
|
Loading…
Reference in a new issue