about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/bootstrap/configure.py2
-rw-r--r--src/ci/docker/dist-armv5te-linux-musl/Dockerfile47
-rw-r--r--src/librustc_target/spec/armv5te_unknown_linux_musl.rs38
-rw-r--r--src/librustc_target/spec/mod.rs1
-rw-r--r--src/tools/build-manifest/src/main.rs1
5 files changed, 89 insertions, 0 deletions
diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py
index a0123da6d8f..54b6526c5c8 100755
--- a/src/bootstrap/configure.py
+++ b/src/bootstrap/configure.py
@@ -120,6 +120,8 @@ v("musl-root-arm", "target.arm-unknown-linux-musleabi.musl-root",
   "arm-unknown-linux-musleabi install directory")
 v("musl-root-armhf", "target.arm-unknown-linux-musleabihf.musl-root",
   "arm-unknown-linux-musleabihf install directory")
+v("musl-root-armv5te", "target.armv5te-unknown-linux-musl.musl-root",
+  "armv5te-unknown-linux-musleabi install directory")
 v("musl-root-armv7", "target.armv7-unknown-linux-musleabihf.musl-root",
   "armv7-unknown-linux-musleabihf install directory")
 v("musl-root-aarch64", "target.aarch64-unknown-linux-musl.musl-root",
diff --git a/src/ci/docker/dist-armv5te-linux-musl/Dockerfile b/src/ci/docker/dist-armv5te-linux-musl/Dockerfile
new file mode 100644
index 00000000000..42eaebcc3db
--- /dev/null
+++ b/src/ci/docker/dist-armv5te-linux-musl/Dockerfile
@@ -0,0 +1,47 @@
+FROM ubuntu:16.04
+
+RUN apt-get update && apt-get install -y --no-install-recommends \
+  g++ \
+  make \
+  file \
+  curl \
+  ca-certificates \
+  python2.7 \
+  git \
+  cmake \
+  sudo \
+  xz-utils \
+  zlib1g-dev \
+  g++-arm-linux-gnueabi \
+  bzip2 \
+  patch \
+  pkg-config
+
+WORKDIR /build
+
+# Suppress some warnings in the openwrt toolchains we downloaded
+ENV STAGING_DIR=/tmp
+
+COPY scripts/musl.sh /build
+RUN env \
+    CC=arm-linux-gnueabi-gcc CFLAGS="-march=armv5te -marm -mfloat-abi=soft" \
+    CXX=arm-linux-gnueabi-g++ CXXFLAGS="-march=armv5te -marm -mfloat-abi=soft" \
+    bash musl.sh armv5te && \
+    rm -rf /build/*
+
+ENV TARGETS=armv5te-unknown-linux-musl
+
+# FIXME: remove armv5te vars after https://github.com/alexcrichton/cc-rs/issues/271
+#        get fixed and cc update
+ENV CC_armv5te_unknown_linux_musl=arm-linux-gnueabi-gcc \
+    CFLAGS_armv5te_unknown_linux_musl="-march=armv5te -marm -mfloat-abi=soft"
+
+ENV RUST_CONFIGURE_ARGS \
+      --musl-root-armv5te=/musl-armv5te \
+      --disable-docs
+
+ENV SCRIPT python2.7 ../x.py dist --target $TARGETS
+
+# sccache
+COPY scripts/sccache.sh /scripts/
+RUN sh /scripts/sccache.sh
diff --git a/src/librustc_target/spec/armv5te_unknown_linux_musl.rs b/src/librustc_target/spec/armv5te_unknown_linux_musl.rs
new file mode 100644
index 00000000000..2d4e95ab01d
--- /dev/null
+++ b/src/librustc_target/spec/armv5te_unknown_linux_musl.rs
@@ -0,0 +1,38 @@
+// Copyright 2018 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.
+
+use spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+    let base = super::linux_musl_base::opts();
+    Ok(Target {
+        // It's important we use "gnueabihf" and not "musleabihf" here. LLVM
+        // uses it to determine the calling convention and float ABI, and LLVM
+        // doesn't support the "musleabihf" value.
+        llvm_target: "armv5te-unknown-linux-gnueabi".to_string(),
+        target_endian: "little".to_string(),
+        target_pointer_width: "32".to_string(),
+        target_c_int_width: "32".to_string(),
+        data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+        arch: "arm".to_string(),
+        target_os: "linux".to_string(),
+        target_env: "musl".to_string(),
+        target_vendor: "unknown".to_string(),
+        linker_flavor: LinkerFlavor::Gcc,
+
+        options: TargetOptions {
+            features: "+soft-float,+strict-align".to_string(),
+            // Atomic operations provided by compiler-builtins
+            max_atomic_width: Some(32),
+            abi_blacklist: super::arm_base::abi_blacklist(),
+            .. base
+        }
+    })
+}
diff --git a/src/librustc_target/spec/mod.rs b/src/librustc_target/spec/mod.rs
index 1e94f037885..e4071b316c1 100644
--- a/src/librustc_target/spec/mod.rs
+++ b/src/librustc_target/spec/mod.rs
@@ -283,6 +283,7 @@ supported_targets! {
     ("arm-unknown-linux-musleabihf", arm_unknown_linux_musleabihf),
     ("armv4t-unknown-linux-gnueabi", armv4t_unknown_linux_gnueabi),
     ("armv5te-unknown-linux-gnueabi", armv5te_unknown_linux_gnueabi),
+    ("armv5te-unknown-linux-musl", armv5te_unknown_linux_musl),
     ("armv7-unknown-linux-gnueabihf", armv7_unknown_linux_gnueabihf),
     ("armv7-unknown-linux-musleabihf", armv7_unknown_linux_musleabihf),
     ("aarch64-unknown-linux-gnu", aarch64_unknown_linux_gnu),
diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs
index 9f238929215..ba5bb45d767 100644
--- a/src/tools/build-manifest/src/main.rs
+++ b/src/tools/build-manifest/src/main.rs
@@ -57,6 +57,7 @@ static TARGETS: &'static [&'static str] = &[
     "arm-unknown-linux-musleabi",
     "arm-unknown-linux-musleabihf",
     "armv5te-unknown-linux-gnueabi",
+    "armv5te-unknown-linux-musl",
     "armv7-apple-ios",
     "armv7-linux-androideabi",
     "armv7-unknown-cloudabi-eabihf",