Skip to content

inline-asm on nightly #228

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

Closed
little-arhat opened this issue Jun 10, 2020 · 6 comments
Closed

inline-asm on nightly #228

little-arhat opened this issue Jun 10, 2020 · 6 comments

Comments

@little-arhat
Copy link

Hello,

With new asm! macro merged, it's impossible to use cotrex-m crate with inline-asm on nightly, because latest released version (0.6.2) still uses old asm!.
At the same time it's impossible to use cortex-m from git, because it then conflicts with cortex-m brough by other deps (rtfm, cortex-m-log, etc):

error: failed to select a version for `cortex-m`.
    ... required by package `cortex-m-log v0.6.1`
    ... which is depended on by `fcfs-rtfm v0.1.0 (/Users/r/prj/p/copterust/fcfs-rtfm)`
versions that meet the requirements `= 0.6.2` are: 0.6.2

the package `cortex-m` links to the native library `cortex-m`, but it conflicts with a previous package which links to `cortex-m` as well:
package `cortex-m v0.6.2 (https://github.com/rust-embedded/cortex-m?rev=c9c7539233954822a6132f4bc13e5763371b5cb2#c9c75392)`
    ... which is depended on by `fcfs-rtfm v0.1.0 (/Users/r/prj/p/copterust/fcfs-rtfm)`

What's the recommended course of action, besides not using inline-asm? (refs #217).

@adamgreig
Copy link
Member

Are you using the git version by changing your dependency line or by using the Cargo patch feature? I think using patch should fix this. Another option is to use an older nightly. We'll aim to release a new cortex-m release soon too, which is the best fix!

@diondokter
Copy link
Contributor

Yes, patch works (at least with the alloc repo)

[dependencies]
cortex-m = { version = "0.6.2", features = ["inline-asm"] }

[patch.crates-io]
cortex-m = { git = "https://github.com/rust-embedded/cortex-m" }

@little-arhat
Copy link
Author

I've been using git version, but I'll try patch.

Thank you @adamgreig , @diondokter !

@adamgreig
Copy link
Member

@little-arhat did using patch work OK for you?

@little-arhat
Copy link
Author

@adamgreig yes, thanks! is there ETA for a proper fix?

@adamgreig
Copy link
Member

The next release will have a fix; see #217 for updates but hopefully soon.

adamgreig pushed a commit that referenced this issue Jan 12, 2022
228: Added so attributes and cfgs are applied on the trampolines as well r=jonas-schievink a=korken89

I made a first go at #223, but maybe this implementation takes things we do not want to propagate.
If you come up with something that should not propagate, please comment here.

Closes  #223
Closes rust-embedded/cortex-m-rt#213

Co-authored-by: Emil Fresk <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants