[PATCH] Make gcc/configure* ld version parser a little bit less strict

Jakub Jelinek jakub@redhat.com
Tue Nov 7 13:08:00 GMT 2006


Hi!

GCC ld version parser doesn't grok Fedora Core 6 and later ld --version
output (which includes also rpm %{release} number, as binutils broken
libtool stuff resulted in choosing installed libbfd instead of the newly
built libbfd, which sometimes aren't ABI compatible (remember libbfd
doesn't care about binary compatibility)).  As ld_date was parsed correctly,
the only result was that on FC6 and later HAVE_COMDAT_GROUP is 0 rather than
1 even when the included linker supports comdat just fine.

The following patch relaxes the tight version checking a little bit.

Ok for 4.3/4.2/4.1?

2006-11-07  Jakub Jelinek  <jakub@redhat.com>

	* configure.ac (ld_vers): Parse GNU ld version 2.17.50.0.3-6 20060715
	style versions.
	* configure: Rebuilt.

--- gcc/configure.ac.jj	2006-11-06 13:02:32.000000000 +0100
+++ gcc/configure.ac	2006-11-07 13:11:12.000000000 +0100
@@ -2116,7 +2116,7 @@ changequote(,)dnl
 	-e 's,^.*[	 ]\([0-9][0-9]*\.[0-9][0-9]*\)[	 ].*$,\1,p' \
 	-e 's,^.*[	 ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[	 ].*$,\1,p' \
 	-e 's,^.*[ 	 ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ 	].*$,\1,p' \
-	-e 's,^.*[	 ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[	 ].*$,\1,p'`
+	-e 's,^.*[	 ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[	 -].*$,\1,p'`
     ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'`
     ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'`
     ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'`
--- gcc/configure.jj	2006-11-06 13:02:32.000000000 +0100
+++ gcc/configure	2006-11-07 13:14:18.000000000 +0100
@@ -13959,7 +13959,7 @@ else
 	-e 's,^.*[	 ]\([0-9][0-9]*\.[0-9][0-9]*\)[	 ].*$,\1,p' \
 	-e 's,^.*[	 ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[	 ].*$,\1,p' \
 	-e 's,^.*[ 	 ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ 	].*$,\1,p' \
-	-e 's,^.*[	 ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[	 ].*$,\1,p'`
+	-e 's,^.*[	 ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[	 -].*$,\1,p'`
     ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'`
     ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'`
     ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'`

	Jakub



More information about the Gcc-patches mailing list