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 15, 2017
2 parents c32c3a6 + 3115d90 commit 5ae8b2b
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ 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
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
35 changes: 35 additions & 0 deletions docker/arm-unknown-linux-gnueabihf/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM ubuntu:14.04

RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
cmake \
gcc \
libc6-dev \
make \
curl \
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 5ae8b2b

Please sign in to comment.