[LLVMdev] How to call native functions from bytecode run in JIT?

Nicolas Geoffray nicolas.geoffray at lip6.fr
Fri Jun 29 01:45:15 PDT 2007


Hi Jan,

If I recall correctly, in Linux you get the message:

PPCJITInfo.cpp:382: failed assertion `ResultPtr >= -(1 << 23) &&  
ResultPtr < (1 << 23) && "Relocation out of range!"'


Right? But on OS X you don't have this messsage?

Here's a temporary fix until I find time to investigate on this:

In function PPCISelLowering::LowerCALL, comment the lines:

  if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee))
    Callee = DAG.getTargetGlobalAddress(G->getGlobal(), 
Callee.getValueType());

This will force an indirect call, and won't use the jump-size limitation 
of the bl instruction.

Let me know if this helps.

Cheers,
Nicolas

Jan Rehders wrote:
> Hi,
>
> attached is a small testcase I did. It builds two LLVM functions which 
> both call two native functions get5 and get6. The native functions are 
> in the exe and in the dll. On OS X it works like a charm. On Linux 
> none of the two functions can be called.
>
> Maybe someone can try them or have a look at it to see if there is 
> something obviously wrong
>
> greetings,
> Jan
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>   




More information about the llvm-dev mailing list