Support building for multiple MIPS ABIs: o32 (default), n32 and eabi32#135
Support building for multiple MIPS ABIs: o32 (default), n32 and eabi32#135Yanis002 merged 5 commits intoHackerN64:mainfrom
Conversation
sauraen
left a comment
There was a problem hiding this comment.
Looks good and eabi32 works for me (builds and seems to run fine on console).
n32 does not work for me, I get Fatal error: selected target format 'elf32-nbigmips' unknown from the assembler.
>hackeroot_clean$ mips64-as --version
GNU assembler (GNU Binutils) 2.39
Copyright (C) 2022 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `mips64'.
>hackeroot_clean$ which mips64-as
/opt/n64/bin/mips64-as
Is there a reason we don't move to eabi by default?
|
Could you show the output of We may want to consider moving to eabi32 by default at some point, but it can probably be done after the initial support is in. |
|
|
On my system I also have a |
|
It looks like your compiled mips64 toolchain wasn't configured to include the n32 elf format. mips-linux-gnu can compile and link n32 using the irix 6 / "trad" formats which are supported by this build system ( Is this glank's toolchain? If so, it received an update a little while ago that lets it build for n32. |
sauraen
left a comment
There was a problem hiding this comment.
n32 also works with the latest glank toolchain. There is a separate issue with this toolchain and function prototypes being moved, but that is unrelated to this PR.
sauraen
left a comment
There was a problem hiding this comment.
I take back my last comment. The build issues are introduced by this PR, even though the PR does not change anything directly related to those headers.
sauraen
left a comment
There was a problem hiding this comment.
Works for me now. Thanks for changing to a newer ABI by default.
|
I'll have to test this again before merging it, I mixed things up with the lighting engine PR, I think I got build issues on this branch and not the other one |
|
I'll try this again soon, I think I had some issues building this but idk maybe it's fine now, if everything's fine I'll merge this |
Yanis002
left a comment
There was a problem hiding this comment.
seems to work properly for me 🎉
|
will merge once CI is done, sorry for the long wait 🙏 |
The MIPS Application Binary Interface (ABI) dictates code generation conventions such as register sizes and classification, stack frame layout and alignment, and floating-point register behavior. The default ABI that has been used so far is o32, the original 32-bit MIPS ABI that a reader may be familiar with if they have done any assembly hacking.
o32 features:
This PR adds support for the n32 and eabi32 ABIs. These are more recent MIPS ABIs that were designed to try to make better use of the evolving hardware. o32 was designed for MIPS I which lacked 64-bit instructions and double-precision floats were split into two 32-bit halves. The VR4300 processor is a MIPS III processor with 64-bit instructions and a more advanced floating-point coprocessor, so it can support these newer ABIs.
n32 features:
eabi32 features:
Each of these ABIs has their own pros and cons.