Skip to content

Commit 7c1723c

Browse files
paolotetijaparic
authored andcommitted
Add target for Little-endian ARM Cortex-R4F/R5F MCUs
Similar to `armebv7r-none-eabihf`, but for Little-endian MCUs. As example TI RM4x/RM5x are Little-endian Cortex-R4F/R5F MCUs. CI/Dockerfile is intentionally in the disabled folder.
1 parent 6916385 commit 7c1723c

File tree

4 files changed

+76
-0
lines changed

4 files changed

+76
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
# GNU Arm Embedded Toolchain 7-2018-q2-update (June 27,2018)
23+
ENV BASE_URL=https://developer.arm.com/-/media/Files/downloads/gnu-rm/
24+
RUN curl -L $BASE_URL/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2 | tar -xj
25+
ENV PATH=$PATH:/gcc-arm-none-eabi-7-2018-q2-update/bin
26+
27+
ENV TARGET=armv7r-none-eabihf
28+
29+
ENV CC_armv7r_none_eabihf=arm-none-eabi-gcc \
30+
CFLAGS_armv7r_none_eabihf="-march=armv7-r"
31+
32+
ENV RUST_CONFIGURE_ARGS --disable-docs
33+
34+
ENV SCRIPT python2.7 ../x.py dist --target $TARGET
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Copyright 2018 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 Little-endian 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: "armv7r-none-eabihf".to_string(),
19+
target_endian: "little".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: "+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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ supported_targets! {
371371
("armv7s-apple-ios", armv7s_apple_ios),
372372

373373
("armebv7r-none-eabihf", armebv7r_none_eabihf),
374+
("armv7r-none-eabihf", armv7r_none_eabihf),
374375

375376
("x86_64-sun-solaris", x86_64_sun_solaris),
376377
("sparcv9-sun-solaris", sparcv9_sun_solaris),

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ static TARGETS: &'static [&'static str] = &[
6464
"armv7-unknown-linux-gnueabihf",
6565
"armv7-unknown-linux-musleabihf",
6666
"armebv7r-none-eabihf",
67+
"armv7r-none-eabihf",
6768
"armv7s-apple-ios",
6869
"asmjs-unknown-emscripten",
6970
"i386-apple-ios",

0 commit comments

Comments
 (0)