Skip to content

cortex-m: don't gate off modules for native target - #681

Open
datdenkikniet wants to merge 1 commit into
rust-embedded:masterfrom
datdenkikniet:fixy
Open

cortex-m: don't gate off modules for native target#681
datdenkikniet wants to merge 1 commit into
rust-embedded:masterfrom
datdenkikniet:fixy

Conversation

@datdenkikniet

@datdenkikniet datdenkikniet commented Aug 5, 2026

Copy link
Copy Markdown

These modules only contain asm_cfgs that explicitly exist to allow for compilation (but not function) on native targets.

Gating the modules behind target features makes this impossible (requiring workarounds on the end of the cortex-m consumer).

The modules should also be made available when compiling for the host target.

Fixes #680

There are additional modules that might benefit from this, but that are likely not to have compiled before (so I'm not fixing them in this PR):

  • register::fpscr. This has some cfg'd functions that need the asm_cfg treatment.
  • register::msplim and register::psplim. Has some functions that need the asm_cfg treatment.
  • itm. This one I'm having a hard time understanding. It seems like it should work, but I feel that there may be something that I'm missing, so I won't touch it for now.
  • csme. This has correctly asm_cfg'd blocks, but includes a (doc?) test that starts failing if the module is enabled for cfg(native).

These modules only contain `asm_cfg`s that explicitly exist
to allow for compilation (but not function) on native targets.

Gating the modules behind target features makes this impossible
(requiring workarounds on the end of the cortex-m consumer).

The modules should also be made available when compiling for the
host target.

Fixes rust-embedded#680
@thejpster

Copy link
Copy Markdown
Contributor

Yeah if we put in the effort to have dummy versions of the functions when running tests on the host, it doesn't make sense to remove the entire module when on the host.

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.

cortex-m v0.7.8 breaks crates that re-export basepri and basepri_max if those crates are compiled for non-ARM targets

2 participants