diff mbox

[build] Don't assume ldd understands --version (PR other/45915)

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

Commit Message

Rainer Orth Jan. 5, 2011, 4:33 p.m. UTC
The following trivial patch fixes PR other/45915.  I suppose ldd
--version only works on glibc-based systems; otherwise one might have to
deal with different output formats.

Anyway, the patch makes the error (from expr in my case) during
configure go away during i386-pc-solaris2.11 testing.

Ok for mainline?

	Rainer


2011-01-03  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	PR other/45915
	* configure.ac (gcc_cv_as_gnu_unique_object): Only use ldd
	--version output if supported.
	* configure: Regenerate.

Comments

Alexandre Oliva Jan. 6, 2011, 9:33 a.m. UTC | #1
On Jan  5, 2011, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote:

> 2011-01-03  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

> 	PR other/45915
> 	* configure.ac (gcc_cv_as_gnu_unique_object): Only use ldd
> 	--version output if supported.
> 	* configure: Regenerate.

Ok, thanks.
diff mbox

Patch

diff -r 21c87ea1460e gcc/configure.ac
--- a/gcc/configure.ac	Sun Jan 02 01:05:21 2011 +0100
+++ b/gcc/configure.ac	Mon Jan 03 10:46:02 2011 +0100
@@ -2,7 +2,7 @@ 
 # Process this file with autoconf to generate a configuration script.
 
 # Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 
 #This file is part of GCC.
 
@@ -3941,6 +3941,7 @@ 
    [.type foo, @gnu_unique_object],,
 # Also check for ld.so support, i.e. glibc 2.11 or higher.
    [[if test x$host = x$build -a x$host = x$target &&
+       ldd --version 2>/dev/null &&
        glibcver=`ldd --version 2>/dev/null | sed 's/.* //;q'`; then
       glibcmajor=`expr "$glibcver" : "\([0-9]*\)"`
       glibcminor=`expr "$glibcver" : "[2-9]*\.\([0-9]*\)"`