Skip to content
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

arm64 macOS variadic arguments ABI needs Cranelift support #1451

Open
Tracked by #1248
bjorn3 opened this issue Jan 26, 2024 · 0 comments
Open
Tracked by #1248

arm64 macOS variadic arguments ABI needs Cranelift support #1451

bjorn3 opened this issue Jan 26, 2024 · 0 comments
Labels
A-abi Area: ABI handling C-enhancement Category: An issue proposing an enhancement or a PR with one. O-arm Target: ARM processors (arm, thumb and AArch64 targets) O-macos Operating system: MacOS S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work.

Comments

@bjorn3
Copy link
Member

bjorn3 commented Jan 26, 2024

On pretty much every target variadic functions almost the exact same ABI (on x86 you need to set %al to the upper bound of the amount of float args, so float args are currently forbidden by cg_clif) as non-variadic functions with the same arguments passed (after integer promotion, but rust denies vararg calls that need integer promotion anyway). This means that I can work around the lack of vararg support in Cranelift by changing the function signature of the imported function declaration to match the non-variadic counterpart. On arm64 macOS however variadic arguments are passed differently from non-variadic arguments: https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms#Update-code-that-passes-arguments-to-variadic-functions As such we can't support vararg functions on arm64 macOS until Cranelift gets native vararg support: bytecodealliance/wasmtime#1030

@bjorn3 bjorn3 added C-enhancement Category: An issue proposing an enhancement or a PR with one. S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work. O-macos Operating system: MacOS A-abi Area: ABI handling O-arm Target: ARM processors (arm, thumb and AArch64 targets) labels Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-abi Area: ABI handling C-enhancement Category: An issue proposing an enhancement or a PR with one. O-arm Target: ARM processors (arm, thumb and AArch64 targets) O-macos Operating system: MacOS S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work.
Projects
None yet
Development

No branches or pull requests

1 participant