Andrei Borzenkov <arvidj...@gmail.com> writes: > 19.08.2015 21:35, Mark H Weaver пишет: >> Include -mabi=32 in CFLAGS_PLATFORM and CCASFLAGS_PLATFORM to compile >> code for the O32 ABI when targetting MIPS, since the MIPS assembly code >> in GRUB assumes this. This flag is also needed when compiling >> asm-tests/mips.S from configure, because GNU as rejects MIPS register >> names such as $t2 unless the O32 ABI is selected. >> --- >> conf/Makefile.common | 4 ++++ >> configure.ac | 7 +++++-- >> 2 files changed, 9 insertions(+), 2 deletions(-) >> >> diff --git a/conf/Makefile.common b/conf/Makefile.common >> index fcb8d2e..bd125da 100644 >> --- a/conf/Makefile.common >> +++ b/conf/Makefile.common >> @@ -20,6 +20,10 @@ endif >> if COND_powerpc_ieee1275 >> CFLAGS_PLATFORM += -mcpu=powerpc >> endif >> +if COND_mips >> + CFLAGS_PLATFORM += -mabi=32 >> + CCASFLAGS_PLATFORM = -mabi=32 >> +endif >> > > Does it work with clang?
Based on the error message below, clang seems to accept and understand the -mabi=32 option, but the version of clang that we have in GNU Guix (which uses the N32 ABI on MIPS) seems to lack support for compiling for O32: mhw@librenote:~$ clang -mabi=32 mips.S error: unknown target CPU 'mips32r2' However, it doesn't work without that option either: mhw@librenote:~$ clang mips.S mips.S: Assembler messages: mips.S:7: Error: invalid operands `ld $t2,0($t6)' mips.S:10: Error: invalid operands `addiu $t7,$s0,(b-a)' clang-3.6: error: assembler command failed with exit code 1 (use -v to see invocation) This is the same failure that occurs with gcc when configured to use the N32 ABI by default. I also tried passing -fno-integrated-as in both cases above, but it made no difference. Mark _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel