(original) (raw)
On Tue, Feb 26, 2019, 14:24 Lang Hames via llvm-dev <llvm-dev@lists.llvm.org> wrote:
(1) You will want to remove the call to LLVMOrcGetSymbolAddress from your sym\_resolver function: In the ORC C API resolvers are only used to resolve external symbols (i.e. ones not defined in the JIT'd code). So in your case, given that you \*only\* searched the JIT, I think you can define this function to just return zero, meaning JIT'd code can't call external functions.
In my experience with LLVM 4, LLVM can generate calls to external functions such as memcpy, so, assuming LLVM doesn't resolve those functions by itself, you still need to resolve them in the symbol resolver function.
You can add a breakpoint or printf to the symbol resolver to see which names it tries to resolve and add those manually.
Jacob Lifshay