[PATCH 3.0] leb128 test yields 'Linux: integer expression expected'

Phil Edwards phil@jaj.com
Fri Feb 1 15:34:00 GMT 2002


Debian's assembler has its --version output tweaked to read

    69% /usr/bin/as --version 2> /dev/null
    GNU assembler 2.11.92.0.12.3 20011121 Debian/GNU Linux
    [stuff]
    70%

After confirming that it is GNU as in use, gcc/configure.in then runs the
top line through "sed -e 's,.* ,,'" apparently under the assumption that
the number will be the last thing printed on that line.

Under Debian, this means that the as_ver string is set to "Linux", and
then all the tests for major/minor version numbers fail.

I've changed the sed arguments to use , instead of / as a delimiter, and
moved the changequote line up a little, since this uses bracketed ranges
to grab the number string:

    17% echo $asver
    GNU assembler 2.11.92.0.12.3 20011121 Debian/GNU Linux
    18% echo $asver | sed -e 's,[^0-9]*,,' -e 's, .*,,'
    2.11.92.0.12.3
    19%

This patch is against 3.0.3.  It fixes the configure run under Debian
but should probably be tested on other GNU binutils-using platforms
before applying.  My Red Hat boxes are production machines with no spare
computer cycles.



--- 3/gcc/configure.in	Thu Dec  6 04:00:10 2001
+++ 3.0.3-3.0.96/gcc/configure.in	Fri Feb  1 18:24:19 2002
@@ -1328,10 +1328,10 @@ EOF
 		# arbitrary sections are supported and try the test.
 		as_ver=`$gcc_cv_as --version 2>/dev/null | head -1`
 		if echo "$as_ver" | grep GNU > /dev/null; then
-			as_ver=`echo $as_ver | sed -e 's/.* //'`
-			as_major=`echo $as_ver | sed 's/\..*//'`
 changequote(,)dnl
-			as_minor=`echo $as_ver | sed 's/[^.]*\.\([0-9]*\).*/\1/'`
+			as_ver=`echo $as_ver | sed -e 's,[^0-9]*,,' -e 's, .*,,'`
+			as_major=`echo $as_ver | sed 's,\..*,,'`
+			as_minor=`echo $as_ver | sed 's,[^.]*\.\([0-9]*\).*,\1,'`
 changequote([,])dnl
 			if test $as_major -eq 2 -a $as_minor -lt 11; then
 				gcc_cv_as_leb128="no"



More information about the Gcc-bugs mailing list