Skip to content

Prepare for 0.5.10 which exports features to 0.6.0 #143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2019
Merged

Conversation

adamgreig
Copy link
Member

@japaric noticed that 0.5.9 does not set its own features on its dependency on cortex-m 0.6.0, which means for example enabling inline-asm on 0.5.9 would not cause inline assembly to be generated, because 0.5.9 re-exports 0.6.0's asm module, which wouldn't necessarily have had the feature enabled.

This PR updates 0.5.10's Cargo.toml to re-export those features too.

I've tested this continues to work as before (in fact you can successfully build an application using 0.5.9 and 0.5.10 and 0.6.0), and also tested that inline asm generation is working correctly (when the application depends on 0.5.10 with inline-asm feature, calls to cortex_m::asm result in inline asm).

@adamgreig adamgreig requested a review from japaric April 29, 2019 10:12
@adamgreig adamgreig requested a review from a team as a code owner April 29, 2019 10:12
@rust-highfive
Copy link

r? @thejpster

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive
Copy link

⚠️ Warning ⚠️

  • Pull requests are usually filed against the master branch for this repo, but this one is against release-0.5. Please double check that you specified the right target!

@rust-highfive rust-highfive added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-cortex-m labels Apr 29, 2019
@adamgreig
Copy link
Member Author

bors try

bors bot added a commit that referenced this pull request Apr 29, 2019
@bors
Copy link
Contributor

bors bot commented Apr 29, 2019

try

Build succeeded

Copy link
Contributor

@therealprof therealprof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adamgreig adamgreig merged commit 822f660 into release-0.5 Apr 29, 2019
@bors bors bot deleted the 0.5.10 branch April 29, 2019 11:50
@adamgreig
Copy link
Member Author

Released 🎉

adamgreig pushed a commit that referenced this pull request Jan 12, 2022
143: `b UserHardFault` r=adamgreig a=japaric

this commit replaces the `bl UserHardFault` instruction in HardFault with `b
UserHardFault`. This lets us drop the prologue (`push {r0,lr}`) while preserving
the ability to unwind the stack using GDB.

To prevent linker errors about relocations when UserHardFault and HardFault end
up far away from each other and the target is ARMv6-M (where the `b` instruction
only supports offsets of +/- 2KB) we use two *input* sections: .HardFault and
.UserHardFault. HardFault is placed in the .HardFault section and UserHardFault
is placed in the .UserHardFault section. The .HardFault input section is placed
in the output .text section after all the input .text sections, and the
.UserHardFault input section is placed after the .HardFault section. This
causes the two symbols to always appear next to each other in the output binary,
furthermore UserHardFault *always* appears after HardFault so the branch offset
of `b UserHardFault` is always a few bytes.

It should be noted that neither .HardFault or .UserHardFault will appear in the
output of the `size -A` command as they are input sections that get merged into
the output .text section. IOW, the sizes of HardFault and UserHardFault will
continue to be reported under the .text section.

cc @adamgreen

Co-authored-by: Jorge Aparicio <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-cortex-m
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants