This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: configure warning - test: too many arguments


NightStrike wrote:
Whenever I do a make all-gcc, I get the following warning a portion of
the way through the process:

/cygdrive/m/build/gcc-core/gcc/gcc/configure: line 14040: test: too
many arguments

Any pointers as to where to start to troubleshoot that?

The place to start troubleshooting that is ${srcdir}/gcc/configure: line 14040


Looking at this, the shell script is trying to determine the version number of Binutils GAS by running the assembler and capturing the output of the --version option.

It took me a while to find out exaclty what was wrong a few weeks back when I was looking at this because I'm pretty new to shell scripts. However, running the sed command outside of the shell script enabled me to see that the problem lies with the fact that Binutils has changed the format of its version string.

It used to be
GNU assembler x.xx...
but now it is
GNU assembler (GNU Binutils) x.xx...

So, where the shell script was meant to be picking up two integers for the major and minor parts of the version, it was actually getting a string of GNU assembler (GNU Binutils) x.xx...

Here is the output of the original sed statement from configure (arm.txt contains the first line of the output of as --version)

b@CAD3 /c/gcc/binutils/install/bin
$ sed -e 's/GNU assembler \([0-9.][0-9.]*\).*/\1/' < arm.txt
GNU assembler (GNU Binutils) 2.17.50.20070730

There is no match, what we're looking for is the output from the following modified statement:

b@CAD3 /c/gcc/binutils/install/bin
$ sed -e 's/GNU assembler (GNU Binutils) \([0-9.][0-9.]*\).*/\1/' < arm.txt
2.17.50.20070730

Here is the combined statement to look for the old type, and the new type of version string:

b@CAD3 /c/gcc/binutils/install/bin
$ sed -e 's/GNU assembler \|GNU assembler (GNU Binutils) \([0-9.][0-9.]*\).*/\1
/' < arm.txt
2.17.50.20070730


Attached is a patch for ${srcdir}/gcc/configure.ac - you'll have to run autoconf to regenerate ${srcdir}/gcc/configure, or you can manually add the change to the configure file.

The test actually defaults on this error to the correct setting, i.e. the new version string formatting means that the check assumes the assembler is current enough, which of course, it is.

Best Regards,

Brian Sidebotham.
--- gcc/gcc/configure.ac	Mon Jul 30 10:18:27 2007
+++ gcc.patched/gcc/configure.ac	Mon Jul 30 10:45:48 2007
@@ -2105,7 +2105,7 @@ L2:],
   as_ver=`$gcc_cv_as --version 2>/dev/null | sed 1q`
   if echo "$as_ver" | grep GNU > /dev/null; then
 changequote(,)dnl
-    as_ver=`echo $as_ver | sed -e 's/GNU assembler \([0-9.][0-9.]*\).*/\1/'`
+    as_ver=`echo $as_ver | sed -e 's/GNU assembler \|GNU assembler (GNU Binutils) \([0-9.][0-9.]*\).*/\1/'`
     as_major=`echo $as_ver | sed 's/\..*//'`
     as_minor=`echo $as_ver | sed 's/[^.]*\.\([0-9]*\).*/\1/'`
 changequote([,])dnl

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]