PATCH: [4.1/4.2/4.3]: Gcc failed to detect Linux linker version

Richard Guenther richard.guenther@gmail.com
Fri Sep 21 16:19:00 GMT 2007


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)

but the variant used in libstdc++v3/acinclude.m4 does:

    ldver=`$LD --version 2>/dev/null | head -1 | \
           sed -e 's/GNU ld \(version \)\{0,1\}\(([^)]*)
\)\{0,1\}\([0-9.][0-9.]*\).*/\3/'`

it also looks simpler ;)

Richard.



More information about the Gcc-patches mailing list