diff options
author | 2020-08-26 21:11:43 +0200 | |
---|---|---|
committer | 2020-08-26 21:21:11 +0200 | |
commit | ac0cb85ddf09fbb379f6844029a7a6bda9d9a0cf (patch) | |
tree | b7a829295bdf40290d3725b0e4fa0450d1c4c1f8 | |
parent | 5e9347e53485f6c676dbd06b0ded7abdf05b264b (diff) | |
download | cortex-m-ac0cb85ddf09fbb379f6844029a7a6bda9d9a0cf.tar.gz cortex-m-ac0cb85ddf09fbb379f6844029a7a6bda9d9a0cf.tar.zst cortex-m-ac0cb85ddf09fbb379f6844029a7a6bda9d9a0cf.zip |
automate, automate
-rw-r--r-- | asm-toolchain | 1 | ||||
-rw-r--r-- | asm.rs | 13 | ||||
-rw-r--r-- | bin/thumbv6m-none-eabi-lto.a | bin | 11940 -> 12016 bytes | |||
-rw-r--r-- | bin/thumbv6m-none-eabi.a | bin | 16172 -> 16188 bytes | |||
-rw-r--r-- | bin/thumbv7em-none-eabi-lto.a | bin | 16632 -> 16704 bytes | |||
-rw-r--r-- | bin/thumbv7em-none-eabi.a | bin | 20040 -> 20056 bytes | |||
-rw-r--r-- | bin/thumbv7em-none-eabihf-lto.a | bin | 17432 -> 17504 bytes | |||
-rw-r--r-- | bin/thumbv7em-none-eabihf.a | bin | 21096 -> 21112 bytes | |||
-rw-r--r-- | bin/thumbv7m-none-eabi-lto.a | bin | 15356 -> 15436 bytes | |||
-rw-r--r-- | bin/thumbv7m-none-eabi.a | bin | 19032 -> 19044 bytes | |||
-rw-r--r-- | bin/thumbv8m.base-none-eabi-lto.a | bin | 13328 -> 13392 bytes | |||
-rw-r--r-- | bin/thumbv8m.base-none-eabi.a | bin | 17960 -> 17976 bytes | |||
-rw-r--r-- | bin/thumbv8m.main-none-eabi-lto.a | bin | 17956 -> 18040 bytes | |||
-rw-r--r-- | bin/thumbv8m.main-none-eabi.a | bin | 22760 -> 22776 bytes | |||
-rw-r--r-- | bin/thumbv8m.main-none-eabihf-lto.a | bin | 18700 -> 18776 bytes | |||
-rw-r--r-- | bin/thumbv8m.main-none-eabihf.a | bin | 23748 -> 23764 bytes | |||
-rw-r--r-- | ci/install.sh | 13 | ||||
-rw-r--r-- | xtask/src/main.rs | 38 |
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 @@ -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 Binary files differindex f32cbe1..4d2f02c 100644 --- a/bin/thumbv6m-none-eabi-lto.a +++ b/bin/thumbv6m-none-eabi-lto.a diff --git a/bin/thumbv6m-none-eabi.a b/bin/thumbv6m-none-eabi.a Binary files differindex 563030a..beedd73 100644 --- a/bin/thumbv6m-none-eabi.a +++ b/bin/thumbv6m-none-eabi.a diff --git a/bin/thumbv7em-none-eabi-lto.a b/bin/thumbv7em-none-eabi-lto.a Binary files differindex e60db30..7b8a4f8 100644 --- a/bin/thumbv7em-none-eabi-lto.a +++ b/bin/thumbv7em-none-eabi-lto.a diff --git a/bin/thumbv7em-none-eabi.a b/bin/thumbv7em-none-eabi.a Binary files differindex 8b86100..588e5cd 100644 --- a/bin/thumbv7em-none-eabi.a +++ b/bin/thumbv7em-none-eabi.a diff --git a/bin/thumbv7em-none-eabihf-lto.a b/bin/thumbv7em-none-eabihf-lto.a Binary files differindex 4821df3..4efadd8 100644 --- a/bin/thumbv7em-none-eabihf-lto.a +++ b/bin/thumbv7em-none-eabihf-lto.a diff --git a/bin/thumbv7em-none-eabihf.a b/bin/thumbv7em-none-eabihf.a Binary files differindex 5dfdf37..fd08ba5 100644 --- a/bin/thumbv7em-none-eabihf.a +++ b/bin/thumbv7em-none-eabihf.a diff --git a/bin/thumbv7m-none-eabi-lto.a b/bin/thumbv7m-none-eabi-lto.a Binary files differindex de66882..28e5860 100644 --- a/bin/thumbv7m-none-eabi-lto.a +++ b/bin/thumbv7m-none-eabi-lto.a diff --git a/bin/thumbv7m-none-eabi.a b/bin/thumbv7m-none-eabi.a Binary files differindex b47f571..4559ad4 100644 --- a/bin/thumbv7m-none-eabi.a +++ b/bin/thumbv7m-none-eabi.a diff --git a/bin/thumbv8m.base-none-eabi-lto.a b/bin/thumbv8m.base-none-eabi-lto.a Binary files differindex 8c41d35..ee46792 100644 --- a/bin/thumbv8m.base-none-eabi-lto.a +++ b/bin/thumbv8m.base-none-eabi-lto.a diff --git a/bin/thumbv8m.base-none-eabi.a b/bin/thumbv8m.base-none-eabi.a Binary files differindex 22aefda..26d25bd 100644 --- a/bin/thumbv8m.base-none-eabi.a +++ b/bin/thumbv8m.base-none-eabi.a diff --git a/bin/thumbv8m.main-none-eabi-lto.a b/bin/thumbv8m.main-none-eabi-lto.a Binary files differindex 42417a4..e3aa0cf 100644 --- a/bin/thumbv8m.main-none-eabi-lto.a +++ b/bin/thumbv8m.main-none-eabi-lto.a diff --git a/bin/thumbv8m.main-none-eabi.a b/bin/thumbv8m.main-none-eabi.a Binary files differindex 708b33a..10bbf53 100644 --- a/bin/thumbv8m.main-none-eabi.a +++ b/bin/thumbv8m.main-none-eabi.a diff --git a/bin/thumbv8m.main-none-eabihf-lto.a b/bin/thumbv8m.main-none-eabihf-lto.a Binary files differindex 15ffca8..1c25494 100644 --- a/bin/thumbv8m.main-none-eabihf-lto.a +++ b/bin/thumbv8m.main-none-eabihf-lto.a diff --git a/bin/thumbv8m.main-none-eabihf.a b/bin/thumbv8m.main-none-eabihf.a Binary files differindex 5e2f805..0651788 100644 --- a/bin/thumbv8m.main-none-eabihf.a +++ b/bin/thumbv8m.main-none-eabihf.a 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); |