aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jonas Schievink <jonasschievink@gmail.com> 2020-08-26 21:11:43 +0200
committerGravatar Jonas Schievink <jonasschievink@gmail.com> 2020-08-26 21:21:11 +0200
commitac0cb85ddf09fbb379f6844029a7a6bda9d9a0cf (patch)
treeb7a829295bdf40290d3725b0e4fa0450d1c4c1f8
parent5e9347e53485f6c676dbd06b0ded7abdf05b264b (diff)
downloadcortex-m-ac0cb85ddf09fbb379f6844029a7a6bda9d9a0cf.tar.gz
cortex-m-ac0cb85ddf09fbb379f6844029a7a6bda9d9a0cf.tar.zst
cortex-m-ac0cb85ddf09fbb379f6844029a7a6bda9d9a0cf.zip
automate, automate
-rw-r--r--asm-toolchain1
-rw-r--r--asm.rs13
-rw-r--r--bin/thumbv6m-none-eabi-lto.abin11940 -> 12016 bytes
-rw-r--r--bin/thumbv6m-none-eabi.abin16172 -> 16188 bytes
-rw-r--r--bin/thumbv7em-none-eabi-lto.abin16632 -> 16704 bytes
-rw-r--r--bin/thumbv7em-none-eabi.abin20040 -> 20056 bytes
-rw-r--r--bin/thumbv7em-none-eabihf-lto.abin17432 -> 17504 bytes
-rw-r--r--bin/thumbv7em-none-eabihf.abin21096 -> 21112 bytes
-rw-r--r--bin/thumbv7m-none-eabi-lto.abin15356 -> 15436 bytes
-rw-r--r--bin/thumbv7m-none-eabi.abin19032 -> 19044 bytes
-rw-r--r--bin/thumbv8m.base-none-eabi-lto.abin13328 -> 13392 bytes
-rw-r--r--bin/thumbv8m.base-none-eabi.abin17960 -> 17976 bytes
-rw-r--r--bin/thumbv8m.main-none-eabi-lto.abin17956 -> 18040 bytes
-rw-r--r--bin/thumbv8m.main-none-eabi.abin22760 -> 22776 bytes
-rw-r--r--bin/thumbv8m.main-none-eabihf-lto.abin18700 -> 18776 bytes
-rw-r--r--bin/thumbv8m.main-none-eabihf.abin23748 -> 23764 bytes
-rw-r--r--ci/install.sh13
-rw-r--r--xtask/src/main.rs38
18 files changed, 49 insertions, 16 deletions
diff --git a/asm-toolchain b/asm-toolchain
new file mode 100644
index 0000000..a36829b
--- /dev/null
+++ b/asm-toolchain
@@ -0,0 +1 @@
+nightly-2020-08-26
diff --git a/asm.rs b/asm.rs
index 0bbf0c7..f5b0179 100644
--- a/asm.rs
+++ b/asm.rs
@@ -14,11 +14,20 @@
//! assembly.
//!
//! For developers and contributors to `cortex-m`, this setup means that they don't have to install
-//! any binutils, assembler, or C compiler to hack on the crate. All they need is a nightly rustc
-//! and run `cargo xtask assemble` to rebuild the archives from this file.
+//! any binutils, assembler, or C compiler to hack on the crate. All they need is to run `cargo
+//! xtask assemble` to rebuild the archives from this file.
//!
//! Cool, right?
//!
+//! # Rust version management
+//!
+//! Since inline assembly is still unstable, and we want to ensure that the created blobs are
+//! up-to-date in CI, we have to pin the nightly version we use for this. The nightly toolchain is
+//! stored in `asm-toolchain`.
+//!
+//! The `cargo xtask` automation will automatically install the `asm-toolchain` as well as all
+//! Cortex-M targets needed to generate the blobs.
+//!
//! [linker plugin LTO]: https://doc.rust-lang.org/stable/rustc/linker-plugin-lto.html
#![feature(asm)]
diff --git a/bin/thumbv6m-none-eabi-lto.a b/bin/thumbv6m-none-eabi-lto.a
index f32cbe1..4d2f02c 100644
--- a/bin/thumbv6m-none-eabi-lto.a
+++ b/bin/thumbv6m-none-eabi-lto.a
Binary files differ
diff --git a/bin/thumbv6m-none-eabi.a b/bin/thumbv6m-none-eabi.a
index 563030a..beedd73 100644
--- a/bin/thumbv6m-none-eabi.a
+++ b/bin/thumbv6m-none-eabi.a
Binary files differ
diff --git a/bin/thumbv7em-none-eabi-lto.a b/bin/thumbv7em-none-eabi-lto.a
index e60db30..7b8a4f8 100644
--- a/bin/thumbv7em-none-eabi-lto.a
+++ b/bin/thumbv7em-none-eabi-lto.a
Binary files differ
diff --git a/bin/thumbv7em-none-eabi.a b/bin/thumbv7em-none-eabi.a
index 8b86100..588e5cd 100644
--- a/bin/thumbv7em-none-eabi.a
+++ b/bin/thumbv7em-none-eabi.a
Binary files differ
diff --git a/bin/thumbv7em-none-eabihf-lto.a b/bin/thumbv7em-none-eabihf-lto.a
index 4821df3..4efadd8 100644
--- a/bin/thumbv7em-none-eabihf-lto.a
+++ b/bin/thumbv7em-none-eabihf-lto.a
Binary files differ
diff --git a/bin/thumbv7em-none-eabihf.a b/bin/thumbv7em-none-eabihf.a
index 5dfdf37..fd08ba5 100644
--- a/bin/thumbv7em-none-eabihf.a
+++ b/bin/thumbv7em-none-eabihf.a
Binary files differ
diff --git a/bin/thumbv7m-none-eabi-lto.a b/bin/thumbv7m-none-eabi-lto.a
index de66882..28e5860 100644
--- a/bin/thumbv7m-none-eabi-lto.a
+++ b/bin/thumbv7m-none-eabi-lto.a
Binary files differ
diff --git a/bin/thumbv7m-none-eabi.a b/bin/thumbv7m-none-eabi.a
index b47f571..4559ad4 100644
--- a/bin/thumbv7m-none-eabi.a
+++ b/bin/thumbv7m-none-eabi.a
Binary files differ
diff --git a/bin/thumbv8m.base-none-eabi-lto.a b/bin/thumbv8m.base-none-eabi-lto.a
index 8c41d35..ee46792 100644
--- a/bin/thumbv8m.base-none-eabi-lto.a
+++ b/bin/thumbv8m.base-none-eabi-lto.a
Binary files differ
diff --git a/bin/thumbv8m.base-none-eabi.a b/bin/thumbv8m.base-none-eabi.a
index 22aefda..26d25bd 100644
--- a/bin/thumbv8m.base-none-eabi.a
+++ b/bin/thumbv8m.base-none-eabi.a
Binary files differ
diff --git a/bin/thumbv8m.main-none-eabi-lto.a b/bin/thumbv8m.main-none-eabi-lto.a
index 42417a4..e3aa0cf 100644
--- a/bin/thumbv8m.main-none-eabi-lto.a
+++ b/bin/thumbv8m.main-none-eabi-lto.a
Binary files differ
diff --git a/bin/thumbv8m.main-none-eabi.a b/bin/thumbv8m.main-none-eabi.a
index 708b33a..10bbf53 100644
--- a/bin/thumbv8m.main-none-eabi.a
+++ b/bin/thumbv8m.main-none-eabi.a
Binary files differ
diff --git a/bin/thumbv8m.main-none-eabihf-lto.a b/bin/thumbv8m.main-none-eabihf-lto.a
index 15ffca8..1c25494 100644
--- a/bin/thumbv8m.main-none-eabihf-lto.a
+++ b/bin/thumbv8m.main-none-eabihf-lto.a
Binary files differ
diff --git a/bin/thumbv8m.main-none-eabihf.a b/bin/thumbv8m.main-none-eabihf.a
index 5e2f805..0651788 100644
--- a/bin/thumbv8m.main-none-eabihf.a
+++ b/bin/thumbv8m.main-none-eabihf.a
Binary files differ
diff --git a/ci/install.sh b/ci/install.sh
index 855043d..fb3e52d 100644
--- a/ci/install.sh
+++ b/ci/install.sh
@@ -5,19 +5,6 @@ main() {
thumbv*-none-eabi*)
rustup target add $TARGET
;;
- x86_64-unknown-linux-gnu)
- # We need *all* targets and nightly as we're checking the blobs.
- rustup install nightly
- rustup target add \
- thumbv6m-none-eabi \
- thumbv7m-none-eabi \
- thumbv7em-none-eabi \
- thumbv7em-none-eabihf \
- thumbv8m.base-none-eabi \
- thumbv8m.main-none-eabi \
- thumbv8m.main-none-eabihf \
- --toolchain nightly
- ;;
esac
}
diff --git a/xtask/src/main.rs b/xtask/src/main.rs
index 16132fb..ab59f57 100644
--- a/xtask/src/main.rs
+++ b/xtask/src/main.rs
@@ -4,6 +4,7 @@
//!
//! Also see the docs in `asm.rs`.
+use process::Stdio;
use std::env::{self, current_dir};
use std::{
collections::BTreeMap,
@@ -11,9 +12,16 @@ use std::{
process::{self, Command},
};
+fn toolchain() -> String {
+ fs::read_to_string("asm-toolchain")
+ .unwrap()
+ .trim()
+ .to_string()
+}
+
fn rustc() -> Command {
let mut cmd = Command::new("rustc");
- cmd.arg("+nightly");
+ cmd.arg(format!("+{}", toolchain()));
cmd
}
@@ -105,6 +113,34 @@ static TARGETS: &[(&str, &[&str])] = &[
];
fn assemble_blobs() {
+ let mut cmd = rustc();
+ cmd.arg("-V");
+ cmd.stdout(Stdio::null());
+ let status = cmd.status().unwrap();
+
+ if !status.success() {
+ let toolchain = toolchain();
+ println!(
+ "asm toolchain {} does not seem to be installed. installing it now.",
+ toolchain
+ );
+
+ let mut rustup = Command::new("rustup");
+ let status = rustup.arg("install").arg(&toolchain).status().unwrap();
+ assert!(status.success(), "rustup command failed: {:?}", rustup);
+
+ let mut rustup = Command::new("rustup");
+ let status = rustup
+ .arg("target")
+ .arg("add")
+ .args(TARGETS.iter().map(|(target, _)| *target))
+ .arg("--toolchain")
+ .arg(toolchain)
+ .status()
+ .unwrap();
+ assert!(status.success(), "rustup command failed: {:?}", rustup);
+ }
+
for (target, cfgs) in TARGETS {
println!("building artifacts for {}", target);
assemble(target, cfgs);