From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ZTD9o-0004Lw-A6 for mharc-grub-devel@gnu.org; Sat, 22 Aug 2015 14:04:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58205) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTD9l-0004Lh-UF for grub-devel@gnu.org; Sat, 22 Aug 2015 14:04:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZTD9g-0002iv-SE for grub-devel@gnu.org; Sat, 22 Aug 2015 14:04:41 -0400 Received: from world.peace.net ([50.252.239.5]:45481) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTD9g-0002iq-P3 for grub-devel@gnu.org; Sat, 22 Aug 2015 14:04:36 -0400 Received: from [10.1.10.32] (helo=yeeloong) by world.peace.net with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1ZTD9Y-0003Hc-79; Sat, 22 Aug 2015 14:04:28 -0400 From: Mark H Weaver To: Andrei Borzenkov Subject: Re: [PATCH] Ensure that MIPS target code is compiled for the O32 ABI. References: <1440009323-8667-1-git-send-email-mhw@netris.org> <55D6A36D.205@gmail.com> Date: Sat, 22 Aug 2015 14:04:09 -0400 In-Reply-To: <55D6A36D.205@gmail.com> (Andrei Borzenkov's message of "Fri, 21 Aug 2015 07:05:01 +0300") Message-ID: <876147ryhy.fsf@netris.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 50.252.239.5 Cc: The development of GNU GRUB X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Aug 2015 18:04:42 -0000 Andrei Borzenkov writes: > 19.08.2015 21:35, Mark H Weaver =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >> Include -mabi=3D32 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 +=3D -mcpu=3Dpowerpc >> endif >> +if COND_mips >> + CFLAGS_PLATFORM +=3D -mabi=3D32 >> + CCASFLAGS_PLATFORM =3D -mabi=3D32 >> +endif >> > > Does it work with clang? Based on the error message below, clang seems to accept and understand the -mabi=3D32 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=3D32 mips.S=20 error: unknown target CPU 'mips32r2' However, it doesn't work without that option either: mhw@librenote:~$ clang mips.S=20 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 se= e 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