[LLVMdev] Android build patch

James Lyon jameslyon0 at gmail.com
Mon Nov 4 23:57:01 PST 2013


I suppose I was just doing the "smallest" thing. Disabling the hack 
entirely also allows it to build and is probably the correct thing to 
do. I'm not that knowledgeable about glibc vs. Bionic differences so the 
thing to do would be to test whether those functions work without the 
"hack" on Android. Unfortunately at the moment I can't get my Android 
JIT test program to actually run; it crashes somewhere in LLVM without 
any useful output (the debugger also crashes), so that one's going to 
take some time to figure out.

On 05/11/13 07:33, Alp Toker wrote:
> The CMake changes look fine to me, landed in r194051!
>
> As for the JITMemoryManager.cpp changes, not so sure. Did you try 
> disabling the 'hack' described below instead of patching it?
>
>
> |
> ||//===----------------------------------------------------------------------===//||
> ||// Function stubs that are invoked instead of certain library calls||
> ||//||
> ||// Force the following functions to be linked in to anything that 
> uses the||
> ||// JIT. This is a hack designed to work around the all-too-clever 
> Glibc||
> ||// strategy of making these functions work differently when inlined 
> vs. when||
> ||// not inlined, and hiding their real definitions in a separate 
> archive file||
> ||// that the dynamic linker can't see. For more info, search for||
> ||// 'libc_nonshared.a' on Google, or read http://llvm.org/PR274.||
> ||#if defined(__linux__)|
>
> ^ ie try making this defined(__linux__) && !defined(__BIONIC__)
>
> Alp.
>
>
> On 31/10/2013 00:08, James Lyon wrote:
>> I've been trying to get LLVM JIT compilation working on Android for 
>> the last few days. The patch I needed to get it to build is attached 
>> (nothing major - CMake configuration header typo and avoiding open64 
>> which is missing on Android).
>>
>> Sadly even though it builds I can't get generated code to work - it 
>> appears at the moment that the generated code doesn't have execute 
>> permissions set for some reason (this is 3.3, not svn).
>>
>> James
>>
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu          http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
> -- 
> http://www.nuanti.com
> the browser experts

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131105/d3f3fabc/attachment.html>


More information about the llvm-dev mailing list