Skip to content

Commit 7061b27

Browse files
committed
Auto merge of #53679 - japaric:cortex-r, r=alexcrichton
add more Cortex-R targets This expands on PR #53663 to complete the set of Cortex-R targets and builds rust-std components for them. r? @alexcrichton each extra rust-std component (there's 4 of them) takes about 3 minutes to build on my local machine. In terms of stability (LLVM codegen bugs) these new targets should be as stable as the Cortex-M ones (e.g. `thumbv7m-none-eabi`). If the extra build time is too much we can leave the rust-std components out for now closes #53663 cc @paoloteti
2 parents ec4a752 + 521df79 commit 7061b27

File tree

8 files changed

+139
-42
lines changed

8 files changed

+139
-42
lines changed

src/ci/docker/disabled/dist-armebv7r-none-eabihf/Dockerfile

-36
This file was deleted.

src/ci/docker/dist-various-1/Dockerfile

+7-2
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,16 @@ ENV TARGETS=$TARGETS,thumbv7m-none-eabi
103103
ENV TARGETS=$TARGETS,thumbv7em-none-eabi
104104
ENV TARGETS=$TARGETS,thumbv7em-none-eabihf
105105
ENV TARGETS=$TARGETS,riscv32imac-unknown-none-elf
106+
ENV TARGETS=$TARGETS,armebv7r-none-eabi
107+
ENV TARGETS=$TARGETS,armebv7r-none-eabihf
108+
ENV TARGETS=$TARGETS,armv7r-none-eabi
109+
ENV TARGETS=$TARGETS,armv7r-none-eabihf
106110

107111
ENV CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-gcc \
108112
CC_mips_unknown_linux_musl=mips-openwrt-linux-gcc \
109113
CC_sparc64_unknown_linux_gnu=sparc64-linux-gnu-gcc \
110-
CC_x86_64_unknown_redox=x86_64-unknown-redox-gcc
114+
CC_x86_64_unknown_redox=x86_64-unknown-redox-gcc \
115+
CC_armebv7r_none_eabi=arm-none-eabi-gcc
111116

112117
ENV RUST_CONFIGURE_ARGS \
113118
--musl-root-armv5te=/musl-armv5te \
@@ -120,7 +125,7 @@ ENV RUST_CONFIGURE_ARGS \
120125
--enable-emscripten \
121126
--disable-docs
122127

123-
ENV SCRIPT \
128+
ENV SCRIPT \
124129
python2.7 ../x.py test --target $RUN_MAKE_TARGETS src/test/run-make && \
125130
python2.7 ../x.py dist --target $TARGETS
126131

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 Big endian Cortex-R4/R5 processor (ARMv7-R)
12+
13+
use std::default::Default;
14+
use spec::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
15+
16+
pub fn target() -> TargetResult {
17+
Ok(Target {
18+
llvm_target: "armebv7r-unknown-none-eabi".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::Lld(LldFlavor::Ld),
28+
29+
options: TargetOptions {
30+
executables: true,
31+
linker: Some("rust-lld".to_owned()),
32+
relocation_model: "static".to_string(),
33+
panic_strategy: PanicStrategy::Abort,
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/armebv7r_none_eabihf.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
// Targets the Cortex-R4F/R5F processor (ARMv7-R)
1212

1313
use std::default::Default;
14-
use spec::{LinkerFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
14+
use spec::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
1515

1616
pub fn target() -> TargetResult {
1717
Ok(Target {
18-
llvm_target: "armebv7r-none-eabihf".to_string(),
18+
llvm_target: "armebv7r-unknown-none-eabihf".to_string(),
1919
target_endian: "big".to_string(),
2020
target_pointer_width: "32".to_string(),
2121
target_c_int_width: "32".to_string(),
@@ -24,13 +24,14 @@ pub fn target() -> TargetResult {
2424
target_os: "none".to_string(),
2525
target_env: String::new(),
2626
target_vendor: String::new(),
27-
linker_flavor: LinkerFlavor::Gcc,
27+
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
2828

2929
options: TargetOptions {
3030
executables: true,
31+
linker: Some("rust-lld".to_owned()),
3132
relocation_model: "static".to_string(),
3233
panic_strategy: PanicStrategy::Abort,
33-
features: "+v7,+vfp3,+d16,+fp-only-sp".to_string(),
34+
features: "+vfp3,+d16,+fp-only-sp".to_string(),
3435
max_atomic_width: Some(32),
3536
abi_blacklist: super::arm_base::abi_blacklist(),
3637
emit_debug_gdb_scripts: false,
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-R4/R5 processor (ARMv7-R)
12+
13+
use std::default::Default;
14+
use spec::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
15+
16+
pub fn target() -> TargetResult {
17+
Ok(Target {
18+
llvm_target: "armv7r-unknown-none-eabi".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::Lld(LldFlavor::Ld),
28+
29+
options: TargetOptions {
30+
executables: true,
31+
linker: Some("rust-lld".to_owned()),
32+
relocation_model: "static".to_string(),
33+
panic_strategy: PanicStrategy::Abort,
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+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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, LldFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
15+
16+
pub fn target() -> TargetResult {
17+
Ok(Target {
18+
llvm_target: "armv7r-unknown-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::Lld(LldFlavor::Ld),
28+
29+
options: TargetOptions {
30+
executables: true,
31+
linker: Some("rust-lld".to_owned()),
32+
relocation_model: "static".to_string(),
33+
panic_strategy: PanicStrategy::Abort,
34+
features: "+vfp3,+d16,+fp-only-sp".to_string(),
35+
max_atomic_width: Some(32),
36+
abi_blacklist: super::arm_base::abi_blacklist(),
37+
emit_debug_gdb_scripts: false,
38+
.. Default::default()
39+
},
40+
})
41+
}

src/librustc_target/spec/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,10 @@ supported_targets! {
370370
("armv7-apple-ios", armv7_apple_ios),
371371
("armv7s-apple-ios", armv7s_apple_ios),
372372

373+
("armebv7r-none-eabi", armebv7r_none_eabi),
373374
("armebv7r-none-eabihf", armebv7r_none_eabihf),
375+
("armv7r-none-eabi", armv7r_none_eabi),
376+
("armv7r-none-eabihf", armv7r_none_eabihf),
374377

375378
("x86_64-sun-solaris", x86_64_sun_solaris),
376379
("sparcv9-sun-solaris", sparcv9_sun_solaris),

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

+3
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ static TARGETS: &'static [&'static str] = &[
6363
"armv7-unknown-cloudabi-eabihf",
6464
"armv7-unknown-linux-gnueabihf",
6565
"armv7-unknown-linux-musleabihf",
66+
"armebv7r-none-eabi",
6667
"armebv7r-none-eabihf",
68+
"armv7r-none-eabi",
69+
"armv7r-none-eabihf",
6770
"armv7s-apple-ios",
6871
"asmjs-unknown-emscripten",
6972
"i386-apple-ios",

0 commit comments

Comments
 (0)