Skip to content

Non-default ABIs aren't supported #451

Open
@sadlerap

Description

@sadlerap

The following function miscompiles:

#[no_mangle]
extern "efiapi" fn efi(x: u32, y: u32) -> u32 {
    x * y
}

LLVM emits this:

efi:
        mov     eax, ecx
        imul    eax, edx
        ret

GCC emits this (notice the incorrect registers used for parameters):

efi:
        mov     eax, edi
        imul    eax, esi
        ret

As far as I can tell, we don't preserve the declared ABI since libgccjit doesn't have a way to annotate the ABI of functions with an annotated ABI. This needs to be implemented for ui/asm/x86_64/multiple-clobber-abi.rs to pass, which requires both the sysv64 and win64 extern abi to be supported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions