[Bug bootstrap/33781] [4.3 Regression] "Arg list too long" building libgcc.a

roger at eyesopen dot com gcc-bugzilla@gcc.gnu.org
Thu Nov 1 17:15:00 GMT 2007



------- Comment #4 from roger at eyesopen dot com  2007-11-01 17:15 -------
Thanks to both Jakub and DJ for their help.  I just tried out the suggested
patch on my IRIX box, and was surprised that it didn't resolve the error.
My apologies that my initial analysis might have been wrong (or incomplete),
but it looks like the error occurs earlier on the same command line.

Not only does,

  objects="$(objects)" ; $(AR_CREATE_FOR_TARGET) $@ $$objects

Infact, stripping the command back to just

  objects="$(objects)"

is enough to trigger the error.  Hoping that this was perhaps a limitation
of IRIX's /bin/sh, I've tried again with SHELL=/usr/local/bin/bash but alas
I get the same error.

make: execvp: /usr/local/bin/bash: Arg list too long

So it's not a bound on argc or the number of entries in argv[] that's the
problem, but a hard limitation on command line length.


So it looks like we can't even assign $objects yet alone use it, either
directly or looping over it to use xargs.  Perhaps we could do something
with "find".  Just a wild guess here as I don't understand build machinery
but something like:

  find . -name '*.o' -exec ar rc libgcc.a {} \;

And then test afterwards

  if test ! -f libgcc.a ; then
    {the eh_dummy.o stuff to avoid empty libgcc.a} ;
  fi


I'm not sure why I'm seeing this.  There mustn't be many IRIX testers for
mainline and either MIPS is building more objects than other platforms (for
saturating and fixed point math) or most OSes are less "restricted" than
IRIX.

Many thanks again for peoples help.  Is "find" portable, or is there a
better way to achieve the same thing without ever placing all of the filenames
on a single command line?

Sorry for any inconvenience.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33781



More information about the Gcc-bugs mailing list