Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Commit

Permalink
Merge #329
Browse files Browse the repository at this point in the history
329: Prepare for v0.6.15 r=therealprof a=adamgreig

I'd like to make a backport release of 0.6.15 containing a few hot bug fixes from master, and setting up the `links` key in Cargo.toml to help compatibility with v0.7.

I've reviewed all the PRs between master and 0.6.11 (when we diverged), and I think this captures a useful handful of minor non-breaking bug fixes. I think let's get this out to wrap up 0.6 and then get a 0.7 out with the other changes ASAP.

Co-authored-by: Cliff L. Biffle <[email protected]>
Co-authored-by: Adam Greig <[email protected]>
Co-authored-by: Guilucand <[email protected]>
Co-authored-by: Ulf Lilleengen <[email protected]>
  • Loading branch information
5 people authored Jul 21, 2021
2 parents ba11dfc + d5f9aef commit ad9bacd
Show file tree
Hide file tree
Showing 14 changed files with 154 additions and 149 deletions.
7 changes: 6 additions & 1 deletion .github/bors.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
block_labels = ["needs-decision"]
delete_merged_branches = true
required_approvals = 1
status = ["continuous-integration/travis-ci/push"]
status = [
"ci-linux (stable)",
"ci-linux (1.40.0)",
"build-other (macOS-latest)",
"build-other (windows-latest)",
]
83 changes: 83 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
on:
push:
branches: [ staging, trying, master ]
pull_request:

name: Continuous integration

jobs:
ci-linux:
runs-on: ubuntu-20.04
continue-on-error: ${{ matrix.experimental || false }}
strategy:
matrix:
# All generated code should be running on stable now
rust: [nightly, stable, 1.40.0]

include:
# Nightly is only for reference and allowed to fail
- rust: nightly
experimental: true

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Install all Rust targets for ${{ matrix.rust }}
run: rustup target install --toolchain=${{ matrix.rust }} thumbv6m-none-eabi thumbv7m-none-eabi thumbv7em-none-eabi thumbv7em-none-eabihf thumbv8m.base-none-eabi thumbv8m.main-none-eabi thumbv8m.main-none-eabihf
- name: Install qemu and gcc
run: sudo apt-get update && sudo apt-get install qemu-system-arm gcc-arm-none-eabi
- name: Run CI script for x86_64-unknown-linux-gnu under ${{ matrix.rust }}
run: TARGET=x86_64-unknown-linux-gnu TRAVIS_RUST_VERSION=${{ matrix.rust }} bash ci/script.sh
- name: Run CI script for thumbv6m-none-eabi under ${{ matrix.rust }}
run: TARGET=thumbv6m-none-eabi TRAVIS_RUST_VERSION=${{ matrix.rust }} bash ci/script.sh
- name: Run CI script for thumbv7m-none-eabi under ${{ matrix.rust }}
run: TARGET=thumbv7m-none-eabi TRAVIS_RUST_VERSION=${{ matrix.rust }} bash ci/script.sh
- name: Run CI script for thumbv7em-none-eabi under ${{ matrix.rust }}
run: TARGET=thumbv7em-none-eabi TRAVIS_RUST_VERSION=${{ matrix.rust }} bash ci/script.sh
- name: Run CI script for thumbv7em-none-eabihf under ${{ matrix.rust }}
run: TARGET=thumbv7em-none-eabihf TRAVIS_RUST_VERSION=${{ matrix.rust }} bash ci/script.sh
- name: Run CI script for thumbv8m.base-none-eabi under ${{ matrix.rust }}
run: TARGET=thumbv8m.base-none-eabi TRAVIS_RUST_VERSION=${{ matrix.rust }} bash ci/script.sh
- name: Run CI script for thumbv8m.main-none-eabi under ${{ matrix.rust }}
run: TARGET=thumbv8m.main-none-eabi TRAVIS_RUST_VERSION=${{ matrix.rust }} bash ci/script.sh
- name: Run CI script for thumbv8m.main-none-eabihf under ${{ matrix.rust }}
run: TARGET=thumbv8m.main-none-eabihf TRAVIS_RUST_VERSION=${{ matrix.rust }} bash ci/script.sh

# On macOS and Windows, we at least make sure that all examples build and link.
build-other:
strategy:
matrix:
os:
- macOS-latest
- windows-latest
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install all Rust targets
run: rustup target install thumbv6m-none-eabi thumbv7m-none-eabi thumbv7em-none-eabi thumbv7em-none-eabihf thumbv8m.base-none-eabi thumbv8m.main-none-eabi thumbv8m.main-none-eabihf
- name: Build examples for thumbv6m-none-eabi
run: cargo build --target=thumbv6m-none-eabi --examples
- name: Build examples for thumbv7m-none-eabi
run: cargo build --target=thumbv7m-none-eabi --examples
- name: Build examples for thumbv7em-none-eabi
run: cargo build --target=thumbv7em-none-eabi --examples
- name: Build examples for thumbv7em-none-eabihf
run: cargo build --target=thumbv7em-none-eabihf --examples
- name: Build examples for thumbv8m.base-none-eabi
run: cargo build --target=thumbv8m.base-none-eabi --examples
- name: Build examples for thumbv8m.main-none-eabi
run: cargo build --target=thumbv8m.main-none-eabi --examples
- name: Build examples for thumbv8m.main-none-eabihf
run: cargo build --target=thumbv8m.main-none-eabihf --examples
- name: Build crate for host OS
run: cargo build
74 changes: 0 additions & 74 deletions .travis.yml

This file was deleted.

29 changes: 25 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,27 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## [v0.6.14] - 2021-05-19
## Backport release: [v0.6.15] - 2021-07-12

### Fixed

- Backport: Mark .bss as NOLOAD ([#265])
- Backport: Fix possible overflow of .data region ([#286])
- Backport: Perform volatile reads of ICSR in DefaultHandler (#[315])

### Other
- Backport: Use `links` in Cargo.toml to prevent multiple linking of
cortex-m-rt (#276)
- Backport: Use same version for macros crate as for cortex-m-rt itself
([#245])

[#245]: https://github.com/rust-embedded/cortex-m-rt/pull/245
[#265]: https://github.com/rust-embedded/cortex-m-rt/pull/265
[#276]: https://github.com/rust-embedded/cortex-m-rt/pull/276
[#286]: https://github.com/rust-embedded/cortex-m-rt/pull/286
[#315]: https://github.com/rust-embedded/cortex-m-rt/pull/315

## Backport release: [v0.6.14] - 2021-05-19

### Fixed

Expand All @@ -16,14 +36,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
[#306]: https://github.com/rust-embedded/cortex-m-rt/issues/306
[#310]: https://github.com/rust-embedded/cortex-m-rt/issues/310

## [v0.6.13] - 2020-09-07
## Backport release: [v0.6.13] - 2020-09-07

### Fixed

- (ARMv6-M) Set LR value to a known value on reset (as the ARM spec requires)
- Added CFI and size info to external assembly subroutines (`HardFaultTrampoline`)

## [v0.6.12] - 2020-01-26
## Backport release: [v0.6.12] - 2020-01-26

### Fixed

Expand Down Expand Up @@ -490,7 +510,8 @@ section size addr

Initial release

[Unreleased]: https://github.com/rust-embedded/cortex-m-rt/compare/v0.6.14...HEAD
[Unreleased]: https://github.com/rust-embedded/cortex-m-rt/compare/v0.6.15...v0.6.x
[v0.6.15]: https://github.com/rust-embedded/cortex-m-rt/compare/v0.6.14...v0.6.15
[v0.6.14]: https://github.com/rust-embedded/cortex-m-rt/compare/v0.6.13...v0.6.14
[v0.6.13]: https://github.com/rust-embedded/cortex-m-rt/compare/v0.6.12...v0.6.13
[v0.6.12]: https://github.com/rust-embedded/cortex-m-rt/compare/v0.6.11...v0.6.12
Expand Down
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ license = "MIT OR Apache-2.0"
name = "cortex-m-rt"
readme = "README.md"
repository = "https://github.com/rust-embedded/cortex-m-rt"
version = "0.6.14"
version = "0.6.15"
autoexamples = true
links = "cortex-m-rt" # Prevent multiple versions of cortex-m-rt being linked

[dependencies]
r0 = "0.2.2"
cortex-m-rt-macros = { path = "macros", version = "=0.1.8" }
cortex-m-rt-macros = { path = "macros", version = "=0.6.15" }

[dev-dependencies]
cortex-m = "0.6"
Expand Down
19 changes: 0 additions & 19 deletions ci/install.sh

This file was deleted.

66 changes: 27 additions & 39 deletions ci/script.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -32,52 +32,40 @@ main() {
local fail_examples=(
data_overflow
)
local linkers=(
# Link with arm-none-eabi-ld
"-C linker=arm-none-eabi-ld"
# Link with arm-none-eabi-gcc, requires -nostartfiles
"-C linker=arm-none-eabi-gcc -C link-arg=-nostartfiles"
# Link with rust-lld (default)
""
)
if [ "$TARGET" != x86_64-unknown-linux-gnu ]; then
# linking with GNU LD
for ex in "${examples[@]}"; do
cargo rustc --target "$TARGET" --example "$ex" -- \
-C linker=arm-none-eabi-ld

cargo rustc --target "$TARGET" --example "$ex" --release -- \
-C linker=arm-none-eabi-ld
done
for ex in "${fail_examples[@]}"; do
! cargo rustc --target "$TARGET" --example "$ex" -- \
-C linker=arm-none-eabi-ld

! cargo rustc --target "$TARGET" --example "$ex" --release -- \
-C linker=arm-none-eabi-ld
done

cargo rustc --target "$TARGET" --example device --features device -- \
-C linker=arm-none-eabi-ld

cargo rustc --target "$TARGET" --example device --features device --release -- \
-C linker=arm-none-eabi-ld

# linking with rustc's LLD
for ex in "${examples[@]}"; do
cargo rustc --target "$TARGET" --example "$ex"
cargo rustc --target "$TARGET" --example "$ex" --release
RUSTDOCFLAGS="-Cpanic=abort" cargo test --doc

for linker in "${linkers[@]}"; do
for ex in "${examples[@]}"; do
cargo rustc --target "$TARGET" --example "$ex" -- $linker
cargo rustc --target "$TARGET" --example "$ex" --release -- $linker
done
for ex in "${fail_examples[@]}"; do
! cargo rustc --target "$TARGET" --example "$ex" -- $linker
! cargo rustc --target "$TARGET" --example "$ex" --release -- $linker
done
cargo rustc --target "$TARGET" --example device --features device -- $linker
cargo rustc --target "$TARGET" --example device --features device --release -- $linker
done
for ex in "${fail_examples[@]}"; do
! cargo rustc --target "$TARGET" --example "$ex"
! cargo rustc --target "$TARGET" --example "$ex" --release
done

cargo rustc --target "$TARGET" --example device --features device
cargo rustc --target "$TARGET" --example device --features device --release
fi

case $TARGET in
thumbv6m-none-eabi|thumbv7m-none-eabi)
# linking with GNU LD
env RUSTFLAGS="-C linker=arm-none-eabi-ld -C link-arg=-Tlink.x" cargo run --target "$TARGET" --example qemu | grep "x = 42"
env RUSTFLAGS="-C linker=arm-none-eabi-ld -C link-arg=-Tlink.x" cargo run --target "$TARGET" --example qemu --release | grep "x = 42"
for linker in "${linkers[@]}"; do
env RUSTFLAGS="$linker -C link-arg=-Tlink.x" cargo run \
--target "$TARGET" --example qemu | grep "x = 42"
env RUSTFLAGS="$linker -C link-arg=-Tlink.x" cargo run \
--target "$TARGET" --example qemu --release | grep "x = 42"
done

# linking with rustc's LLD
cargo run --target "$TARGET" --example qemu | grep "x = 42"
cargo run --target "$TARGET" --example qemu --release | grep "x = 42"
;;
esac

Expand Down
1 change: 1 addition & 0 deletions examples/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ extern "C" {
fn PVD();
}

#[allow(unsafe_code)]
#[link_section = ".vector_table.interrupts"]
#[no_mangle]
pub static __INTERRUPTS: [Vector; 3] = [
Expand Down
6 changes: 3 additions & 3 deletions link.x.in
Original file line number Diff line number Diff line change
Expand Up @@ -110,20 +110,20 @@ SECTIONS

/* ## Sections in RAM */
/* ### .data */
.data : AT(__erodata) ALIGN(4)
.data : ALIGN(4)
{
. = ALIGN(4);
__sdata = .;
*(.data .data.*);
. = ALIGN(4); /* 4-byte align the end (VMA) of this section */
__edata = .;
} > RAM
} > RAM AT>FLASH

/* LMA of .data */
__sidata = LOADADDR(.data);

/* ### .bss */
.bss : ALIGN(4)
.bss (NOLOAD) : ALIGN(4)
{
. = ALIGN(4);
__sbss = .;
Expand Down
2 changes: 1 addition & 1 deletion macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ keywords = ["arm", "cortex-m", "runtime", "startup"]
license = "MIT OR Apache-2.0"
name = "cortex-m-rt-macros"
repository = "https://github.com/japaric/cortex-m-rt"
version = "0.1.8"
version = "0.6.15"
edition = "2018"

[lib]
Expand Down
2 changes: 1 addition & 1 deletion macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ pub fn exception(args: TokenStream, input: TokenStream) -> TokenStream {

const SCB_ICSR: *const u32 = 0xE000_ED04 as *const u32;

let irqn = unsafe { core::ptr::read(SCB_ICSR) as u8 as i16 - 16 };
let irqn = unsafe { (core::ptr::read_volatile(SCB_ICSR) & 0x1FF) as i16 - 16 };

#ident(irqn)
}
Expand Down
Loading

0 comments on commit ad9bacd

Please sign in to comment.