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

    <tr>
        <th>Summary</th>
        <td>
            Whether to support finding pdb files from outputpath
        </td>
    </tr>

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

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

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

<pre>
    When I converted an existing project on Windows to use clang for compilation, when linking, lld-link.exe had a lot more warning messages like the following than link.exe(msvc)
```
lld-link : warning : Cannot use debug info for 'aa.lib(aa.obj)' [LNK4099]
>>> failed to load reference 'aa.pdb': no such file or directory

lld-link : warning : Cannot use debug info for 'bb.lib(bb.obj)' [LNK4099]
>>> failed to load reference 'bb.pdb': no such file or directory
```

After checked, I found that the existing project structure uses the following method to link
```
out                                -- directory
 bin                              -- directory
    a.exe
    aa.pdb
 bb.pdb
  lib                              -- directory
 bb.lib

out1                               -- directory
  lib -- directory
    aa.lib
```
Executable file(a.exe) needs to link two static libraries(aa.lib/bb.lib)
These pdb files are in the same folder as the final generated a.exe

When using link.exe, it will also check whether the pdb file of the static library exists in the directory where the exe/dll is finally generated, but lld-link.exe will not, causing the above warning to appear.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVcFu4zYQ_RrqMrAhU_LKPuiQTdbFtkVPBfY8JEcS1xQpkJSd_H1BSo6TbYsi6BqCrAHB9x7nzQwxBN1bopbtP7P9U4FzHJxvfzlffr1iIZx6ab8NZOErSGcv5CMpQAv0rEPUtofJu-8kIzgL37RV7hogOpgDgTRoe-icB-nGSRuM2lnGH-Ga8Iy2Z237FBujNinc0jPBgAoQjIswOk9wRW8TzUghYE8BjD4TxIGgc8a4a1qLAy54CYDxwxgukvEjK59Y-cA-leuTwxsXsOrhFTx9P6K1LmbhisTcg7ady-oZbxC3RgvGD4hbJ74ncN4A23_-_Y_f6vJ4ZPunla36sjzQoTakUi6MQwWeOvJkJa1wkxKMN4nYOgizHKDThsB5UNqTjM6_rIj_Q7YQq2whfoZsIT4g-33al_dDF8mDHEieSSXnv0LnZquSgzGb-reyCtHPMs6e0hHDD8aPFAe3iNX2_I_Ebo7wH7_N5kfxILT98B4AwFyA93CxeYUUbwIwWnxc1OLmm3y6Oe4-frhM_i8HwDcU7xP55ZnkHFEYypanXlja7QiWSIWbCxCvDkLEqGUi8ug1haVzci2ebkW59uefAwWCSYkMGwA9gbbZ6IBjdluRB1y91xYN9GTJY55E94wv7zyr5pCq4z4RHkFHuGpjAE1wSwGmKRQH8hn2Rg-uW5jf6n9ZqjLcZL3mLUF4WuuWGD8pY0CHRaR5uctMCsQc3w-6rMe6mBYlLpITFAp3uc-96ACnidBvC9VW6lgdsaB21-yaaneoD1UxtE0tZSePXS0qbLBrDrXalaqpqKr3qjl0hW55yevyU8nLw76uq-1OdQ1vOAra1XIvO1aXNKI2W2Mu49b5vtAhzNQe692eFwYFmZDvB84tXSEvMs7TdeHbtGcj5j6wujQpT3eUqKOhdH0siU4TY5qcjylDKnf5q-2ddyO4OU5znDAOxexNO8Q4BVY9MH5i_NTrOMxiK93I-ClRrH-bdVQwfsrCAuOnRfil5X8FAAD__4WTJF8">