[llvm-bugs] [Bug 45282] New: lld-link fails if PDB path is an Alternate Data Stream

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Mar 23 09:04:40 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=45282

            Bug ID: 45282
           Summary: lld-link fails if PDB path is an Alternate Data Stream
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: other
            Status: NEW
          Severity: normal
          Priority: P
         Component: COFF
          Assignee: unassignedbugs at nondot.org
          Reporter: sb at miray.de
                CC: llvm-bugs at lists.llvm.org

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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200323/01503222/attachment.html>


More information about the llvm-bugs mailing list