Skip to content

fix aapcs ABI docs, and state where which ABIs are available #1948

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RalfJung
Copy link
Member

Fixes #1946.

Regarding ABI availability, this documents a post-rust-lang/rust#137018 world. Some of the combinations documented as "not available" here actually do get accepted but trigger a future-compat warning.

@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Jul 27, 2025
Copy link
Member

@joshtriplett joshtriplett left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me.

@ehuss
Copy link
Contributor

ehuss commented Aug 6, 2025

Is there somewhere in the compiler that we can easily see these defaults?

My understanding is that if the ABI is not specified, the default is always "C". Is there something that says "C" is equivalent to these various ABIs for different targets? Or am I misunderstanding what it means by default?

Is aapcs the default for softfloat arm32?

@RalfJung
Copy link
Member Author

RalfJung commented Aug 6, 2025

My understanding is that if the ABI is not specified, the default is always "C".

Correct. And "C" can be identical to other ABIs depending on the target. This PR documents my understanding of these equivalences. Cc @workingjubilee @Amanieu for people that know more about the nitty-gritty details.

Basically, extern "C" is always the default for C code on the current target, but some of these ABI strings (such as sysv64) let one use that ABI on other targets as well. On non-Windows x86_64, "C" and "sysv64" are equivalent, but on win64 they are not.

Is aapcs the default for softfloat arm32?

I would think so but I don't know.

@Amanieu
Copy link
Member

Amanieu commented Aug 7, 2025

Is aapcs the default for softfloat arm32?

Yes, "C" == "aapcs" on soft-float arm32.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: The marked PR is awaiting review from a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Description of "aapcs" ABI seems wrong
5 participants