This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: [MinGW-dvlpr] Re: Cygwin / MSYS Command-Line-Length Issues? (wasRe: GC Problems...)
Simon Levitt wrote:
> On Wednesday 22 September 2004 02:33, Aaron W. LaFramboise wrote:
>
>>$(libgcj_la_OBJECTS) expands to a huge list of objects, and so make
>>fails while trying to execute sh to run this line, before libtool is
>>even called.
>
> When I was building it all I did wonder why the la line worked and the link
> failed.
>
> It's occuring to me that it might be a function of the path underwhich its
> being built, so in my case the command gets truncated (by amasing luck) just
> after a full filename, so the command actually works but with less files
> passed to it.
>
> That in turn I suppose may mean my built libgcj.a doesn't contain all the
> files it should! But I can't say I've noticed that!
Well, I finally got it to work using these steps:
1) I edited the toplevel ltconfig to cause max_cmd_len to be set to a
reasonable value. (Alternately, it could be modified directly in the
generated libtool script.)
2) I bootstrapped until I hit the failure in the libgcj.la rule.
3) I reran make on the libgcj.la rule, piping output to a file. Then I
trimmed the file with an editor so it only contained a single line with
all of the arguments to libtool (starting with --tag). I used this
command to evaluate the `` substitution:
eval echo `cat trimmed-output` > libtool-options
4) I backed up libtool, then added the following command as the second
line in the file to set libtool's arguments:
set -- `cat libtool-options`
5) I reran the libgcj.la rule.
6) I restored libtool, and restarted the bootstrap
As far as fixing the problem, the trouble here ultimately lies in autotools:
1) libtool's max command line length test isn't good enough. In
addition to checking maximum byte size of arguments, it also needs to
check for maximum number of arguments (ie argc) and maximum length of an
individual argument. This would be enough to make any system happy, I
think.
2) automake also needs to apply the max command length. In cases where
the command line is insufficient, the object list needs to be put into a
file, and passed indirectly to libtool.
Unfortunately, I know next to nothing about autotools internals, and to
be honest, they seem quite intimidating. Its possible that automake
already supports this somehow, but I don't see anything obvious in the docs.
Anyway, in the meantime, hopefully this workaround will help someone
else who had my problem.
Aaron W. LaFramboise