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

    <tr>
        <th>Summary</th>
        <td>
            [Clang] sysroot and /winsysroot doesn't work on cross compilation
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

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

<pre>
    Currently I can't cross compile from WSL to Windows, by passing the Windows SDK dir as --sysroot with **clang** or passing Windows Build Tools dir as /winsysroot with **clang-cl **.

I face errors such as these
lld-link: error: could not open 'kernel32.lib': No such file or directory

And when I manually provide link directories like this

```
link_directories(/mnt/c/dev/sysroots/WinSDK/10/Lib/10.0.26100.0/um/x64)
link_directories(/mnt/c/dev/sysroots/WinSDK/10/Lib/10.0.26100.0/spectre/x64)
link_directories(/mnt/c/dev/sysroots/WinSDK/10/Lib/10.0.26100.0/ucrt/x64)
include_directories(/mnt/c/dev/sysroots/WinSDK/10/Include/10.0.26100.0/um)
include_directories(/mnt/c/dev/sysroots/WinSDK/10/Include/10.0.26100.0/ucrt)
```

I face other sets of errors.

I just want to provide a sdk and optionally manually link libc++ if I build it.  That's it, I don't want to do anything else.
Please comfirm if this is an issue, if not please provide me with information what I'm doing wrong, I already checked the clang manual and didn't find a solution.





</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy0VMGK4zgQ_RrlUsTIFSfuHHxwd2MIMywLPdDHRZbKsSayZCS5s_n7RbaTmVl2T0ODIIpd9V5V-dUTIeizJarY_pntXzdiir3z1SCluOi4aZ26VS-T92SjucEJpLAMywjSuxBAumHUhqDzboD3t68QHbxrq9w1MHyB9gZjIrBniD3d38Db6xdQ2oMIsN2GW_DORbjq2APDmmEtjbDn5QrOPyDu6c-TNgq-OWfCHYZhc9X2_6C20qx_M8ZrxusTdEISkPfOBwiT7BNI7CkQ47Uxamu0vbBdvYSki3STUWBdBDeSBYblhbwls8PM6JZhmYL-cAtYl2bifKqOZHT-ttDWVsG1JwsnGISdhDE3GL370IogET7iNQUw-kIQex2WXHbg6-F1iv3rp1iGTwybwUaGjWTYKPpg2KzTCAybd23fXr8wbHLOsPma6m1ynvEMDznnWXo4DQybvw8Fw-MnMYSRZPT02TST9PFnDm2lmRT9Bs1pQfjvmX02xdzN8V8C-CFhF3vyECgGcN0q6IfIv08hwlXYmNbyLjQBQV1AWAVujNrZWYUPOc4yNLqVDJ8ZPoPu4ATtvHA6ZgDfehEZlgF0TAt-AuUWP7jTKAfC3mKfFpZMoFTMn4ZEoGQWnfZDwky6Bh1AWNAhTJSwdDev17gE38sdaFlnbTvnB5EqhmsvIpwYlgMol4iu3iXDSPUI40moG8ie5IXU7DuzCaw9zp0rrZaqO21VmogzU0JeJ_c4G1Xt1HF3FBuq8nK_43mxz3HTV4UsC1Rqj53odvyoylyhOtJeiY7ap4Pa6Ao57nmJPEd82mHGqTi0shSdEmUh24IVnAahTWbMx5A5f97Mg6jy4ljycmNESybMpoy4-iEmf_ZVSti20zmwghsdYvgBEXU0s5O_zBn7V7hbYur6V5NUjsL66Zy_gLO_WPo86M3kTdXHOAa2qxk2DJuzjv3UZtIlu0i868929O47yST3uY8k8bWVjwr_CQAA___NIQy_">