-
Notifications
You must be signed in to change notification settings - Fork 161
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
inline-asm feature causes compile errors on cortex-m0 (samd21) #267
Comments
It looks like this issue was about the cortex-m crate, so I've transferred it here. What Rust version are you using, and what target are you building for (in your |
@adamgreig here's a little more info...
Regarding the target, specifically I'm doing firmware for a atsamd21g18. |
Thanks for the info. I can reproduce the error on today's nightly-2020-09-29 and as far back as nightly-2020-08-28 but it's not present on nightly-2020-08-01, so this looks like a change or regression in nightly sometime in August. As a workaround you should be able to use 2020-08-01 (rustup install nightly-2020-08-01 --profile minimal; rustup target add thumbv6m-none-eabi --toolchain nightly-2020-08-01; cargo +nightly-2020-08-01 build). @jonas-schievink, any ideas? |
Seems like a rustc regression, yeah. If you can bisect to a nightly we should be able to nail down the PR that caused it (was the LLVM upgrade in that range?). That said, this doesn't seem like something that will be fixed, since |
Ok, the last nightly that worked is nightly-2020-08-23 (rustc 1.47.0-nightly (663d2f5cd 2020-08-22)) and the first nightly that fails is nightly-2020-08-24 (rustc 1.47.0-nightly (5180f3da5 2020-08-23)). |
Commits in that range: rust-lang/rust@663d2f5...5180f3d Looks like the LLVM 11 upgrade is indeed what caused this |
It doesn't look like a rustc bug to me. One should be careful writing inlined asm code as it could be inlined into a code with different thumbness. You can't use some instructions both in ARM and Thumb mode when they do not exist in both modes.
|
But this is a thumbv6m-none-eabi target; it only runs thumb code and doesn't support ARM mode, so why would that be the issue here? |
Hmm, you're right. Disregard my note then. |
This should be fixed in cortex-m 0.7 |
And also on 0.6.4, not sure why this wasn't close automatically. Anyways, thanks for the report. |
287: Fix common uses of INSERT AFTER with .bss and .text r=adamgreig a=mattico Fixes #267 Fixes #266 This fixes two related issues. 1. Named sections are often inserted after `.bss` or `.text` in order to have them handled as if they were part of that section. Defining the start/end symbols outside of the section allows this to work. 2. Uninitialized C statics will end up as common symbols which end up in the COMMON input section. If this section is orphaned, it will likely end up placed after `.bss`. C code often expects these statics to be zero initialized. The first change would cause these symbols to be placed before `__ebss` so they will get zeroed by the reset handler. Explicitly placing the common symbols into `.bss` ensures this happens. Users who want uninitialized symbols should use the `.uninit` section. See rust-embedded/cortex-m-rt#287 (comment) Co-authored-by: Matt Ickstadt <mattico8@gmail.com>
Using version 0.6.3 with feature
inline-asm
enabled causes compile errors:The text was updated successfully, but these errors were encountered: