<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Response files with extra newlines (or '\r') aren't tokenized correctly"
   href="https://llvm.org/bugs/show_bug.cgi?id=27396">27396</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Response files with extra newlines (or '\r') aren't tokenized correctly
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Support Libraries
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>srhines@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>danalbert@google.com, llvm-bugs@lists.llvm.org, rnk@google.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>As a result of the fix for <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - clang-cl: /link option in @response file should only consume args until end of current line"
   href="show_bug.cgi?id=17239">Bug 17239</a>
(<a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - clang-cl: /link option in @response file should only consume args until end of current line"
   href="show_bug.cgi?id=17239">https://llvm.org/bugs/show_bug.cgi?id=17239</a>),
llvm::cl::TokenizeGNUCommandLine() ends up inserting additional nullptr fields
into the new argv. This can cause problems for joined command line arguments
(like passing "-x c" on separate lines.

This now causes issues with the gradle build system because they default to
passing response files full of arguments. On Windows systems, these response
files contain "\r\n", which ends up inserting the additional nullptr into argv.

I think the issue with the original patch (from r216280), is that it is
inserting the extra nullptr fields in the middle of the loop constructing the
new argv. It should instead just insert a nullptr at the end of the response
file (which will allow it to work correctly for the only use-case of /link in
clang-cl.exe). I have a patch that I can upload after a bit more testing (and
adding an explicit new test for verifying this works appropriately for cases
with extra newlines and/or windows line endings).</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>