Jan Rehders
2007-Jun-11 15:23 UTC
[LLVMdev] How to call native functions from bytecode run in JIT?
> Are you able make calls to well known external functions such as > printf? As far as I known, this capability is well tested on x86 / > Linux.Calling printf works at least on OS X (I'm waiting for a reply whether this works on linux). If I call my native function it fails with PPCJITInfo.cpp:382: failed assertion `ResultPtr >= -(1 << 23) && ResultPtr < (1 << 23) && "Relocation out of range!"'> I am wondering if there is some name mangling issue?Not that I'm aware of. It appears to find the function using module- >getFunction("get5") Is there really nobody here who knows how to properly register native functions of the application to the execution engine?
Ralph Corderoy
2007-Jun-11 16:02 UTC
[LLVMdev] How to call native functions from bytecode run in JIT?
Hi Jan,> Calling printf works at least on OS X (I'm waiting for a reply > whether this works on linux). If I call my native function it fails > with PPCJITInfo.cpp:382: failed assertion `ResultPtr >= -(1 << 23) && > ResultPtr < (1 << 23) && "Relocation out of range!"'I know nothing about this, but the failed assertion suggests the PPC code generator can't cope with a constant that's bigger than expected at that point. Have you taken a look at PPCJITInfo.cpp:382? It may shed some light. Cheers, Ralph.
Jan Rehders
2007-Jun-11 20:35 UTC
[LLVMdev] How to call native functions from bytecode run in JIT?
Hi,> I know nothing about this, but the failed assertion suggests the PPC > code generator can't cope with a constant that's bigger than > expected at > that point. Have you taken a look at PPCJITInfo.cpp:382? It may shed > some light.It's inside PPCJITInfo::relocate but unfortunately I could not figure out anything from the source. It looks like it's calculating new addresses for functions which does not make much sense for a native function, at all Greetings, Jan
Apparently Analagous Threads
- [LLVMdev] How to call native functions from bytecode run in JIT?
- [LLVMdev] How to call native functions from bytecode run in JIT?
- [LLVMdev] How to call native functions from bytecode run in JIT?
- [LLVMdev] How to call native functions from bytecode run in JIT?
- [LLVMdev] How to call native functions from bytecode run in JIT?