cortex-m: don't gate off modules for native target - #681
Open
datdenkikniet wants to merge 1 commit into
Open
Conversation
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
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. |
thejpster
approved these changes
Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 somecfg'd functions that need theasm_cfgtreatment.register::msplimandregister::psplim. Has some functions that need theasm_cfgtreatment.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 correctlyasm_cfg'd blocks, but includes a (doc?) test that starts failing if the module is enabled forcfg(native).