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

Non-default ABIs aren't supported #451

Open
sadlerap opened this issue Feb 21, 2024 · 1 comment
Open

Non-default ABIs aren't supported #451

sadlerap opened this issue Feb 21, 2024 · 1 comment

Comments

@sadlerap
Copy link
Contributor

sadlerap commented Feb 21, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants