Skip to content

Commit 522aa5e

Browse files
committed
Auto merge of #50813 - paoloteti:cortex-r, r=alexcrichton
Add target for Big-endian ARM Cortex-R4F/R5F MCUs The ARM Real-Time (‘R’) profile provides high-performing processors for safety-critical environments. Cortex-R has ARM, Thumb instruction whereas Cortex-M makes use of Thumb only. CI/Dockerfile is intentionally in the `disabled` folder.
2 parents 21ea121 + 4897093 commit 522aa5e

File tree

4 files changed

+79
-0
lines changed

4 files changed

+79
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
FROM ubuntu:16.04
2+
3+
RUN apt-get update && apt-get install -y --no-install-recommends \
4+
g++ \
5+
make \
6+
file \
7+
curl \
8+
ca-certificates \
9+
python2.7 \
10+
git \
11+
cmake \
12+
sudo \
13+
xz-utils \
14+
bzip2 \
15+
libssl-dev \
16+
pkg-config
17+
18+
19+
COPY scripts/sccache.sh /scripts/
20+
RUN sh /scripts/sccache.sh
21+
22+
ENV BASE_URL=https://releases.linaro.org/components/toolchain/binaries/latest/armeb-eabi/
23+
ENV GCC_LINARO=gcc-linaro-7.2.1-2017.11-x86_64_armeb-eabi
24+
25+
RUN curl -sL $BASE_URL/$GCC_LINARO.tar.xz | tar -xJ
26+
27+
ENV PATH=$PATH:/$GCC_LINARO/bin
28+
29+
ENV TARGET=armebv7r-none-eabihf
30+
31+
ENV CC_armebv7r_none_eabihf=armeb-eabi-gcc \
32+
CFLAGS_armebv7r_none_eabihf="-march=armv7-r"
33+
34+
ENV RUST_CONFIGURE_ARGS --disable-docs
35+
36+
ENV SCRIPT python2.7 ../x.py dist --target $TARGET
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// Targets the Cortex-R4F/R5F processor (ARMv7-R)
12+
13+
use std::default::Default;
14+
use spec::{LinkerFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
15+
16+
pub fn target() -> TargetResult {
17+
Ok(Target {
18+
llvm_target: "armebv7r-none-eabihf".to_string(),
19+
target_endian: "big".to_string(),
20+
target_pointer_width: "32".to_string(),
21+
target_c_int_width: "32".to_string(),
22+
data_layout: "E-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
23+
arch: "arm".to_string(),
24+
target_os: "none".to_string(),
25+
target_env: "".to_string(),
26+
target_vendor: "".to_string(),
27+
linker_flavor: LinkerFlavor::Gcc,
28+
29+
options: TargetOptions {
30+
executables: true,
31+
relocation_model: "static".to_string(),
32+
panic_strategy: PanicStrategy::Abort,
33+
features: "+v7,+vfp3,+d16,+fp-only-sp".to_string(),
34+
max_atomic_width: Some(32),
35+
abi_blacklist: super::arm_base::abi_blacklist(),
36+
emit_debug_gdb_scripts: false,
37+
.. Default::default()
38+
},
39+
})
40+
}

src/librustc_target/spec/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,8 @@ supported_targets! {
342342
("armv7-apple-ios", armv7_apple_ios),
343343
("armv7s-apple-ios", armv7s_apple_ios),
344344

345+
("armebv7r-none-eabihf", armebv7r_none_eabihf),
346+
345347
("x86_64-sun-solaris", x86_64_sun_solaris),
346348
("sparcv9-sun-solaris", sparcv9_sun_solaris),
347349

src/tools/build-manifest/src/main.rs

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ static TARGETS: &'static [&'static str] = &[
6363
"armv7-unknown-cloudabi-eabihf",
6464
"armv7-unknown-linux-gnueabihf",
6565
"armv7-unknown-linux-musleabihf",
66+
"armebv7r-none-eabihf",
6667
"armv7s-apple-ios",
6768
"asmjs-unknown-emscripten",
6869
"i386-apple-ios",

0 commit comments

Comments
 (0)