public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [build] Avoid ld -v error message with Sun ld on SPARC
@ 2011-04-11 12:58 Rainer Orth
  2011-04-11 19:59 ` David Miller
  0 siblings, 1 reply; 11+ messages in thread
From: Rainer Orth @ 2011-04-11 12:58 UTC (permalink / raw)
  To: gcc-patches; +Cc: Eric Botcazou, David S. Miller, Paolo Bonzini

While observing the output from gcc/configure on Solaris 11/SPARC, I
noticed the following error:

checking assembler for GOTDATA_OP relocs... ld: fatal: unrecognized option '-v'
ld: fatal: use the -z help option for usage information
yes

There are at least two problems here:

* Sun ld doesn't support -v, but uses -V instead.

* One should check ld_ver instead, as done in many other places.

* Why would one check for GNU ld at all?  If one can detect from the
  output if the linker used is buggy or not, it shouldn't matter.  The
  only reason I could see is avoiding to rely on objdump on Solaris, but
  that is used in too many other places to be a real issue.

The follwing patch uses the easy way out and just tests ld_ver.  Tested
with make configure-gcc on sparc-sun-solaris2.11 with Sun as/ld, GNU
as/Sun ld, and GNU as/ld without change to gcc/auto-host.h and no linker
error.

Ok for mainline?

	Rainer


2011-04-09  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* configure.ac (gcc_cv_as_sparc_gotdata_op): Test ld_ver instead
	of $gcc_cv_ld -v.
	* configure: Regenerate.

diff --git a/gcc/configure.ac b/gcc/configure.ac
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -3344,7 +3344,7 @@ bar:
 	ld    [[%l7 + %g1]], %g2, %gdop(foo)],
       [if test x$gcc_cv_ld != x \
        && $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1; then
-         if $gcc_cv_ld -v | grep GNU >/dev/null 2>&1; then
+	 if echo "$ld_ver" | grep GNU > /dev/null; then
            if test x$gcc_cv_objdump != x; then
              if $gcc_cv_objdump -s -j .text conftest 2> /dev/null \
                 | grep ' 03000004 82186004 c405c001'> /dev/null 2>&1; then

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

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

* Re: [build] Avoid ld -v error message with Sun ld on SPARC
  2011-04-11 12:58 [build] Avoid ld -v error message with Sun ld on SPARC Rainer Orth
@ 2011-04-11 19:59 ` David Miller
  2011-04-12 13:01   ` Rainer Orth
  0 siblings, 1 reply; 11+ messages in thread
From: David Miller @ 2011-04-11 19:59 UTC (permalink / raw)
  To: ro; +Cc: gcc-patches, ebotcazou, bonzini

From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Date: Mon, 11 Apr 2011 14:57:58 +0200

> The follwing patch uses the easy way out and just tests ld_ver.  Tested
> with make configure-gcc on sparc-sun-solaris2.11 with Sun as/ld, GNU
> as/Sun ld, and GNU as/ld without change to gcc/auto-host.h and no linker
> error.

Just out of curiosity, do the Sun tools pass the GOTDATA_OP test?

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

* Re: [build] Avoid ld -v error message with Sun ld on SPARC
  2011-04-11 19:59 ` David Miller
@ 2011-04-12 13:01   ` Rainer Orth
  2011-04-12 22:51     ` David Miller
  0 siblings, 1 reply; 11+ messages in thread
From: Rainer Orth @ 2011-04-12 13:01 UTC (permalink / raw)
  To: David Miller; +Cc: gcc-patches, ebotcazou, bonzini

David Miller <davem@davemloft.net> writes:

> From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
> Date: Mon, 11 Apr 2011 14:57:58 +0200
>
>> The follwing patch uses the easy way out and just tests ld_ver.  Tested
>> with make configure-gcc on sparc-sun-solaris2.11 with Sun as/ld, GNU
>> as/Sun ld, and GNU as/ld without change to gcc/auto-host.h and no linker
>> error.
>
> Just out of curiosity, do the Sun tools pass the GOTDATA_OP test?

It depends:

		as/ld	gas/ld	gas/gld
Solaris 8	no	no	yes
Solaris 9       no      no      yes
Solaris 10      yes     no      yes
Solaris 11      yes     yes     yes

On Solaris 8 and 9, as fails to assemble the testcase, with gas, ld
SEGVs when linking.

On Solaris 10, as assembles the test just fine, but ld cannot deal with
gas 2.21 output:

ld: fatal: relocation error: R_SPARC_GOTDATA_HIX22: file gotdata.o: symbol <unknown>: offset 0xff370163 is non-aligned
ld: fatal: relocation error: R_SPARC_GOTDATA_LOX10: file gotdata.o: symbol <unknown>: offset 0xff370167 is non-aligned
ld: fatal: file gotdata: creation interrupted: Error 0

On Solaris 11, all is fine.

I get the same results with an unmodifed tree and the following
simplified version of my patch.

Ok for mainline?

	Rainer


2011-04-09  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* configure.ac (gcc_cv_as_sparc_gotdata_op): Remove GNU ld check.
	* configure: Regenerate.

diff --git a/gcc/configure.ac b/gcc/configure.ac
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -3305,17 +3305,13 @@ bar:
 	ld    [[%l7 + %g1]], %g2, %gdop(foo)],
       [if test x$gcc_cv_ld != x \
        && $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1; then
-         if $gcc_cv_ld -v | grep GNU >/dev/null 2>&1; then
-           if test x$gcc_cv_objdump != x; then
-             if $gcc_cv_objdump -s -j .text conftest 2> /dev/null \
-                | grep ' 03000004 82186004 c405c001'> /dev/null 2>&1; then
+         if test x$gcc_cv_objdump != x; then
+           if $gcc_cv_objdump -s -j .text conftest 2> /dev/null \
+              | grep ' 03000004 82186004 c405c001'> /dev/null 2>&1; then
 	       gcc_cv_as_sparc_gotdata_op=no
-             else
+           else
 	       gcc_cv_as_sparc_gotdata_op=yes
-             fi
            fi
-         else
-	   gcc_cv_as_sparc_gotdata_op=yes
          fi
        fi
        rm -f conftest],

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

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

* Re: [build] Avoid ld -v error message with Sun ld on SPARC
  2011-04-12 13:01   ` Rainer Orth
@ 2011-04-12 22:51     ` David Miller
  2011-04-13 17:16       ` Rainer Orth
  0 siblings, 1 reply; 11+ messages in thread
From: David Miller @ 2011-04-12 22:51 UTC (permalink / raw)
  To: ro; +Cc: gcc-patches, ebotcazou, bonzini

From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Date: Tue, 12 Apr 2011 15:00:53 +0200

> On Solaris 10, as assembles the test just fine, but ld cannot deal with
> gas 2.21 output:
> 
> ld: fatal: relocation error: R_SPARC_GOTDATA_HIX22: file gotdata.o: symbol <unknown>: offset 0xff370163 is non-aligned
> ld: fatal: relocation error: R_SPARC_GOTDATA_LOX10: file gotdata.o: symbol <unknown>: offset 0xff370167 is non-aligned
> ld: fatal: file gotdata: creation interrupted: Error 0

Really strange error message, could you see if adding something as simply as
".align 4" after the ".text" in the test assembler makes this go away?

> 
> On Solaris 11, all is fine.
> 
> I get the same results with an unmodifed tree and the following
> simplified version of my patch.
> 
> Ok for mainline?

I'm fine with this patch, we can try to attack the above problem independently.

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

* Re: [build] Avoid ld -v error message with Sun ld on SPARC
  2011-04-12 22:51     ` David Miller
@ 2011-04-13 17:16       ` Rainer Orth
  2011-04-13 17:54         ` David Miller
  0 siblings, 1 reply; 11+ messages in thread
From: Rainer Orth @ 2011-04-13 17:16 UTC (permalink / raw)
  To: David Miller; +Cc: gcc-patches, ebotcazou, bonzini

David Miller <davem@davemloft.net> writes:

> From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
> Date: Tue, 12 Apr 2011 15:00:53 +0200
>
>> On Solaris 10, as assembles the test just fine, but ld cannot deal with
>> gas 2.21 output:
>> 
>> ld: fatal: relocation error: R_SPARC_GOTDATA_HIX22: file gotdata.o: symbol <unknown>: offset 0xff370163 is non-aligned
>> ld: fatal: relocation error: R_SPARC_GOTDATA_LOX10: file gotdata.o: symbol <unknown>: offset 0xff370167 is non-aligned
>> ld: fatal: file gotdata: creation interrupted: Error 0
>
> Really strange error message, could you see if adding something as simply as
> ".align 4" after the ".text" in the test assembler makes this go away?

yep, that does the trick.

>> Ok for mainline?
>
> I'm fine with this patch, we can try to attack the above problem independently.

Thanks, installed.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

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

* Re: [build] Avoid ld -v error message with Sun ld on SPARC
  2011-04-13 17:16       ` Rainer Orth
@ 2011-04-13 17:54         ` David Miller
  2011-04-14 19:40           ` Rainer Orth
  2011-04-18 17:24           ` Rainer Orth
  0 siblings, 2 replies; 11+ messages in thread
From: David Miller @ 2011-04-13 17:54 UTC (permalink / raw)
  To: ro; +Cc: gcc-patches, ebotcazou, bonzini

From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Date: Wed, 13 Apr 2011 19:16:32 +0200

> David Miller <davem@davemloft.net> writes:
> 
>> From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
>> Date: Tue, 12 Apr 2011 15:00:53 +0200
>>
>>> On Solaris 10, as assembles the test just fine, but ld cannot deal with
>>> gas 2.21 output:
>>> 
>>> ld: fatal: relocation error: R_SPARC_GOTDATA_HIX22: file gotdata.o: symbol <unknown>: offset 0xff370163 is non-aligned
>>> ld: fatal: relocation error: R_SPARC_GOTDATA_LOX10: file gotdata.o: symbol <unknown>: offset 0xff370167 is non-aligned
>>> ld: fatal: file gotdata: creation interrupted: Error 0
>>
>> Really strange error message, could you see if adding something as simply as
>> ".align 4" after the ".text" in the test assembler makes this go away?
> 
> yep, that does the trick.
> 
>>> Ok for mainline?
>>
>> I'm fine with this patch, we can try to attack the above problem independently.
> 
> Thanks, installed.

Thanks Rainer, if you cons up a patch to add the ".align" directive I'll ACK
that as well.

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

* Re: [build] Avoid ld -v error message with Sun ld on SPARC
  2011-04-13 17:54         ` David Miller
@ 2011-04-14 19:40           ` Rainer Orth
  2011-04-18 17:24           ` Rainer Orth
  1 sibling, 0 replies; 11+ messages in thread
From: Rainer Orth @ 2011-04-14 19:40 UTC (permalink / raw)
  To: David Miller; +Cc: gcc-patches, ebotcazou, bonzini

David Miller <davem@davemloft.net> writes:

> Thanks Rainer, if you cons up a patch to add the ".align" directive I'll ACK
> that as well.

That's my plan: I'll include such a patch in my S8 to S11 bootstraps
over the weekend to make sure nothing breaks.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

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

* Re: [build] Avoid ld -v error message with Sun ld on SPARC
  2011-04-13 17:54         ` David Miller
  2011-04-14 19:40           ` Rainer Orth
@ 2011-04-18 17:24           ` Rainer Orth
  2011-04-26 15:57             ` Rainer Orth
  1 sibling, 1 reply; 11+ messages in thread
From: Rainer Orth @ 2011-04-18 17:24 UTC (permalink / raw)
  To: David Miller; +Cc: gcc-patches, ebotcazou, bonzini

David,

> Thanks Rainer, if you cons up a patch to add the ".align" directive I'll ACK
> that as well.

here's the patch that I've been testing over the weekend.  It caused no
change for HAVE_AS_SPARC_GOTDATA_OP on anything but Solaris 10 with gas
and Sun ld, where HAVE_AS_SPARC_GOTDATA_OP is 1 now, and that
configuration showed no testsuite regressions.

Ok for mainline?

Thanks.
	Rainer


2011-04-15  David S. Miller  <davem@davemloft.net>
	    Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* configure.ac (gcc_cv_as_sparc_gotdata_op): Specify alignment.
	* configure: Regenerate.

diff --git a/gcc/configure.ac b/gcc/configure.ac
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -3270,6 +3270,7 @@ case "$target" in
       gcc_cv_as_sparc_gotdata_op,,
       [-K PIC],
 [.text
+.align 4
 foo:
 	nop
 bar:

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

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

* Re: [build] Avoid ld -v error message with Sun ld on SPARC
  2011-04-18 17:24           ` Rainer Orth
@ 2011-04-26 15:57             ` Rainer Orth
  2011-04-26 17:36               ` Paolo Bonzini
  2011-04-26 20:23               ` David Miller
  0 siblings, 2 replies; 11+ messages in thread
From: Rainer Orth @ 2011-04-26 15:57 UTC (permalink / raw)
  To: David Miller; +Cc: gcc-patches, ebotcazou, bonzini

David,

>> Thanks Rainer, if you cons up a patch to add the ".align" directive I'll ACK
>> that as well.
>
> here's the patch that I've been testing over the weekend.  It caused no
> change for HAVE_AS_SPARC_GOTDATA_OP on anything but Solaris 10 with gas
> and Sun ld, where HAVE_AS_SPARC_GOTDATA_OP is 1 now, and that
> configuration showed no testsuite regressions.
>
> Ok for mainline?

it's been a week since I've submitted this patch.  Or should I take it
as preapproved?

Thanks.
        Rainer


> 2011-04-15  David S. Miller  <davem@davemloft.net>
> 	    Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
>
> 	* configure.ac (gcc_cv_as_sparc_gotdata_op): Specify alignment.
> 	* configure: Regenerate.
>
> diff --git a/gcc/configure.ac b/gcc/configure.ac
> --- a/gcc/configure.ac
> +++ b/gcc/configure.ac
> @@ -3270,6 +3270,7 @@ case "$target" in
>        gcc_cv_as_sparc_gotdata_op,,
>        [-K PIC],
>  [.text
> +.align 4
>  foo:
>  	nop
>  bar:

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

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

* Re: [build] Avoid ld -v error message with Sun ld on SPARC
  2011-04-26 15:57             ` Rainer Orth
@ 2011-04-26 17:36               ` Paolo Bonzini
  2011-04-26 20:23               ` David Miller
  1 sibling, 0 replies; 11+ messages in thread
From: Paolo Bonzini @ 2011-04-26 17:36 UTC (permalink / raw)
  To: Rainer Orth; +Cc: David Miller, gcc-patches, ebotcazou

On 04/26/2011 05:25 PM, Rainer Orth wrote:
> David,
>
>>> Thanks Rainer, if you cons up a patch to add the ".align" directive I'll ACK
>>> that as well.
>>
>> here's the patch that I've been testing over the weekend.  It caused no
>> change for HAVE_AS_SPARC_GOTDATA_OP on anything but Solaris 10 with gas
>> and Sun ld, where HAVE_AS_SPARC_GOTDATA_OP is 1 now, and that
>> configuration showed no testsuite regressions.
>>
>> Ok for mainline?
>
> it's been a week since I've submitted this patch.  Or should I take it
> as preapproved?
>
> Thanks.
>          Rainer
>
>
>> 2011-04-15  David S. Miller<davem@davemloft.net>
>> 	Rainer Orth<ro@CeBiTec.Uni-Bielefeld.DE>
>>
>> 	* configure.ac (gcc_cv_as_sparc_gotdata_op): Specify alignment.
>> 	* configure: Regenerate.
>>
>> diff --git a/gcc/configure.ac b/gcc/configure.ac
>> --- a/gcc/configure.ac
>> +++ b/gcc/configure.ac
>> @@ -3270,6 +3270,7 @@ case "$target" in
>>         gcc_cv_as_sparc_gotdata_op,,
>>         [-K PIC],
>>   [.text
>> +.align 4
>>   foo:
>>   	nop
>>   bar:
>

I was waiting for David or Eric to approve it since I know nothing about 
this stuff. :)

Paolo

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

* Re: [build] Avoid ld -v error message with Sun ld on SPARC
  2011-04-26 15:57             ` Rainer Orth
  2011-04-26 17:36               ` Paolo Bonzini
@ 2011-04-26 20:23               ` David Miller
  1 sibling, 0 replies; 11+ messages in thread
From: David Miller @ 2011-04-26 20:23 UTC (permalink / raw)
  To: ro; +Cc: gcc-patches, ebotcazou, bonzini

From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Date: Tue, 26 Apr 2011 17:25:56 +0200

> David,
> 
>>> Thanks Rainer, if you cons up a patch to add the ".align" directive I'll ACK
>>> that as well.
>>
>> here's the patch that I've been testing over the weekend.  It caused no
>> change for HAVE_AS_SPARC_GOTDATA_OP on anything but Solaris 10 with gas
>> and Sun ld, where HAVE_AS_SPARC_GOTDATA_OP is 1 now, and that
>> configuration showed no testsuite regressions.
>>
>> Ok for mainline?
> 
> it's been a week since I've submitted this patch.  Or should I take it
> as preapproved?
> 

I'm sorry about this, I must have missed it inadvertantly.

ACK to this patch, thanks for your contributions.

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

end of thread, other threads:[~2011-04-26 18:22 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-11 12:58 [build] Avoid ld -v error message with Sun ld on SPARC Rainer Orth
2011-04-11 19:59 ` David Miller
2011-04-12 13:01   ` Rainer Orth
2011-04-12 22:51     ` David Miller
2011-04-13 17:16       ` Rainer Orth
2011-04-13 17:54         ` David Miller
2011-04-14 19:40           ` Rainer Orth
2011-04-18 17:24           ` Rainer Orth
2011-04-26 15:57             ` Rainer Orth
2011-04-26 17:36               ` Paolo Bonzini
2011-04-26 20:23               ` David Miller

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).