<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/132183>132183</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Response files are used whenever the command line length exceeds 64K characters
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Morilli
      </td>
    </tr>
</table>

<pre>
    I just ran into an issue where linking a program failed because `ld.musl-clang`, the link script, was called from clang with a response file instead of all individual arguments directly. The script was not able to handle this and caused compilation failure.

I have tried to find documentation on when response files are used and whether it's possible to configure them in any way, but I was unsuccessful. Looking at the [source code](https://github.com/llvm/llvm-project/blob/fd7be0d2e9e2cb7d43c9cb97edbb36da59a5b595/llvm/lib/Support/Unix/Program.inc#L549), I see that on unix-like systems the command line length seems to get limited to 64 * 1024 = 65536 characters before a response file is used, regardless of what size the system can actually support. This feels very unintuitive to me, as I would expect response files to only be used once the system limit for command line length is reached.

Please correct me if I'm wrong, but as far as I can see there is no way for a user to toggle response file support (via a commandline flag for example) or set the maximum command line length that is allowed before response files are used (like `xargs -s`).

Would it be possible to either make response file usage optional or allow configuring the maximum command line length before response files are used? Alternatively, the code should not limit command line length to 65536 characters and instead use the full system limit (divided by 2 if you will).
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUVUuP4zYT_DX0pTGGTFl-HHyY_RYGBt8GWOSBnFtkS-IuRRps0o_8-qBpT7KvSZCTDEvsrqquLiKzGwPRQXXvVPd-gSVPMR1-isl57xZ9tLfDC3wqnCFhABdyBHkyF4LLRInAu_DZhREQTimOCWcY0Hmy0JPBwgRq03i7nAv7J-MxjGrTKP0_yNP9LLBJ7pTlrwsyGPRyeEhxhvo5XFyeACERn2JggsF5Ahc4E1qIA6D34IJ1Z2cLesA0lplCZrAukcn-toRfJ3q0qT1CzIC9J8gRJgxWfk2OA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