[PATCH] pass @-files to collect2 and beyond

Andrew Pinski pinskia@gmail.com
Fri Apr 13 21:30:00 GMT 2007


On 4/13/07, Nathan Froyd <froydnj@codesourcery.com> wrote:
> The attached patch adds special handling to the gcc driver and collect2
> to pass @-file arguments to collect2 and subprocesses, respectively,
> when they are passed @-file arguments.  The motivation behind this is to
> avoid argv limits on some systems and/or large compiles.

Only problem is that if you do this, it will not work if you have a
GCC that understands @ but an as/ld that does not understand @.  Maybe
you need more magic than what you gave.
Also I think you might need to quote arguments in the response files.
That is:
+		      fprintf (temp_fp, "%s\n", outfiles[i]);
Should be
+		      fprintf (temp_fp, "\"%s\"\n", outfiles[i]);

Also you have to make sure that '\' is translated to '"\\" when
printing out the response file, otherwise it is treated as something
different when reading it in.

Note this is learned for experience while doing the same for the PS3 toolchain.

Thanks,
Andrew Pinski



More information about the Gcc-patches mailing list