Author: Xerxes Rånby xerxes at zafena.se
From: http://mail.openjdk.java.net/pipermail/zero-dev/2011-August/000402.html
Comment: No MCJIT right now because got "LLVM ERROR: Unknown object format!"

--- openjdk/hotspot/src/share/vm/shark/llvmHeaders.hpp.orig
+++ openjdk/hotspot/src/share/vm/shark/llvmHeaders.hpp
@@ -56,7 +56,7 @@
 #include <llvm/ExecutionEngine/JITMemoryManager.h>
 #include <llvm/Support/CommandLine.h>
 #if SHARK_LLVM_VERSION >= 27
-#include <llvm/ExecutionEngine/JIT.h>
+#include <llvm/ExecutionEngine/MCJIT.h>
 #include <llvm/ADT/StringMap.h>
 #include <llvm/Support/Debug.h>
 #if SHARK_LLVM_VERSION >= 29
--- openjdk/hotspot/src/share/vm/shark/sharkCompiler.cpp.orig
+++ openjdk/hotspot/src/share/vm/shark/sharkCompiler.cpp
@@ -72,6 +72,9 @@
   // Initialize the native target
   InitializeNativeTarget();
 
+  // MCJIT require a native AsmPrinter
+  InitializeNativeTargetAsmPrinter();
+
   // Create the two contexts which we'll use
   _normal_context = new SharkContext("normal");
   _native_context = new SharkContext("native");
@@ -113,6 +116,7 @@
   builder.setJITMemoryManager(memory_manager());
   builder.setEngineKind(EngineKind::JIT);
   builder.setErrorStr(&ErrorMsg);
+  builder.setUseMCJIT(true);
   _execution_engine = builder.create();
 
   if (!execution_engine()) {
