[build] Don't assume ldd understands --version (PR other/45915)
Rainer Orth
ro@CeBiTec.Uni-Bielefeld.DE
Wed Jan 5 16:40:00 GMT 2011
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.
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]*\)"`
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
More information about the Gcc-patches
mailing list