-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Withdraw the claim extern "C-cmse-nonsecure-*"
always matches extern "C"
#142146
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
base: master
Are you sure you want to change the base?
Withdraw the claim extern "C-cmse-nonsecure-*"
always matches extern "C"
#142146
Conversation
rustbot has assigned @compiler-errors. Use |
HIR ty lowering was modified cc @fmease These commits modify compiler targets. Some changes occurred in diagnostic error codes This PR changes a file inside |
Fair enough. AAPCS is used as a base, but https://arm-software.github.io/acle/cmse/cmse.html describes some of deviations from it (e.g. secure can't assume that unsecure properly sign/zero extended integers). Also actually we implement the LLVM interpretation of the specification (which just disallows using the stack for argument passing altogether). |
Yeah, there was speculation in the original thread, as it led to the suggestion of |
☔ The latest upstream changes (presumably #142181) made this pull request unmergeable. Please resolve the merge conflicts. |
0ac788f
to
a8346e9
Compare
We currently claim that
extern "C-cmse-nonsecure-*"
ABIs will always matchextern "C"
, but that seems... optimistic when one considers thatextern "C"
is ambiguous enough to be redefined in ways we may not want the Cortex M Security Extensions ABIs to mirror. If some configuration, feature, or other platform quirk that applied to Arm CPUs with CMSE would modify theextern "C"
ABI, it does not seem like we should guarantee that also applies to theextern "cmse-nonsecure-*"
ABIs. Anything involving target modifiers that might affect register availability or usage could make us liars if, for instance, clang decides those apply to normal C functions but not ones with the CMSE attributes, but we still want to have interop with the C compiler.We simply do not control enough of the factors involved to both force these ABIs to match and still provide useful interop, so we shouldn't implicitly promise they do. We should leave this judgement call to the decisions of platform experts who can afford to keep up with the latest news from Cambridge, instead of enshrining today's hopeful guess forever in Rust's permitted ABIs.
It's a bit weird anyways.
__attribute__((cmse_nonsecure_call))
and__attribute__((cmse_nonsecure_entry))
, so the obvious choice isextern "cmse-nonsecure-call"
andextern "cmse-nonsecure-entry"
.extern "C-unwind
", e.g. we do not haveextern "C-aapcs"
orextern "C-sysv64"
.Tracking issues:
extern "C-cmse-nonsecure-entry"
ABI #75835extern "C-cmse-nonsecure-call"
ABI #81391