Skip to content

Commit f5abfb1

Browse files
committed
Auto merge of #68194 - jonas-schievink:fix-thumb-ci, r=alexcrichton
Fix CI for embedded ARM targets Closes #67018 It would be better to move the `thumb-none-cortex-m` test into the `cargotest` suite, but it doesn't seem to support cross-compilation.
2 parents 2f688ac + d022e01 commit f5abfb1

File tree

7 files changed

+229
-22
lines changed

7 files changed

+229
-22
lines changed

src/test/run-make/thumb-none-cortex-m/Makefile

+3-5
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@
1010
# - thumbv7em-none-eabihf (Bare Cortex-M4F, M7F, FPU, hardfloat)
1111
# - thumbv7m-none-eabi (Bare Cortex-M3)
1212

13-
# only-thumbv6m-none-eabi
14-
# only-thumbv7em-none-eabi
15-
# only-thumbv7em-none-eabihf
16-
# only-thumbv7m-none-eabi
13+
# only-thumb
1714

1815
# For cargo setting
1916
RUSTC := $(RUSTC_ORIGINAL)
@@ -27,7 +24,8 @@ CRATE := cortex-m
2724
CRATE_URL := https://github.com/rust-embedded/cortex-m
2825
CRATE_SHA1 := a448e9156e2cb1e556e5441fd65426952ef4b927 # 0.5.0
2926

30-
export RUSTFLAGS := --cap-lints=allow
27+
# Don't make lints fatal, but they need to at least warn or they break Cargo's target info parsing.
28+
export RUSTFLAGS := --cap-lints=warn
3129

3230
all:
3331
env

src/test/run-make/thumb-none-qemu/Makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
-include ../../run-make-fulldeps/tools.mk
22

3-
# only-thumbv7m-none-eabi
4-
# only-thumbv6m-none-eabi
3+
# only-thumb
54

65
# How to run this
76
# $ ./x.py clean

src/test/run-make/thumb-none-qemu/example/.cargo/config

+20-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
1-
[target.thumbv7m-none-eabi]
2-
# uncomment this to make `cargo run` execute programs on QEMU
1+
[target.thumbv6m-none-eabi]
2+
# FIXME: Should be Cortex-M0, but Qemu used by CI is too old
33
runner = "qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel"
44

5-
[target.thumbv6m-none-eabi]
6-
# uncomment this to make `cargo run` execute programs on QEMU
7-
# For now, we use cortex-m3 instead of cortex-m0 which are not supported by QEMU
5+
[target.thumbv7m-none-eabi]
86
runner = "qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel"
97

8+
[target.thumbv7em-none-eabi]
9+
runner = "qemu-system-arm -cpu cortex-m4 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel"
10+
11+
[target.thumbv7em-none-eabihf]
12+
runner = "qemu-system-arm -cpu cortex-m4 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel"
13+
14+
[target.thumbv8m.base-none-eabi]
15+
# FIXME: Should be the Cortex-M23, bt Qemu does not currently support it
16+
runner = "qemu-system-arm -cpu cortex-m33 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel"
17+
18+
[target.thumbv8m.main-none-eabi]
19+
runner = "qemu-system-arm -cpu cortex-m33 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel"
20+
21+
[target.thumbv8m.main-none-eabihf]
22+
runner = "qemu-system-arm -cpu cortex-m33 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel"
23+
1024
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
1125
# uncomment ONE of these three option to make `cargo run` start a GDB session
1226
# which option to pick depends on your system
@@ -28,4 +42,4 @@ rustflags = [
2842
# "-C", "linker=arm-none-eabi-gcc",
2943
# "-C", "link-arg=-Wl,-Tlink.x",
3044
# "-C", "link-arg=-nostartfiles",
31-
]
45+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
# This file is automatically @generated by Cargo.
2+
# It is not intended for manual editing.
3+
[[package]]
4+
name = "aligned"
5+
version = "0.3.2"
6+
source = "registry+https://github.com/rust-lang/crates.io-index"
7+
dependencies = [
8+
"as-slice 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
9+
]
10+
11+
[[package]]
12+
name = "as-slice"
13+
version = "0.1.2"
14+
source = "registry+https://github.com/rust-lang/crates.io-index"
15+
dependencies = [
16+
"generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)",
17+
"generic-array 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)",
18+
"stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
19+
]
20+
21+
[[package]]
22+
name = "bare-metal"
23+
version = "0.2.5"
24+
source = "registry+https://github.com/rust-lang/crates.io-index"
25+
dependencies = [
26+
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
27+
]
28+
29+
[[package]]
30+
name = "cortex-m"
31+
version = "0.6.2"
32+
source = "registry+https://github.com/rust-lang/crates.io-index"
33+
dependencies = [
34+
"aligned 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
35+
"bare-metal 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
36+
"volatile-register 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
37+
]
38+
39+
[[package]]
40+
name = "cortex-m-rt"
41+
version = "0.6.11"
42+
source = "registry+https://github.com/rust-lang/crates.io-index"
43+
dependencies = [
44+
"cortex-m-rt-macros 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
45+
"r0 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
46+
]
47+
48+
[[package]]
49+
name = "cortex-m-rt-macros"
50+
version = "0.1.7"
51+
source = "registry+https://github.com/rust-lang/crates.io-index"
52+
dependencies = [
53+
"proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
54+
"quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
55+
"syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)",
56+
]
57+
58+
[[package]]
59+
name = "cortex-m-semihosting"
60+
version = "0.3.5"
61+
source = "registry+https://github.com/rust-lang/crates.io-index"
62+
dependencies = [
63+
"cortex-m 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
64+
]
65+
66+
[[package]]
67+
name = "example"
68+
version = "0.1.0"
69+
dependencies = [
70+
"cortex-m 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
71+
"cortex-m-rt 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
72+
"cortex-m-semihosting 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
73+
"panic-halt 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
74+
]
75+
76+
[[package]]
77+
name = "generic-array"
78+
version = "0.12.3"
79+
source = "registry+https://github.com/rust-lang/crates.io-index"
80+
dependencies = [
81+
"typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
82+
]
83+
84+
[[package]]
85+
name = "generic-array"
86+
version = "0.13.2"
87+
source = "registry+https://github.com/rust-lang/crates.io-index"
88+
dependencies = [
89+
"typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
90+
]
91+
92+
[[package]]
93+
name = "panic-halt"
94+
version = "0.2.0"
95+
source = "registry+https://github.com/rust-lang/crates.io-index"
96+
97+
[[package]]
98+
name = "proc-macro2"
99+
version = "1.0.8"
100+
source = "registry+https://github.com/rust-lang/crates.io-index"
101+
dependencies = [
102+
"unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
103+
]
104+
105+
[[package]]
106+
name = "quote"
107+
version = "1.0.2"
108+
source = "registry+https://github.com/rust-lang/crates.io-index"
109+
dependencies = [
110+
"proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
111+
]
112+
113+
[[package]]
114+
name = "r0"
115+
version = "0.2.2"
116+
source = "registry+https://github.com/rust-lang/crates.io-index"
117+
118+
[[package]]
119+
name = "rustc_version"
120+
version = "0.2.3"
121+
source = "registry+https://github.com/rust-lang/crates.io-index"
122+
dependencies = [
123+
"semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
124+
]
125+
126+
[[package]]
127+
name = "semver"
128+
version = "0.9.0"
129+
source = "registry+https://github.com/rust-lang/crates.io-index"
130+
dependencies = [
131+
"semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
132+
]
133+
134+
[[package]]
135+
name = "semver-parser"
136+
version = "0.7.0"
137+
source = "registry+https://github.com/rust-lang/crates.io-index"
138+
139+
[[package]]
140+
name = "stable_deref_trait"
141+
version = "1.1.1"
142+
source = "registry+https://github.com/rust-lang/crates.io-index"
143+
144+
[[package]]
145+
name = "syn"
146+
version = "1.0.14"
147+
source = "registry+https://github.com/rust-lang/crates.io-index"
148+
dependencies = [
149+
"proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
150+
"quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
151+
"unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
152+
]
153+
154+
[[package]]
155+
name = "typenum"
156+
version = "1.11.2"
157+
source = "registry+https://github.com/rust-lang/crates.io-index"
158+
159+
[[package]]
160+
name = "unicode-xid"
161+
version = "0.2.0"
162+
source = "registry+https://github.com/rust-lang/crates.io-index"
163+
164+
[[package]]
165+
name = "vcell"
166+
version = "0.1.2"
167+
source = "registry+https://github.com/rust-lang/crates.io-index"
168+
169+
[[package]]
170+
name = "volatile-register"
171+
version = "0.2.0"
172+
source = "registry+https://github.com/rust-lang/crates.io-index"
173+
dependencies = [
174+
"vcell 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
175+
]
176+
177+
[metadata]
178+
"checksum aligned 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eb1ce8b3382016136ab1d31a1b5ce807144f8b7eb2d5f16b2108f0f07edceb94"
179+
"checksum as-slice 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "be6b7e95ac49d753f19cab5a825dea99a1149a04e4e3230b33ae16e120954c04"
180+
"checksum bare-metal 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "5deb64efa5bd81e31fcd1938615a6d98c82eafcbcd787162b6f63b91d6bac5b3"
181+
"checksum cortex-m 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2954942fbbdd49996704e6f048ce57567c3e1a4e2dc59b41ae9fde06a01fc763"
182+
"checksum cortex-m-rt 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)" = "33a716cd7d8627fae3892c2eede9249e50d2d79aedfb43ca28dad9a2b23876d9"
183+
"checksum cortex-m-rt-macros 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "72b1073338d1e691b3b7aaf6bd61993e589ececce9242a02dfa5453e1b98918d"
184+
"checksum cortex-m-semihosting 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "113ef0ecffee2b62b58f9380f4469099b30e9f9cbee2804771b4203ba1762cfa"
185+
"checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec"
186+
"checksum generic-array 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0ed1e761351b56f54eb9dcd0cfaca9fd0daecf93918e1cfc01c8a3d26ee7adcd"
187+
"checksum panic-halt 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de96540e0ebde571dc55c73d60ef407c653844e6f9a1e2fdbd40c07b9252d812"
188+
"checksum proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3acb317c6ff86a4e579dfa00fc5e6cca91ecbb4e7eb2df0468805b674eb88548"
189+
"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe"
190+
"checksum r0 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e2a38df5b15c8d5c7e8654189744d8e396bddc18ad48041a500ce52d6948941f"
191+
"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
192+
"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
193+
"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
194+
"checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8"
195+
"checksum syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)" = "af6f3550d8dff9ef7dc34d384ac6f107e5d31c8f57d9f28e0081503f547ac8f5"
196+
"checksum typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6d2783fe2d6b8c1101136184eb41be8b1ad379e4657050b8aaff0c79ee7575f9"
197+
"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c"
198+
"checksum vcell 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "876e32dcadfe563a4289e994f7cb391197f362b6315dc45e8ba4aa6f564a4b3c"
199+
"checksum volatile-register 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0d67cb4616d99b940db1d6bd28844ff97108b498a6ca850e5b6191a532063286"

src/test/run-make/thumb-none-qemu/example/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ authors = ["Hideki Sekine <[email protected]>"]
55
edition = "2018"
66

77
[dependencies]
8-
cortex-m = "0.5.4"
9-
cortex-m-rt = "=0.5.4"
8+
cortex-m = "0.6.2"
9+
cortex-m-rt = "0.6.11"
1010
panic-halt = "0.2.0"
1111
cortex-m-semihosting = "0.3.1"

src/test/run-make/thumb-none-qemu/example/src/main.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
// #![feature(stdsimd)]
21
#![no_main]
32
#![no_std]
43
use core::fmt::Write;
54
use cortex_m::asm;
65
use cortex_m_rt::entry;
76
use cortex_m_semihosting as semihosting;
87

9-
//FIXME: This imports the provided #[panic_handler].
10-
#[allow(rust_2018_idioms)]
11-
extern crate panic_halt;
12-
13-
entry!(main);
8+
use panic_halt as _;
149

10+
#[entry]
1511
fn main() -> ! {
1612
let x = 42;
1713

src/tools/compiletest/src/main.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,8 @@ fn is_up_to_date(
624624

625625
// Check timestamps.
626626
let mut inputs = inputs.clone();
627-
inputs.add_path(&testpaths.file);
627+
// Use `add_dir` to account for run-make tests, which use their individual directory
628+
inputs.add_dir(&testpaths.file);
628629

629630
for aux in &props.aux {
630631
let path = testpaths.file.parent().unwrap().join("auxiliary").join(aux);

0 commit comments

Comments
 (0)