From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ZTsb2-0005MU-Ba for mharc-grub-devel@gnu.org; Mon, 24 Aug 2015 10:19:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51123) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTm2k-00014y-Ph for grub-devel@gnu.org; Mon, 24 Aug 2015 03:19:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZTm2h-0007xJ-Jx for grub-devel@gnu.org; Mon, 24 Aug 2015 03:19:46 -0400 Received: from mail-lb0-x234.google.com ([2a00:1450:4010:c04::234]:35864) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTm2h-0007xC-C4 for grub-devel@gnu.org; Mon, 24 Aug 2015 03:19:43 -0400 Received: by lbbpu9 with SMTP id pu9so74167908lbb.3 for ; Mon, 24 Aug 2015 00:19:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=0sA9s6QwCnqUmUoXYPcS4Ilq7z0ulbQ2GDtImuWumEk=; b=qXRi7g6lt/Ixj0TkAg6H5WS5voOBEQAnWpa9dkC+pSkZfp29gS6+5B+TP2nn40aanl 3vSq1MxU/98K1L2dduZU9Jykclrfh/6mzuB4heWI1EQkwxGB3gzHjEKjwLDY2FSk/S2L PmRrk5ahDNUe0oN7aHqMsq2FTX/ZP0y1TGZfxt/dE/IkjtpYQXmd1NIbJs64CS/QuDMI FNAsrrnAzqAHL/kUw7z/W3mn1hENj+jzWI49uzy+UvDOQFUAqGo6oVj/VWTxYpG/D9Nv FLCMqsCU589UjgmZOI3SwyIs8WDQ1U1WIhJe9K9m3YLzu7kUkMXeQumjMjo1wdsg/IuB fIQQ== X-Received: by 10.112.132.1 with SMTP id oq1mr19090509lbb.81.1440400782569; Mon, 24 Aug 2015 00:19:42 -0700 (PDT) Received: from [192.168.1.43] (ppp91-76-5-127.pppoe.mtu-net.ru. [91.76.5.127]) by smtp.gmail.com with ESMTPSA id rp6sm4801147lbb.44.2015.08.24.00.19.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Aug 2015 00:19:41 -0700 (PDT) Message-ID: <55DAC58C.1030105@gmail.com> Date: Mon, 24 Aug 2015 10:19:40 +0300 From: Andrei Borzenkov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: Mark H Weaver 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> <876147ryhy.fsf@netris.org> In-Reply-To: <876147ryhy.fsf@netris.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::234 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: Mon, 24 Aug 2015 07:19:47 -0000 22.08.2015 21:04, Mark H Weaver пишет: > Andrei Borzenkov 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. > Could you paste "clang -v" output for both cases? I believe I understand what's going on.