Ralf Wildenhues wrote: > Hi Peter, > > * Peter O'Gorman wrote on Tue, Sep 02, 2008 at 05:50:33PM CEST: >> On an hpux10.20 system with ARG_MAX at 20KB, we still got "Arg list too >> long" when linking. It worked when I edited the libtool script and set >> max_cmd_len to 10K instead of 15. >> >> For systems with a large value of ARG_MAX, setting max_cmd_len to 75% >> still seems reasonable though. >> >> Ok to push? > > There is little reason to believe that the number of arguments that the > C++ driver adds, plus the size of the environment, scales linearly with > ARG_MAX[1]. So why not subtract a reasonable constant amount in the > first place?
I was also thinking of something like (pseudocode): if ARG_MAX > 80K max_cmd_len=ARG_MAX - 40K else max_cmd_len=ARG_MAX / 2 endif Because you're right, we may be penalizing systems with large ARG_MAX unnecessarily. The problem is that you have to make up the constants etc, and I was attempting to follow what had been done previously (in old libtools max_cmd_len was set to 50% of the calculated value, it was changed to 75% along with the patch to use getconf ARG_MAX, iirc). Anyway, what formula do you think reasonable? Peter -- Peter O'Gorman http://pogma.com
