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

    <tr>
        <th>Summary</th>
        <td>
            [LLJIT] Symbols not found: [ llvm_orc_registerEHFrameSectionWrapper ]
        </td>
    </tr>

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

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

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

<pre>
    After updating to LLVM 17 we started seeing the error in title when creating an LLJIT instance when running on Linux. After digging through the source code and reading issue #61712 I think I understand the issue.

Why must functions like llvm_orc_registerEGFrameSectionWrapper be exported and found via dlsym?  This seems like a bad design decision.

Our use case is perhaps unique, but we must support multiple versions of LLVM being used _in the same process_ simultaneously. We have one shared library using LLVM to generate executable code for a future HW product, and another shared library using LLVM (of a potentially different version) to translate that binary (using LLJIT) into something that can be executed by current HW. The second shared library (using LLJIT) is linked with -Wl,--exclude,ALL to prevent export of symbols from static libraries.  Additionally, we load this library using dlopen with the RTLD_LOCAL flag.  Either of these will break LLJIT on LLVM 17.

All of this worked fine for the last 7-8 years until LLVM 17.

Is there any kind of workaround we can do (in client code only) to prevent the use of dlsym when creating an LLJIT instance?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEVMFu4zYQ_Rr6MrAhUXYcH3zwJusmCxcLdIP6GFDiSGJDkeqQtKO_L4byortF0L3YB828eXxv5qkQTOcQ92LzSWweFyrF3tO-K2qbcFF7Pe0PbUSCNGoVjesgejid_vwdyi1cEUJUFFFDQMwfewQk8gTGQTTRIlx7dNAQzt3Kwen05fkFjAtRueb2nZJz_Nk7OBmX3lcwT9Wm62Zc8qnrM37wiRqExmsE5TQQKs01JoSEIGR1V25LCc8Qe-Pe4BmS00g8Tef-XLcSxaMoDvPvuZ9gSCFCm1wTjXcBrHlDsPYyvHpqXgk7EyLS59-OpAb8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