Skip to content

Support P/Invoke to Variadic Functions on Apple Silicon #48752

Closed
@k15tfu

Description

@k15tfu

Hi!

What is the best way to pass arguments to variadic functions (sem_open, open, etc) from C# on macOS ARM64?

There were no problems for the first few arguments for x86_64abi (specifically we used public static extern IntPtr sem_open(string name, int oflag, ushort mode, uint value)) because they are also passed via registers (as per https://refspecs.linuxbase.org/elf/x86_64-abi-0.21.pdf), but on Apple Silicon variadic arguments are passed on the stack (https://developer.apple.com/documentation/xcode/writing_arm64_code_for_apple_platforms#3671957). Does CLR support such calling conventions?

Linked issue: #9702

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions