Skip to content

stage1 C ABI compatibility #1481

@andrewrk

Description

@andrewrk

This issue is to track C ABI compatibility support in the stage1 compiler.

Here's what support looks like currently:

  • integers, floats, pointers, enums, bools work on every target, as parameters and return values
  • x86_64: struct & union parameters & return values larger than 16 bytes
  • x86_64: struct & union parameters that have at least 1 integer in them
  • x86_64: struct & union parameters <= 16 bytes which break structs into parameters
  • x86_64: struct & union parameters <= 16 bytes which are all floats
  • x86_64: struct & union return values <= 16 bytes
  • ARM: struct & union return values
  • ARM: struct & union parameters
  • C ABI for parameters that is unsupported gives a compile error linking to this issue
  • C ABI for return values that is unsupported gives a compile error linking to this issue
  • other architectures structs & unions parameters & return values

For those who find this issue from the compile error, leave a comment detailing your specific needs and I'll see if I can code those up for you to unblock you, so you don't have to wait for this issue to be 100% solved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSolving this issue will likely involve adding new logic or components to the codebase.stage1The process of building from source via WebAssembly and the C backend.

    Type

    No type

    Projects

    Status

    Nice to have

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions