Add armv5te-unknown-linux-musl target

This commit is contained in:
Harm Berntsen 2018-05-03 14:35:59 +02:00
parent 698b956a9f
commit b71f6364d2
No known key found for this signature in database
GPG Key ID: 7D2B8FD751A61CD7
5 changed files with 89 additions and 0 deletions

View File

@ -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",

View File

@ -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

View File

@ -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
}
})
}

View File

@ -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),

View File

@ -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",