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

    <tr>
        <th>Summary</th>
        <td>
            llvm-jitlink crash on Windows
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            compiler-rt,
            orcjit
      </td>
    </tr>

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

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

<pre>
    To reproduce: on Windows, run cmake with LLVM_BUILD_RUNTIME=ON and add compiler-rt to LLVM_ENABLE_PROJECTS.  Build and test.  (I also have asserts on, but I don't think that's necessary.) I'm not aware of a way to run just the compiler-rt or ORC tests, [see this post](https://discourse.llvm.org/t/build-compiler-rt-as-runtime/68460/3?u=pogo59), so run check-all.

This fails 9 tests in `ORC-x86_64-windows` (which live under compiler-rt\test\orc) because it is looking for `liborc_rt-x86_64.a` when the actual library name is `orc_rt-x86_64.lib`. Make the obvious patch to compiler-rt\test\orc\lit.cfg.py:
```
+elif config.host_os == 'Windows':
+  orc_rt_path = '%s/orc_rt%s.lib' % (config.compiler_rt_libdir, config.target-suffix)
```
Now llvm-jitlink can find the library, and it promptly crashes.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0lFFv4zYMxz8N_ULYUOnYTh780CQNkKHXDl1vewxkmY7VKpYhyc3l2w9ycnctsAFBDEIi-SP_pKT3-jgw11Csodgmcgq9dfVoj7ZYJY1tL_WrRcejs-2kGPJ7tAP-o4fWnj3QBt00oDrJd8azDj0-Pv797bD-vn_cHl6-P73uvz1Avn1-Qjm0KNsWlT2N2rBLXcBgr9cfnu7Xjw-HP1-e_3jYvP6VIa4nbdrZJ7APGSLQco_SeIu9_GCU3rMLHu0QEZop4B7baFQBQ6-Hdwy9DECVx4EVey_dJQNa4R6oOuFgA8qzdIy2Q4lneYkssZK3yccI_IXTOnx-2cwoc8lQrD1zTORxtD5AsQVa9iGMHvJ7oB3QrtVe2cl5zoz5OGXWHYF2AWjXxNLST-FT6VM3DUGfGGhXLhelANrlkO8myLdXIYBWMbG_Qqqe1XsqjclAbEHcX_9fI04ntfG4urKiHhBK8fyySX8sy0O5SM833UoRO3ruterR6A_GaWjZfS4aik2MAcXGOhU717CSk2fUAbVHY-27Ho7YWRdTGN1Ypw4u3BJlMqY49zzMzZQqTNKg0Y2T7oKDPHEMAqX46mV0A6XI8Fscp-homw9tJ4-jDKqPGv0vYbExOmSqO2bjJYpwbUwpbr-rSWs2ukNlh04fs976cLAeId9CvkWg6tdYV79D0BrxSnkYZejxdhWo8EC760k0ZniqEKiIvb3l-Mkb3Y1uWu2ijrfDIN2RQ-qnrtM_osT_Bf1kzxhHKH3TwcTJVnLATsfV6PlnS2PQuC064OjsaQzmgspJ37PPkrbO21W-kgnXd2VVLirKC0r6mhrVlI0QyztBVcGNaldyJUSuljnnd6JJdE2CckF3xd1iURSUddy0TFVbES0qXhSwEHyS2vya8UR7P3FdiqpcJUY2bPz8sBB9Fo4IaANE1qk3PZvFNnH1XGUzHT0shNE--N9hgw6G669tiOV9eouSyZn66w4edeinJmoAtIvOt086OvvGKm7jzBuFnJH_DQAA___fXJ9M">