(original) (raw)

First of all, I am a newbie when it comes to LLVM so apologies if I am missing something obvious.
I am using Orc/LLVM as a backend for my JIT expression parser/evaluator and I'm running into this error:

JIT session error: Symbols not found: { fmodf }

When using the frem instruction in IR like for example:

%remainder = frem float %aFloat, 1.000000e+01

Am I supposed to provide this symbol somehow or is this actually not supposed to happen?

I have tried calling llvm::sys::DynamicLibrary::LoadLibraryPermanently(nullptr) to load the symbols in my host process but it still won't find it even if I define a custom 'extern "C" fmodf' function.
I've tried it on both x86\_64-pc-windows-msvc and x86\_64-unknown-linux-gnu (GCC) though I mostly work with msvc.
I also would rather not allow my expressions to have access to all the symbols in my host process anyway so I am okay with providing these 'manually' somehow.
So if I have to provide these manually, what is the best way of doing this? And where can I find a list of all these symbols that LLVM expects to be available?

Thanks,

Machiel van Hooren

P.S.
If anyone is interested, the source for this project can be found on github:
https://github.com/mvhooren/JitCat/tree/llvm\_backend