This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: [4.1/4.2/4.3]: Gcc failed to detect Linux linker version
On Sun, Sep 23, 2007 at 06:22:16PM +0200, Richard Guenther wrote:
> On 9/23/07, Richard Guenther <richard.guenther@gmail.com> wrote:
> > On 9/23/07, H.J. Lu <hjl@lucon.org> wrote:
> > > On Fri, Sep 21, 2007 at 05:48:32PM +0200, Richard Guenther wrote:
> > > > On 9/13/07, H.J. Lu <hjl@lucon.org> wrote:
> > > > > On Thu, Sep 13, 2007 at 12:09:44PM -0700, H.J. Lu wrote:
> > > > > > On Thu, Sep 13, 2007 at 11:45:11AM -0700, Mark Mitchell wrote:
> > > > > > > Paolo Bonzini wrote:
> > > > > > > > H.J. Lu wrote:
> > > > > > > >> Linux linker version is reported as 2.18.50.0.2.20070912. configure
> > > > > > > >> failed to parse it. This patch fixes. Tested on Linux/x86-64. OK
> > > > > > > >> to install to 4.1/4.2/4.3?
> > > > > > > >
> > > > > > > > Ok for 4.1 and 4.3. For 4.2, ask Mark.
> > > > > > >
> > > > > > > OK.
> > > > > > >
> > > > > > > (But, can we please stop making the GNU/Linux linker version numbers
> > > > > > > ever weirder? We seem to have a patch like this rather often...)
> > > > > > >
> > > > > >
> > > > > > I will see if I can come up with a better approach to parse linker
> > > > > > version.
> > > > > >
> > > > > >
> > > > >
> > > > > I have seen
> > > > >
> > > > > GNU ld version 2.17.50.0.6-5.fc6 20061020
> > > > > GNU ld version 2.17.50.0.12-4 20070128
> > > > > GNU ld version 2.15.92.0.2 20040927
> > > > > GNU ld (GNU Binutils) 2.18.50.20070913
> > > > > GNU ld (Linux/GNU Binutils) 2.18.50.0.1.20070906
> > > > >
> > > > > This patch can handle any GNU linker version starting with xx.xx.*
> > > >
> > > > It doesn't handle
> > > >
> > > > > ld --version
> > > > GNU ld (GNU Binutils) 2.17.50.20070726-12 (SUSE Linux)
> > > >
> > >
> > > Have you tried my patch? I got
> > >
> > > # ./check "GNU ld (GNU Binutils) 2.17.50.20070726-12 (SUSE Linux)"
> > > ld_ver: GNU ld (GNU Binutils) 2.17.50.20070726-12 (SUSE Linux)
> > > ld_vers: 2.17.50.20070726-12 (SUSE Linux)
> > > ld_date: 20070726
> > > ld_vers_major: 2
> > > ld_vers_minor: 17
> > > ld_vers_patch: 50
> >
> > Yes, I tried your patch, but somehow it didn't work. Maybe an error
> > on my side though - I'll retry.
>
> While the version in the script from you below matches the version,
> the patched 4.2 branch version does not. It reads:
>
> echo $ld_ver | sed -n \
> -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]*\.[0-9][0-9]*\)$,\1,p'
> \
> -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'`
>
> and produces an empty ld_vers string.
Here is my acutal patch as in
http://gcc.gnu.org/ml/gcc-patches/2007-09/msg01207.html
Are you sure you are using the right patch? If yes, can you send me
your
# ld_ver=`ld --version 2>/dev/null | sed 1q`
# echo xxx${ld_ver}xxxx
Thanks.
H.J.
----
2007-09-13 H.J. Lu <hongjiu.lu@intel.com>
* configure.ac (ld_vers): Support GNU linker version xx.xx.*
* configure: Regenerated.
--- gcc/configure.ac.version 2007-09-13 12:47:28.000000000 -0700
+++ gcc/configure.ac 2007-09-13 12:49:31.000000000 -0700
@@ -2066,10 +2066,7 @@ else
if echo "$ld_ver" | grep GNU > /dev/null; then
changequote(,)dnl
ld_vers=`echo $ld_ver | sed -n \
- -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]*\.[0-9][0-9]*\)$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*.*\)$,\1,p' \
-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' \
--- gcc/configure.version 2007-09-13 12:47:32.000000000 -0700
+++ gcc/configure 2007-09-13 12:49:51.000000000 -0700
@@ -14047,10 +14047,7 @@ else
ld_ver=`$gcc_cv_ld --version 2>/dev/null | sed 1q`
if echo "$ld_ver" | grep GNU > /dev/null; then
ld_vers=`echo $ld_ver | sed -n \
- -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]*\.[0-9][0-9]*\)$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*.*\)$,\1,p' \
-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' \