@Dave
Here comes the answer to if we can use -marm explained by jyasskin on #llvm
"If you put a CallInst in your LLVM IR whose target is an llvm::Function, and 
that Function is an external declaration (i.e containing no BasicBlocks), then 
llvm will try to use dlsym() to look up the code for that function. 
If, however, you first call ExecutionEngine::addGlobalMapping(f, 
&some_real_function), then the JIT will emit calls to some_real_function(...) 
instead."

So we will have trouble fullfill the 1.a condition that external
functions should only be called via C++/high-level code which is part of
llvm itself since the JIT will call these functions directly.

If the JIT runs openjdk shark then it will call jni code directly, make
direct calls to libjvm.so.


Some clarification to your guess "I'm guessing that the JIT output is ARM code 
only (not Thumb)":
It turned out that the LLVM switches on the thumb backend by default since it 
have autodetected the host system to be a
Host: thumb-unknown-linux-gnueabi

The current implementation of the llvm thumb backend currently works
well when using llvm as a static compiler to create assembler files:

But dont work so well when used for the ExecutionEngine JIT since the
thumb backend happen to lack specifications for how to generate machine
code fore all the thumb instructions. It currently only know what
instruction it wants to use but then hits an assertion that the
specification for the machine code are missing: This bug are tracked
upstream http://llvm.org/bugs/show_bug.cgi?id=6223

example: see attached file for differences between the static
compilation and jit using llc and lli with  thumb/tumb2 emission.

** Bug watch added: llvm.org/bugs/ #6223
   http://llvm.org/bugs/show_bug.cgi?id=6223

** Attachment added: "llvm arm thumb static and jit generation example.txt"
   
http://launchpadlibrarian.net/38741293/llvm%20arm%20thumb%20static%20and%20jit%20generation%20example.txt

-- 
[arm] needs porting to thumb2
https://bugs.launchpad.net/bugs/513735
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to