add current process symbol to dylib LLVM >= 18 does this automatically
| 189 | // add current process symbol to dylib |
| 190 | // LLVM >= 18 does this automatically |
| 191 | void AddProcessSymbol(llvm::orc::LLJIT& lljit) { |
| 192 | lljit.getMainJITDylib().addGenerator( |
| 193 | llvm::cantFail(llvm::orc::DynamicLibrarySearchGenerator::GetForCurrentProcess( |
| 194 | lljit.getDataLayout().getGlobalPrefix()))); |
| 195 | // the `atexit` symbol cannot be found for ASAN |
| 196 | #if defined(ADDRESS_SANITIZER) && LLVM_VERSION_MAJOR < 18 |
| 197 | if (!lljit.lookup("atexit")) { |
| 198 | AddAbsoluteSymbol(lljit, "atexit", reinterpret_cast<void*>(atexit)); |
| 199 | } |
| 200 | #endif |
| 201 | } |
| 202 | |
| 203 | #ifdef JIT_LINK_SUPPORTED |
| 204 | # if LLVM_VERSION_MAJOR < 23 |
no test coverage detected