<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - lld-link fails if PDB path is an Alternate Data Stream"
   href="https://bugs.llvm.org/show_bug.cgi?id=45282">45282</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>lld-link fails if PDB path is an Alternate Data Stream
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lld
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>other
          </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>COFF
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>sb@miray.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>LLVM 9.0.0 on Windows 7 64-bit.

When the path for the PDB file is set to an Alternate Data Stream (either on
the resulting binary itself or some unrelated file) then the linking fails with
the following error:

Stream Error: An I/O error occurred on the file system.

This error does not occur if either Microsoft's link.exe is used or if the
linking is done using clang-cl.exe (which seems to default to link.exe).

To reproduce this:

The following C++-code as test.cpp (on a NTFS or ReFS volume):

int main(int argc, char** argv)
{
   return 1;
}

Execute the following commands (note: the libpaths will likely vary for your
system):

clang-cl.exe /c test.cpp
lld-link.exe /OUT:test.exe /DEBUG:FULL /PDB:test.exe:pdb "/libpath:C:\Program
Files (x86)\Microsoft Visual
Studio\2019\Community\VC\Tools\MSVC\14.25.28610\lib\x64" "/libpath:C:\Program
Files (x86)\Windows Kits\10\Lib\10.0.18362.0\um\x64" "/libpath:C:\Program Files
(x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64" .\test.obj

The second command will fail with the above mentioned error.

If I however replace lld-link.exe with link.exe (with the VS environment set up
correctly) the linking will succeed. The linking will also succeed if I use
this:

clang-cl.exe test.cpp /link /debug:full /pdb:test.exe:pdb

The error also does not depend on whether the PDB file is in the target binary
or not. For example the path "/pdb:test.txt:pdb" will fail as well while it
will succeed with both link.exe and clang-cl.exe even if test.txt does not
exist yet.</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>