Hello,

I have binutils 2.18
   $ ld --version
   GNU ld (GNU Binutils) 2.18
   ...

But during compilation I get following:

configure: WARNING: === Linker version 1800 is too old for
configure: WARNING: === full symbol versioning support in this release of GCC.
configure: WARNING: === You would need to upgrade your binutils to version
configure: WARNING: === 21400 or later and rebuild GCC.
configure: WARNING: === Symbol versioning will be disabled.

I've found out that in two configure scripts linker version is
determined with following regexp:

../gcc-4.2.2/libstdc++-v3/configure (this script contains a few similar lines 
with linker definition)
    ldver=`$LD --version 2>/dev/null | head -1 | \
           sed -e 's/GNU ld \(version \)\{0,1\}\(([^)]*) 
\)\{0,1\}\([0-9.][0-9.]*\).*/\3/'`

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

That regexps are incorrect for ld 2.18.

I think it is better to use following regexp:
  ldver=`$LD --version 2>/dev/null | head -1 | sed -e 's/GNU .* 
\([0-9][0-9.]*\)[. ]*$/\1/'`

or to be stricter and handle only "ld":
  ldver=`$LD --version 2>/dev/null | head -1 | sed -e 's/GNU ld .* 
\([0-9][0-9.]*\)[. ]*$/\1/'`

It takes last word that starts and ends with digit and consist of digits and 
dots.
And this (first example) regexp can be applied to many GNU programs (as, ar, 
nm, etc)

Best regards.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Yevgeniy Litvinenko
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply via email to