[LLVMdev] A weird, reproducable problem with MCJIT

Yaron Keren yaron.keren at gmail.com
Mon Oct 14 21:08:32 PDT 2013


Correct or no I don't know, but this change will affect all x86-64 targets
including Linux and Windows as getMaxStubSize() is called from the ELF
linker as well as the Mach-O linker.



2013/10/15 Christian Schafmeister <chris.schaf at verizon.net>

>
> With the help of iain at codesourcery.com and andrew.kaylor at intel.com we
> tracked the problem down to a bad relocation that was clobbering the
> first bytes of the eh_frame.   I think this problem/solution may be OS X
> specific.
>
> On akaylor's suggestion I made the change below and my reproducable test
> case now compiles fine with MCJIT.
>
> As well, my Common Lisp code base now compiles using MCJIT - that's about
> 1,000
> functions at one MCJIT module per function.
>
>
>
> In llvm/lib/ExecutionEngine/RuntimeDyld
>
> Index: RuntimeDyldImpl.h
> ===================================================================
> --- RuntimeDyldImpl.h   (revision 192535)
> +++ RuntimeDyldImpl.h   (working copy)
> @@ -195,7 +195,7 @@
>      else if (Arch == Triple::ppc64 || Arch == Triple::ppc64le)
>        return 44;
>      else if (Arch == Triple::x86_64)
> -      return 6; // 2-byte jmp instruction + 32-bit relative address
> +       return 8; /* was 6 but akaylor said change to 8 - meister Oct 2013
> */ // 2-byte jmp instruction + 32-bit relative address
>      else if (Arch == Triple::systemz)
>        return 16;
>      else
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131015/837b0e1c/attachment.html>


More information about the llvm-dev mailing list