[LLVMdev] Android JIT patch

James Lyon jameslyon0 at gmail.com
Sun Nov 10 17:45:09 PST 2013


I've attached a patch which has got JIT compilation working (for me at 
least!) on Android. It turns out that the problem was a bunch of 
intrinsic __aeabi* functions which reside in libgcc.a rather than 
libc.so so are not available unless explicitly linked in, so it's rather 
similar to the StatSymbols hack.

I moved the StatSymbols code into ExecutionEngine.cpp rather than 
JITMemoryManager.cpp since it's required for both the JIT and MCJIT, and 
deleted the code in RTDyldMemoryManager.cpp which did the same thing for 
fewer functions. They should now be picked up through the 
sys::DynamicLibrary::AddSymbol mechanism in both cases. The symbols 
required for ARM/Android are then added by an identical hack just below.

There's one other minor change since setLastModificationAndAccessTime 
can't be supported on Android; all relevant system calls are missing 
from the C library. I've therefore changed the code to fail at runtime 
rather than compile-time here.

James
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm-android.patch
Type: text/x-patch
Size: 9100 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131111/06731924/attachment.bin>


More information about the llvm-dev mailing list