public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch, mips] fix JALR test in configure.ac
@ 2014-05-12 23:37 Sandra Loosemore
  2014-05-13  6:52 ` Richard Sandiford
  0 siblings, 1 reply; 2+ messages in thread
From: Sandra Loosemore @ 2014-05-12 23:37 UTC (permalink / raw)
  To: GCC Patches; +Cc: Catherine Moore, Richard Sandiford

[-- Attachment #1: Type: text/plain, Size: 1141 bytes --]

When configuring GCC for mips-linux-gnu, this happens:

configure:26145: checking assembler and linker for explicit JALR relocation
conftest.s: Assembler messages:
conftest.s:2: Internal error!
Assertion failure in macro_build at 
/scratch/sandra/mips-fsf/obj/binutils-src-mainline-0-mips-linux-gnu-i686-pc-linux-gnu/gas/config/tc-mips.c 
line 7953.
Please report this bug.

Probably this should be diagnosed as a user error instead of an assert 
failure on the binutils side, but on the GCC side, the assembly code 
being used for this configure test is incorrect and it would make the 
JALR relocation support test fail even if the assembler diagnosed it 
more nicely.  The trouble is that for the o32 ABI (the assembler 
default), the "ld" instruction being used in the test is really a macro 
that expands into 2 instructions.  This patch fixes it by substituting 
"lw", which allows the configure test to pass.

OK to commit?

-Sandra

2014-05-12  Catherine Moore  <clm@codesourcery.com>
	    Sandra Loosemore  <sandra@codesourcery.com>

	gcc/
	* configure.ac: Fix assembly for explicit JALR relocation check.
	* configure: Regenerate.

[-- Attachment #2: mips-configure.patch --]
[-- Type: text/x-patch, Size: 1427 bytes --]

Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac	(revision 210340)
+++ gcc/configure.ac	(working copy)
@@ -4206,8 +4206,8 @@ x:
         fi
       elif test x$gcc_cv_as != x -a x$gcc_cv_ld != x -a x$gcc_cv_objdump != x; then
         echo '	.ent x' > conftest.s
-        echo 'x:	ld $2,%got_disp(y)($3)' >> conftest.s
-        echo '	ld $25,%call16(y)($28)' >> conftest.s
+        echo 'x:	lw $2,%got_disp(y)($3)' >> conftest.s
+        echo '	lw $25,%call16(y)($28)' >> conftest.s
         echo '	.reloc	1f,R_MIPS_JALR,y' >> conftest.s
         echo '1:	jalr $25' >> conftest.s
         echo '	.reloc	1f,R_MIPS_JALR,x' >> conftest.s
Index: gcc/configure
===================================================================
--- gcc/configure	(revision 210340)
+++ gcc/configure	(working copy)
@@ -26153,8 +26153,8 @@ $as_echo_n "checking assembler and linke
         fi
       elif test x$gcc_cv_as != x -a x$gcc_cv_ld != x -a x$gcc_cv_objdump != x; then
         echo '	.ent x' > conftest.s
-        echo 'x:	ld $2,%got_disp(y)($3)' >> conftest.s
-        echo '	ld $25,%call16(y)($28)' >> conftest.s
+        echo 'x:	lw $2,%got_disp(y)($3)' >> conftest.s
+        echo '	lw $25,%call16(y)($28)' >> conftest.s
         echo '	.reloc	1f,R_MIPS_JALR,y' >> conftest.s
         echo '1:	jalr $25' >> conftest.s
         echo '	.reloc	1f,R_MIPS_JALR,x' >> conftest.s

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch, mips] fix JALR test in configure.ac
  2014-05-12 23:37 [patch, mips] fix JALR test in configure.ac Sandra Loosemore
@ 2014-05-13  6:52 ` Richard Sandiford
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Sandiford @ 2014-05-13  6:52 UTC (permalink / raw)
  To: Sandra Loosemore; +Cc: GCC Patches, Catherine Moore

Sandra Loosemore <sandra@codesourcery.com> writes:
> When configuring GCC for mips-linux-gnu, this happens:
>
> configure:26145: checking assembler and linker for explicit JALR relocation
> conftest.s: Assembler messages:
> conftest.s:2: Internal error!
> Assertion failure in macro_build at 
> /scratch/sandra/mips-fsf/obj/binutils-src-mainline-0-mips-linux-gnu-i686-pc-linux-gnu/gas/config/tc-mips.c 
> line 7953.
> Please report this bug.

Will try to look at that sometime...

> Probably this should be diagnosed as a user error instead of an assert 
> failure on the binutils side, but on the GCC side, the assembly code 
> being used for this configure test is incorrect and it would make the 
> JALR relocation support test fail even if the assembler diagnosed it 
> more nicely.  The trouble is that for the o32 ABI (the assembler 
> default), the "ld" instruction being used in the test is really a macro 
> that expands into 2 instructions.  This patch fixes it by substituting 
> "lw", which allows the configure test to pass.

OK, thanks.

Richard

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-05-13  6:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-12 23:37 [patch, mips] fix JALR test in configure.ac Sandra Loosemore
2014-05-13  6:52 ` Richard Sandiford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).