Skip to content

Remove asm toolchain#629

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

Remove asm toolchain#629
wt wants to merge 6 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 8 times, most recently from b9cb8b5 to 74e91d2 Compare March 13, 2026 02:01
wt added 4 commits March 12, 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 8 times, most recently from 9cad22a to 256dc0f Compare March 13, 2026 04:09
@wt wt force-pushed the update_asm_toolchain branch 16 times, most recently from 3a0b6e9 to 0d75936 Compare March 13, 2026 07:11
@wt wt changed the title Update asm toolchain Remove asm toolchain Mar 13, 2026
@wt wt marked this pull request as ready for review March 13, 2026 07:14
@wt
Copy link
Contributor Author

wt commented Mar 13, 2026

@thejpster Here's what you asked for.

wt added 2 commits March 13, 2026 00:16
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).
@wt wt force-pushed the update_asm_toolchain branch from 0d75936 to e7d07d2 Compare March 13, 2026 07:17
strategy:
matrix:
# All generated code should be running on stable now
rust: [stable]
Copy link
Contributor

Choose a reason for hiding this comment

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

clippy should only be run on a fixed version, otherwise new releases that add new lints will break the build.


# steps:
# - uses: actions/checkout@v4
# - uses: dtolnay/rust-toolchain@1.85
Copy link
Contributor

Choose a reason for hiding this comment

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

Can the commented out text be removed?

@thejpster
Copy link
Contributor

Had a quick look on my phone - looks ok, just a few notes. I want to inspect the symbol table later when I get to a laptop.

@wt wt force-pushed the update_asm_toolchain branch from e7d07d2 to 29ef316 Compare March 13, 2026 07:26
@wt
Copy link
Contributor Author

wt commented Mar 13, 2026

I removed the change to the clippy runs since I added the mock so that it can be run without issue with clippy targeting x86.

@wt
Copy link
Contributor Author

wt commented Mar 13, 2026

If you want me to add that change to the tests back in for clippy I can. It was not really related to this change, so I didn't want to add more complexity.

Comment on lines +8 to +12
#[cfg_attr(any(armv6m, armv7m, armv7em, armv8m), path = "asm/inner.rs")]
#[cfg_attr(
all(not(armv6m), not(armv7m), not(armv7em), not(armv8m)),
path = "asm/inner_mock.rs"
)]

Choose a reason for hiding this comment

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

If I understand this correctly this changes the behavior from declaring an extern "C" unsafe fn for the asm functions (which is what call_asm! does if inline-asm is not enabled) to silently replacing all functions with nops if the target is not one of these.
Before this PR, it would be a compile time error if one of these functions is used on an unsupported target (I think).
Is this the intended new behavior?

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.

3 participants