[LLVMdev] Unable to build vmkit

Will Dietz willdtz at gmail.com
Sat Dec 17 20:14:53 PST 2011

On Sat, Dec 17, 2011 at 1:25 AM, Jeff Slutter <jeff at slutter.com> wrote:
> Hello, I am using Ubuntu 11.10 64-bit. Following the instructions on the
> VMKit website I grabbed llvm, clang, and vmkit via svn (and GNU
> Classpath via the link of the page). Compilation of llvm, clang and
> classpath went fine. I had problems compiling vmkit, which seem to be
> related to a TargetOptions being required as a parameter when creating a
> TargetMachine in LLVM. This led to a couple other places in VMKit's code
> that tried to reference some LLVM global variables that no longer exist
> (I assume because they were moved into TargetOptions).
> I attempted to make some minor fixes to get by this and I did, but when
> it was building mmtk-vmkit.jar (I think that's what it is doing) I got
> an assertion while running the vmjc command in the Makefile:
> vmjc: JavaRuntimeJIT.cpp:469: void *j3ResolveSpecialStub(): Assertion
> `FI->Metadata != __null && "Wrong stack trace"' failed.
> So, either my "fixes" were bad, or I have another problem that I don't
> know how to solve :)

I looked into this and this is because vmkit uses the
ExecutionEngine::createJIT interface, and at the moment you can't use
custom TargetOptions with this method (see
http://llvm.org/doxygen/ExecutionEngine_8cpp_source.html#l00439 ).

In this case, we're not setting NoFramePointerElim when creating the
JIT, which does bad things to code that uses the frame pointer :).

For what it's worth (if there's a particular reason you want to use
mainline), locally hacking an extra parameter for TargetOptions into
the createJIT method seems to work fine.  I can't speak if that makes
any sense for LLVM proper, but will unblock this for you.

> Should I be grabbing a specific version of LLVM/Clang from SVN (instead
> of the head)?

r145713 (latest before the TargetOptions refactoring) works here.  Good luck!


More information about the llvm-dev mailing list