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

    <tr>
        <th>Summary</th>
        <td>
            `lli` and `llvm-jitlink` ergonomics -- automatically search for common platform runtime archives.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            orcjit
      </td>
    </tr>

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

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

<pre>
    Right now `lli` and `llvm-jitlink` do not load any standard archives for the target platform by default. When code depends on symbols from standard archives users are forced to explicitly add `-extra-archive` options to get their code to run. In some cases this hits even trivial programs (see e.g. https://discourse.llvm.org/t/jit-session-error-while-using-lli-on-windows/67354).

This behavior stands in contrast to our handling of symbols from standard _dynamic_ libraries, which are available by default through reflection of process symbols into the JIT.

It might be nice if we took the triple from the first input file and used it to search for archives that are typically linked into executables for that platform. E.g. on mingw, `libgcc.a` (see discussion in https://discourse.llvm.org/t/jit-session-error-while-using-lli-on-windows/67354/4). This search should be opt-out under a flag like `llvm-jitlink`'s `-no-process-syms` so that it can be turned off where necessary.

We will need to decide how to handle remote-JITing: For dynamic libraries we can just tell the executor to load them, but for archives we would need to fetch them into the controller. A generic solution to this might be to add support for a remote-archive-definition-generator to the ORC runtime (it seems reasonable to require the ORC runtime for out-of-process archive support).
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0lUGP2zgPhn-NcyEcJHbGyRxymK_9AkwvCxQFeixkibY5lUWvSE2af7-QknQ6iy72tJcEMkSRfN-HkhGhMSAeq4f_VQ8fVybpxPHoJzOjrHp2l-NnGieFwGeouo33VHUbMMFdV69z_ULqKXzPnx1DYAXPxoEJFxA1wZnowEQ70SsKDBxBJwQ1cUSFxRsdOM7QX8DhYJLXNXydMIBlh-BwweAEOIBc5p69wBB5_s25STAKmIg5g0UHyoA_Fk-W1F_AuFJvjT80mvoWlSv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