Skip to content

Commit

Permalink
Auto merge of #158 - gnzlbg:armhf, r=<try>
Browse files Browse the repository at this point in the history
add support for arm-unknown-linux-gnueabihf
  • Loading branch information
homunkulus committed Nov 16, 2017
2 parents c32c3a6 + 46b39f8 commit 0188f14
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 41 deletions.
83 changes: 42 additions & 41 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,64 +7,65 @@ sudo: required
matrix:
include:
# 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-musleabi STD=1 RUN=1
# - 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=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
- env: TARGET=mips64-unknown-linux-gnuabi64 CPP=1 DYLIB=1 STD=1 OPENSSL=0.7.17 RUN=1
- env: TARGET=mips64el-unknown-linux-gnuabi64 CPP=1 DYLIB=1 STD=1 OPENSSL=0.7.17 RUN=1
- env: TARGET=mipsel-unknown-linux-gnu CPP=1 DYLIB=1 STD=1 OPENSSL=0.5.5 RUN=1
- env: TARGET=powerpc-unknown-linux-gnu CPP=1 DYLIB=1 STD=1 OPENSSL=0.5.5 RUN=1
- env: TARGET=powerpc64-unknown-linux-gnu CPP=1 DYLIB=1 STD=1 OPENSSL=0.7.17 RUN=1
- env: TARGET=powerpc64le-unknown-linux-gnu CPP=1 DYLIB=1 STD=1 OPENSSL=0.7.17 RUN=1
- env: TARGET=s390x-unknown-linux-gnu CPP=1 DYLIB=1 STD=1 OPENSSL=0.7.17
- env: TARGET=sparc64-unknown-linux-gnu CPP=1 DYLIB=1 OPENSSL=0.5.5 RUN=1
- env: TARGET=x86_64-unknown-linux-gnu CPP=1 DYLIB=1 OPENSSL=0.5.5 RUN=1 DEPLOY=1
- env: TARGET=x86_64-unknown-linux-musl STD=1 OPENSSL=0.5.5 RUN=1 DEPLOY=1
# - env: TARGET=armv7-unknown-linux-musleabihf STD=1 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
# - env: TARGET=mips64-unknown-linux-gnuabi64 CPP=1 DYLIB=1 STD=1 OPENSSL=0.7.17 RUN=1
# - env: TARGET=mips64el-unknown-linux-gnuabi64 CPP=1 DYLIB=1 STD=1 OPENSSL=0.7.17 RUN=1
# - env: TARGET=mipsel-unknown-linux-gnu CPP=1 DYLIB=1 STD=1 OPENSSL=0.5.5 RUN=1
# - env: TARGET=powerpc-unknown-linux-gnu CPP=1 DYLIB=1 STD=1 OPENSSL=0.5.5 RUN=1
# - env: TARGET=powerpc64-unknown-linux-gnu CPP=1 DYLIB=1 STD=1 OPENSSL=0.7.17 RUN=1
# - env: TARGET=powerpc64le-unknown-linux-gnu CPP=1 DYLIB=1 STD=1 OPENSSL=0.7.17 RUN=1
# - env: TARGET=s390x-unknown-linux-gnu CPP=1 DYLIB=1 STD=1 OPENSSL=0.7.17
# - env: TARGET=sparc64-unknown-linux-gnu CPP=1 DYLIB=1 OPENSSL=0.5.5 RUN=1
# - env: TARGET=x86_64-unknown-linux-gnu CPP=1 DYLIB=1 OPENSSL=0.5.5 RUN=1 DEPLOY=1
# - env: TARGET=x86_64-unknown-linux-musl STD=1 OPENSSL=0.5.5 RUN=1 DEPLOY=1

# Android
- env: TARGET=aarch64-linux-android CPP=1 STD=1 OPENSSL=0.5.5 RUN=1
- env: TARGET=arm-linux-androideabi CPP=1 STD=1 OPENSSL=0.5.5 RUN=1
- env: TARGET=armv7-linux-androideabi CPP=1 STD=1 OPENSSL=0.5.5 RUN=1
# - env: TARGET=aarch64-linux-android CPP=1 STD=1 OPENSSL=0.5.5 RUN=1
# - env: TARGET=arm-linux-androideabi CPP=1 STD=1 OPENSSL=0.5.5 RUN=1
# - env: TARGET=armv7-linux-androideabi CPP=1 STD=1 OPENSSL=0.5.5 RUN=1
# NOTE RUN=1 missing due to issue #143
- env: TARGET=i686-linux-android CPP=1 STD=1 OPENSSL=0.5.5
- env: TARGET=x86_64-linux-android CPP=1 STD=1 OPENSSL=0.5.5 RUN=1
# - env: TARGET=i686-linux-android CPP=1 STD=1 OPENSSL=0.5.5
# - env: TARGET=x86_64-linux-android CPP=1 STD=1 OPENSSL=0.5.5 RUN=1

# OSX
- env: TARGET=i686-apple-darwin DYLIB=1 STD=1 RUN=1
os: osx
- env: TARGET=x86_64-apple-darwin DYLIB=1 STD=1 RUN=1 DEPLOY=1
os: osx
# - env: TARGET=i686-apple-darwin DYLIB=1 STD=1 RUN=1
# os: osx
# - env: TARGET=x86_64-apple-darwin DYLIB=1 STD=1 RUN=1 DEPLOY=1
# os: osx

# BSD
- env: TARGET=i686-unknown-freebsd DYLIB=1 STD=1 OPENSSL=0.7.17
- env: TARGET=x86_64-unknown-dragonfly DYLIB=1 OPENSSL=0.5.5
- env: TARGET=x86_64-unknown-freebsd DYLIB=1 STD=1 OPENSSL=0.5.5
- env: TARGET=x86_64-unknown-netbsd DYLIB=1 STD=1 OPENSSL=0.7.17
# - env: TARGET=i686-unknown-freebsd DYLIB=1 STD=1 OPENSSL=0.7.17
# - env: TARGET=x86_64-unknown-dragonfly DYLIB=1 OPENSSL=0.5.5
# - env: TARGET=x86_64-unknown-freebsd DYLIB=1 STD=1 OPENSSL=0.5.5
# - env: TARGET=x86_64-unknown-netbsd DYLIB=1 STD=1 OPENSSL=0.7.17

# Solaris
- env: TARGET=sparcv9-sun-solaris DYLIB=1 STD=1 OPENSSL=0.7.17
- env: TARGET=x86_64-sun-solaris DYLIB=1 STD=1 OPENSSL=0.7.17
# - env: TARGET=sparcv9-sun-solaris DYLIB=1 STD=1 OPENSSL=0.7.17
# - env: TARGET=x86_64-sun-solaris DYLIB=1 STD=1 OPENSSL=0.7.17

# Windows
- env: TARGET=x86_64-pc-windows-gnu CPP=1 STD=1 RUN=1
- env: TARGET=i686-pc-windows-gnu CPP=1 STD=1 RUN=1
# - env: TARGET=x86_64-pc-windows-gnu CPP=1 STD=1 RUN=1
# - env: TARGET=i686-pc-windows-gnu CPP=1 STD=1 RUN=1

# Emscripten
- env: TARGET=asmjs-unknown-emscripten CPP=1 STD=1 RUN=1
- env: TARGET=wasm32-unknown-emscripten CPP=1 STD=1 RUN=1
# - env: TARGET=asmjs-unknown-emscripten CPP=1 STD=1 RUN=1
# - env: TARGET=wasm32-unknown-emscripten CPP=1 STD=1 RUN=1
# work around rust-lang/cargo#4689
rust: nightly-2017-10-24
# rust: nightly-2017-10-24

# Bare metal
- env: TARGET=thumbv6m-none-eabi RUN=1
- env: TARGET=thumbv7em-none-eabi RUN=1
- env: TARGET=thumbv7em-none-eabihf RUN=1
- env: TARGET=thumbv7m-none-eabi RUN=1
# - env: TARGET=thumbv6m-none-eabi RUN=1
# - env: TARGET=thumbv7em-none-eabi RUN=1
# - env: TARGET=thumbv7em-none-eabihf RUN=1
# - env: TARGET=thumbv7m-none-eabi RUN=1

install:
- curl https://sh.rustup.rs -sSf |
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

- add support for arm-unknown-linux-gnueabihf

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

### Added
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ 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 ||
Expand Down
36 changes: 36 additions & 0 deletions docker/arm-unknown-linux-gnueabihf/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM ubuntu:14.04

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

COPY crosstool-ng.sh /
RUN bash /crosstool-ng.sh
ENV PATH=$PATH:/x-tools/arm-unknown-linux-gnueabi/bin

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
20 changes: 20 additions & 0 deletions docker/crosstool-ng.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2017 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.

set -ex

url="http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.22.0.tar.bz2"
curl -f $url | tar xjf -
cd crosstool-ng
./configure --prefix=/usr/local
make -j$(nproc)
make install
cd ..
rm -rf crosstool-ng
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ pub enum Target {
// Linux
Aarch64UnknownLinuxGnu,
ArmUnknownLinuxGnueabi,
ArmUnknownLinuxGnueabihf,
ArmUnknownLinuxMusleabi,
Armv7UnknownLinuxGnueabihf,
Armv7UnknownLinuxMusleabihf,
Expand Down Expand Up @@ -196,6 +197,7 @@ impl Target {
match *self {
Target::Aarch64UnknownLinuxGnu |
Target::ArmUnknownLinuxGnueabi |
Target::ArmUnknownLinuxGnueabihf |
Target::ArmUnknownLinuxMusleabi |
Target::Armv7UnknownLinuxGnueabihf |
Target::Armv7UnknownLinuxMusleabihf |
Expand Down Expand Up @@ -257,6 +259,7 @@ 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",
Expand Down Expand Up @@ -309,6 +312,7 @@ 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,
Expand Down

0 comments on commit 0188f14

Please sign in to comment.