Skip to content

Remove asm toolchain#629

Open
wt wants to merge 11 commits intorust-embedded:masterfrom
wt:update_asm_toolchain
Open

Remove asm toolchain#629
wt wants to merge 11 commits intorust-embedded:masterfrom
wt:update_asm_toolchain

Conversation

@wt
Copy link
Contributor

@wt wt commented Mar 11, 2026

This is a draft for updating the asm toolchain. It's based on my #628, so it shouldn't be landed before that is.

@wt wt force-pushed the update_asm_toolchain branch 4 times, most recently from 0fe3a7c to 2abb7dd Compare March 12, 2026 21:06
@wt wt marked this pull request as ready for review March 12, 2026 21:06
@wt wt force-pushed the update_asm_toolchain branch 4 times, most recently from ec6c7ef to 667de8f Compare March 12, 2026 23:46
@wt wt marked this pull request as draft March 12, 2026 23:46
@wt wt force-pushed the update_asm_toolchain branch 20 times, most recently from ac4ddc1 to 42c98c1 Compare March 13, 2026 04:20
@wt wt force-pushed the update_asm_toolchain branch 4 times, most recently from fd3ccb5 to edb22b0 Compare March 18, 2026 07:03
@wt
Copy link
Contributor Author

wt commented Mar 18, 2026

@thejpster @jonathanpallant @adamgreig

Reviewers, please double check the new crate (in cortex-m/macros). I'm assuming that the cortex-m crate using the new crate will need to be updated to use an actual version once it is published. Can we just publish the new crate once this is landed so that I can make a PR to depend on the published version?

@wt wt force-pushed the update_asm_toolchain branch from edb22b0 to e53eba0 Compare March 18, 2026 08:23
@thejpster
Copy link
Contributor

You can depend on a version and a path at the same time.

@wt
Copy link
Contributor Author

wt commented Mar 19, 2026

You can depend on a version and a path at the same time.

Can I depend on a path in a published crate, like "cortex-m"?

@jonathanpallant
Copy link
Contributor

https://github.com/rust-embedded/aarch32/blob/a7d4d1ce255a5dc783edf5f990e279c979e131f3/aarch32-rt/Cargo.toml#L40

As long as you have both. It uses the path if valid, and falls back to the version if not.

@wt wt force-pushed the update_asm_toolchain branch from e53eba0 to 63bee36 Compare March 19, 2026 22:50
@wt
Copy link
Contributor Author

wt commented Mar 19, 2026

I have updated the dep spec for the new crate to include the version number. I use an exact version like the cortex-m-rt crate does for cortex-m-rt-macros.

wt added 4 commits March 21, 2026 20:03
The `cm7-r0p1` feature only works with the plateform feature `armv7em`.
I added a compile error to help someone figure that out more redily if
they accidentally combine those features.
This will allow getting all the asm in shape for edition 2024.
@wt wt force-pushed the update_asm_toolchain branch from 63bee36 to fe62ca1 Compare March 22, 2026 05:56
@wt
Copy link
Contributor Author

wt commented Mar 22, 2026

I removed the cortex_m::asm::inner module.

@wt wt force-pushed the update_asm_toolchain branch from fe62ca1 to dd25b47 Compare March 22, 2026 07:30
@wt wt force-pushed the update_asm_toolchain branch from dd25b47 to 94fb96a Compare March 22, 2026 07:49
wt added 6 commits March 22, 2026 01:12
Inline asm has been supported in stable rust for some time, so I removed
the separate asm build infra and added that code to the normal crate code.

I also crated a mock of the asm functions that were needed to run clippy
with a non-arm target (like x86_64).
The purpose of this attribute is to allow platforms that do not support the
asm instructions to compile code code that calls those functions. This is
needed so that clippy can be run once in CI and when testing locally.
This is the first step of removing the asm::inner module entirely.
This removes the inner module entirely.
The more I think about this, the more I think this is more correct.
Considering that the argument is owned, by the function, it seems
more correct to just recognize that in the signature. It is not a
breaking change since the arg is passed by value since it's a primitive
type, so I think this is better.

In principle, I would prefer to merge this with the commit that moves
the asm code into the crate directly instead of this separate commit.
@wt wt force-pushed the update_asm_toolchain branch from 94fb96a to 1ef6c56 Compare March 22, 2026 08:16
I used `any(armv6m, armv7m, ...)` in many places where I could have said
`cortex_m` instead for the cfg macro calls. Let's change that.
@wt wt force-pushed the update_asm_toolchain branch from e0d3ab8 to 3188915 Compare March 22, 2026 09:32
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

Successfully merging this pull request may close these issues.

6 participants