[patch] add function for system argument limit checking

Nathan Froyd froydnj at mozilla.com
Wed Apr 3 13:59:01 PDT 2013


Hi!

In:

http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130311/075977.html

I proposed a patch to fix PR 15171, a problem with invoking the linker with
too many command-line arguments.  Rafael suggested that the right way to fix
this sort of thing is to add bits in llvm/lib/Support/ for determining the
maximum number of command-line arguments.

The attached patch adds these bits.  On Unix, we consult sysconf(_SC_ARG_MAX)
and tweak the numbers a bit to account for environment variables.  On
Windows, we count up the size of the arguments, accounting for quoting,
spaces between arguments, and the trailing NULL.

-Nathan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: system-arguments-limits.diff
Type: text/x-diff
Size: 2252 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130403/c3aa57c1/attachment.diff>


More information about the llvm-commits mailing list