Skip to content

Doesn't detect change to x64 ABI calling convention due to C++ struct definition change #128

@unwiredben

Description

@unwiredben

Here's a fun issue that I found recently.

In the x64 System V ABI, the calling convention used to pass structs via registers as opposed to via pointers to memory depends on if the struct is considered trivial according to the Itanium C++ ABI.

This means that if you define this struct

struct v {
    float a, b;
};

it can be passed in a single SSE register. However, if you add an empty destructor

struct v {
    float a, b;
    ~v() { }
};

then the class becomes non-trivial and it has to be passed via a pointer instead.

This didn't affect ARM32 compilation (the struct was too large for a register) or MIPS32 compilation (only uses pointers), but broke when build for a desktop simulator.

abi-tests.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions