[PATCH] use response files to pass arguments to the linker, fixes PR 15171
Nathan Froyd
froydnj at mozilla.com
Thu Mar 14 11:51:40 PDT 2013
Hi,
When a response file (a file containing arguments to a program, one per line) is given to the driver for a final link, very long command lines can be constructed for the linker. In some cases, these command lines are too long, and the OS will fail to execute the linker.
The attached patch fixes this issue by simply using a response file all the time for passing arguments to the linker. Alternate strategies include only using a response file if a response file was used on the original command line or using a response file if the size of the arguments exceeds some limit. I didn't go with the former because it seemed too use-case specific (and will not correctly handle cases where response files aren't used to pass arguments to the driver and you still need a response file for the linker) and I didn't go with the latter because any cross-platform limit is going to be necessarily conservative and you might as well just use a response file all the time at that point.
I realize this adds a small cost to every link. Alternate ideas welcome.
The patch changes all the linking jobs to use the new AddLinkerJob function. I used my best judgement as to whether response files were supported, but I may have missed some cases.
-Nathan
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: linker-response-files.txt
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130314/d7427efb/attachment.txt>
More information about the cfe-commits
mailing list