diff mbox

[build] Avoid ld -v error message with Sun ld on SPARC

Message ID yddhba50wtl.fsf@manam.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth April 11, 2011, 12:57 p.m. UTC
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.

Comments

David Miller April 11, 2011, 7:58 p.m. UTC | #1
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?
diff mbox

Patch

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