Skip to content

use extern "custom" on naked functions with a custom calling convention #957

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

Merged
merged 2 commits into from
Jun 14, 2025

Conversation

folkertdev
Copy link
Contributor

I'm not sure whether the atomic functions in https://github.com/rust-lang/compiler-builtins/blob/master/compiler-builtins/src/aarch64_linux.rs follow the C abi, so I didn't touch them for now.

@folkertdev folkertdev force-pushed the naked-custom-abi branch 2 times, most recently from b33dfd0 to 21d5f0f Compare June 14, 2025 17:17
Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

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

Thanks for putting this together! It was on my todo list but

I'm not sure whether the atomic functions in https://github.com/rust-lang/compiler-builtins/blob/master/compiler-builtins/src/aarch64_linux.rs follow the C abi, so I didn't touch them for now.

I believe they are actually the C ABI, or at least https://community.arm.com/arm-community-blogs/b/tools-software-ides-blog/posts/making-the-most-of-the-arm-architecture-in-gcc-10 has an example calling a similar function directly and they seem to obey the input register calling convention.

@folkertdev folkertdev force-pushed the naked-custom-abi branch 2 times, most recently from a592805 to 296ecf7 Compare June 14, 2025 17:42
Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

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

Added the comment back so I remember why it's custom. Thanks!

@tgross35 tgross35 enabled auto-merge (squash) June 14, 2025 17:55
@tgross35 tgross35 disabled auto-merge June 14, 2025 18:07
@tgross35 tgross35 enabled auto-merge (squash) June 14, 2025 18:08
@tgross35 tgross35 merged commit 64b37a8 into rust-lang:master Jun 14, 2025
35 checks passed
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.

2 participants