Skip to content

Commit

Permalink
add support for arm-unknown-linux-gnueabihf
Browse files Browse the repository at this point in the history
Closes #155 .
  • Loading branch information
gnzlbg committed Nov 14, 2017
1 parent c32c3a6 commit b0cadd1
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ matrix:
# Linux
- env: TARGET=aarch64-unknown-linux-gnu CPP=1 DYLIB=1 STD=1 OPENSSL=0.5.5 RUN=1
- env: TARGET=arm-unknown-linux-gnueabi CPP=1 DYLIB=1 STD=1 OPENSSL=0.5.5 RUN=1
- env: TARGET=arm-unknown-linux-gnueabihf CPP=1 DYLIB=1 STD=1 OPENSSL=0.5.5 RUN=1
- env: TARGET=arm-unknown-linux-musleabi STD=1 RUN=1
- env: TARGET=armv7-unknown-linux-gnueabihf CPP=1 DYLIB=1 STD=1 OPENSSL=0.5.5 RUN=1
- env: TARGET=armv7-unknown-linux-musleabihf STD=1 RUN=1
- env: TARGET=i586-unknown-linux-gnu CPP=1 DYLIB=1 STD=1 OPENSSL=0.5.5 RUN=1
- env: TARGET=i686-unknown-linux-gnu CPP=1 DYLIB=1 STD=1 OPENSSL=0.5.5 RUN=1
- env: TARGET=i686-unknown-linux-musl STD=1 OPENSSL=0.5.5 RUN=1
- env: TARGET=mips-unknown-linux-gnu CPP=1 DYLIB=1 STD=1 OPENSSL=0.5.5 RUN=1
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

- Add support for the `i586-unknown-linux-gnu` target.
- Add support for the `arm-unknown-linux-gnueabihf` target.

## [v0.1.13] - 2017-11-08

### Added
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,13 @@ worst, "hang" (never terminate).
| `aarch64-unknown-linux-gnu` | 2.19 | 4.8.2 | 1.0.2m || 2.8.0 ||
| `arm-linux-androideabi` [5] | N/A | 4.9 | 1.0.2m || N/A ||
| `arm-unknown-linux-gnueabi` | 2.19 | 4.8.2 | 1.0.2m || 2.8.0 ||
| `arm-unknown-linux-gnueabihf` | 2.19 | 4.8.2 | 1.0.2m || 2.8.0 ||
| `arm-unknown-linux-musleabi` | 1.1.15 | 5.3.1 | N/A | | 2.8.0 ||
| `armv7-linux-androideabi` [5] | N/A | 4.9 | 1.0.2m || N/A ||
| `armv7-unknown-linux-gnueabihf` | 2.15 | 4.6.2 | 1.0.2m || 2.8.0 ||
| `armv7-unknown-linux-musleabihf` | 1.1.15 | 5.3.1 | N/A | | 2.8.0 ||
| `asmjs-unknown-emscripten` [4] | 1.1.15 | 1.37.13 | N/A || N/A ||
| `i586-unknown-linux-gnu` | 2.15 | 4.6.2 | 1.0.2m || N/A ||
| `i686-linux-android` [5] | N/A | 4.9 | 1.0.2m || N/A ||
| `i686-pc-windows-gnu` | N/A | 6.2.0 | N/A || N/A ||
| `i686-unknown-freebsd` [1] | 10.2 | 5.3.0 | 1.0.2m | | N/A | |
Expand Down
30 changes: 30 additions & 0 deletions docker/arm-unknown-linux-gnueabihf/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM ubuntu:14.04

RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
cmake \
gcc \
libc6-dev \
make \
pkg-config

COPY xargo.sh /
RUN bash /xargo.sh

COPY openssl.sh qemu.sh /
RUN apt-get install -y --no-install-recommends \
g++-arm-linux-gnueabihf \
libc6-dev-armhf-cross && \
bash /openssl.sh linux-armv4 arm-linux-gnueabihf- && \
bash /qemu.sh arm

ENV CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABI_LINKER=arm-linux-gnueabihf-gcc \
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABI_RUNNER=qemu-arm \
CC_arm_unknown_linux_gnueabi=arm-linux-gnueabihf-gcc \
CXX_arm_unknown_linux_gnueabi=arm-linux-gnueabihf-g++ \
OPENSSL_DIR=/openssl \
OPENSSL_INCLUDE_DIR=/openssl/include \
OPENSSL_LIB_DIR=/openssl/lib \
QEMU_LD_PREFIX=/usr/arm-linux-gnueabihf \
RUST_TEST_THREADS=1
26 changes: 26 additions & 0 deletions docker/i586-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM ubuntu:12.04

RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
cmake \
gcc \
libc6-dev \
make \
pkg-config

COPY xargo.sh /
RUN bash /xargo.sh

COPY cmake.sh /
RUN apt-get purge --auto-remove -y cmake && \
bash /cmake.sh 2.8.11

COPY openssl.sh /
RUN apt-get install -y --no-install-recommends \
g++-multilib && \
bash /openssl.sh linux-elf "" -m32

ENV OPENSSL_DIR=/openssl \
OPENSSL_INCLUDE_DIR=/openssl/include \
OPENSSL_LIB_DIR=/openssl/lib
9 changes: 9 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,11 @@ pub enum Target {
// Linux
Aarch64UnknownLinuxGnu,
ArmUnknownLinuxGnueabi,
ArmUnknownLinuxGnueabihf,
ArmUnknownLinuxMusleabi,
Armv7UnknownLinuxGnueabihf,
Armv7UnknownLinuxMusleabihf,
I586UnknownLinuxGnu,
I686UnknownLinuxGnu,
I686UnknownLinuxMusl,
Mips64UnknownLinuxGnuabi64,
Expand Down Expand Up @@ -196,9 +198,11 @@ impl Target {
match *self {
Target::Aarch64UnknownLinuxGnu |
Target::ArmUnknownLinuxGnueabi |
Target::ArmUnknownLinuxGnueabihf |
Target::ArmUnknownLinuxMusleabi |
Target::Armv7UnknownLinuxGnueabihf |
Target::Armv7UnknownLinuxMusleabihf |
Target::I586UnknownLinuxGnu |
Target::I686UnknownLinuxGnu |
Target::I686UnknownLinuxMusl |
Target::Mips64UnknownLinuxGnuabi64 |
Expand Down Expand Up @@ -236,6 +240,7 @@ impl Target {
!triple.starts_with("i586") &&
!triple.starts_with("i686")
}
Target::I586UnknownLinuxGnu |
Target::I686UnknownLinuxGnu |
Target::I686UnknownLinuxMusl |
Target::X86_64UnknownLinuxGnu |
Expand All @@ -257,11 +262,13 @@ impl Target {
Aarch64UnknownLinuxGnu => "aarch64-unknown-linux-gnu",
ArmLinuxAndroideabi => "arm-linux-androideabi",
ArmUnknownLinuxGnueabi => "arm-unknown-linux-gnueabi",
ArmUnknownLinuxGnueabihf => "arm-unknown-linux-gnueabihf",
ArmUnknownLinuxMusleabi => "arm-unknown-linux-musleabi",
Armv7LinuxAndroideabi => "armv7-linux-androideabi",
Armv7UnknownLinuxGnueabihf => "armv7-unknown-linux-gnueabihf",
Armv7UnknownLinuxMusleabihf => "armv7-unknown-linux-musleabihf",
AsmjsUnknownEmscripten => "asmjs-unknown-emscripten",
I586UnknownLinuxGnu => "i586-unknown-linux-gnu",
I686AppleDarwin => "i686-apple-darwin",
I686LinuxAndroid => "i686-linux-android",
I686PcWindowsGnu => "i686-pc-windows-gnu",
Expand Down Expand Up @@ -309,11 +316,13 @@ impl Target {
"aarch64-unknown-linux-gnu" => Aarch64UnknownLinuxGnu,
"arm-linux-androideabi" => ArmLinuxAndroideabi,
"arm-unknown-linux-gnueabi" => ArmUnknownLinuxGnueabi,
"arm-unknown-linux-gnueabihf" => ArmUnknownLinuxGnueabihf,
"arm-unknown-linux-musleabi" => ArmUnknownLinuxMusleabi,
"armv7-linux-androideabi" => Armv7LinuxAndroideabi,
"armv7-unknown-linux-gnueabihf" => Armv7UnknownLinuxGnueabihf,
"armv7-unknown-linux-musleabihf" => Armv7UnknownLinuxMusleabihf,
"asmjs-unknown-emscripten" => AsmjsUnknownEmscripten,
"i586-unknown-linux-gnu" => I586UnknownLinuxGnu,
"i686-apple-darwin" => I686AppleDarwin,
"i686-linux-android" => I686LinuxAndroid,
"i686-pc-windows-gnu" => I686PcWindowsGnu,
Expand Down

0 comments on commit b0cadd1

Please sign in to comment.