-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Description
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_registerEHFrameSectionWrapper 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?