-
Notifications
You must be signed in to change notification settings - Fork 156
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
Cargo.toml: Add links = "cortex-m"
#140
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @korken89 (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Since this will only work for other |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM
bors r+ |
140: Cargo.toml: Add `links = "cortex-m"` r=therealprof a=jonas-schievink This prevents linking multiple versions of `cortex-m` together, which would be unsound. Currently it uses a `#[no_mangle]` static for this, which isn't always reliable. Fixes #137 Co-authored-by: Jonas Schievink <[email protected]>
Build failed |
This might be rust-lang/rust#60050? |
@therealprof can you give this another go? The CI failure should've gone away. |
bors r+ |
140: Cargo.toml: Add `links = "cortex-m"` r=therealprof a=jonas-schievink This prevents linking multiple versions of `cortex-m` together, which would be unsound. Currently it uses a `#[no_mangle]` static for this, which isn't always reliable. Fixes #137 Co-authored-by: Jonas Schievink <[email protected]>
Build succeeded |
140: entry/exception/interrupt: improvements to the `static mut` transformation r=therealprof a=japaric see individual commits for details Co-authored-by: Jorge Aparicio <[email protected]>
after #140 landed the entry, exception and interrupt attributes started accepting code like this: ``` rust #[entry] fn main() -> ! { static mut FOO: u32 = 0; static mut FOO: i32 = 0; } ``` because that code expands into: ``` rust fn main() -> ! { let FOO: &'static mut u32 = unsafe { static mut FOO: u32 = 0; &mut FOO }; // shadows previous variable let FOO: &'static mut u32 = unsafe { static mut FOO: i32 = 0; &mut FOO }; } ``` this commit adds a check that rejects `static mut`s with duplicated names to these three attributes.
149: reject duplicate `static mut` variables r=therealprof a=japaric after #140 landed the entry, exception and interrupt attributes started accepting code like this: ``` rust #[entry] fn main() -> ! { static mut FOO: u32 = 0; static mut FOO: i32 = 0; } ``` because that code expands into: ``` rust fn main() -> ! { let FOO: &'static mut u32 = unsafe { static mut FOO: u32 = 0; &mut FOO }; // shadows previous variable let FOO: &'static mut u32 = unsafe { static mut FOO: i32 = 0; &mut FOO }; } ``` this commit adds a check that rejects `static mut`s with duplicated names to these three attributes. Co-authored-by: Jorge Aparicio <[email protected]>
This prevents linking multiple versions of
cortex-m
together, which would beunsound. Currently it uses a
#[no_mangle]
static for this, which isn't alwaysreliable.
Fixes #137