<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
<span style="background-color: rgb(255, 255, 255); color: rgb(42, 42, 42); font-family: 'Segoe UI', Tahoma, Verdana, Arial, sans-serif; line-height: 17px; font-size: 10pt; ">I tried to compile helloworld program using llcj to native but i got the following error</span><br><div><div dir="ltr"><div style="line-height:17px;color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;background-color:rgb(255, 255, 255)"><br></div><div style="line-height:17px;color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;background-color:rgb(255, 255, 255)"><b style="font-size:10pt">shyam@shyam</b><span style="font-size:10pt">:~$ cat hello.java</span></div><div style="line-height:17px;color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;background-color:rgb(255, 255, 255)">class hello {</div><div style="line-height:17px;color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;background-color:rgb(255, 255, 255)"><br></div><div style="line-height:17px;color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;background-color:rgb(255, 255, 255)">  public static final String str = "Hello Word";</div><div style="line-height:17px;color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;background-color:rgb(255, 255, 255)"><br></div><div style="line-height:17px;color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;background-color:rgb(255, 255, 255)">  public static void main(String[] args) {</div><div style="line-height:17px;color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;background-color:rgb(255, 255, 255)">    System.out.println(str);</div><div style="line-height:17px;color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;background-color:rgb(255, 255, 255)">  }</div><div style="line-height:17px;color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;background-color:rgb(255, 255, 255)">}</div><div style="line-height:17px;color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;background-color:rgb(255, 255, 255)"><div><b>shyam@shyam</b>:~$ llcj --main=hello hello.class -o hello</div><div>llc: Unknown command line argument '-f'.  Try: '/home/shyam/llvmbuild/Release+Debug+Asserts/bin/llc -help'</div><div>llc: Did you mean '-O'?</div></div><div style="line-height:17px;color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;background-color:rgb(255, 255, 255)"><br></div><div style="line-height:17px;color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;background-color:rgb(255, 255, 255)">I edited the <b>vmkit/tools/llcj/llcj.cpp file</b></div><div style="line-height:17px;color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;background-color:rgb(255, 255, 255)"><b><br></b></div><div style="line-height:17px;color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;background-color:rgb(255, 255, 255)">line number ---- code</div><div style="line-height:17px;color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;background-color:rgb(255, 255, 255)"><div>188    const char* llcArgv[8];</div><div>189    int i = 0;</div><div>190    llcArgv[i++] = Prog.c_str();</div><div>191    llcArgv[i++] = Out.c_str();</div><div>192    if (shared) llcArgv[i++] = "-relocation-model=pic";</div><div>193    llcArgv[i++] = "-disable-fp-elim";</div><div><b>194   // llcArgv[i++] = "-f";                                     //Commented this line as there is no "-f" option for llc</b></div><div>195    llcArgv[i++] = "-o";</div><div>196    llcArgv[i++] = LlcOut.c_str();</div><div>197    llcArgv[i++] = 0;<span class="ecxApple-tab-span" style="white-space:pre">     </span></div></div><div style="line-height:17px;color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;background-color:rgb(255, 255, 255)"><br></div><div style="line-height:17px;color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;background-color:rgb(255, 255, 255)">and i added few more lines of code to print the commands being executed inside llcj.cpp</div><div style="background-color:rgb(255, 255, 255)"><div style="color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;line-height:17px"><br></div><div style="color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;line-height:17px">shyam@shyam:~$<b> llcj --main=hello hello.class -o hello</b></div><div style="color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;line-height:17px"><br></div><div style="color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;line-height:17px"><b>vmjc</b> /home/shyam/classpath-0.97.2/lib/vmkit/Release+Debug+Asserts/bin/vmjc --main=hello hello.class -f -o /tmp/llvm_WbIrdX/hello.bc </div><div style="color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;line-height:17px"><br></div><div style="color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;line-height:17px"><b>llc</b> /home/shyam/llvmbuild/Release+Debug+Asserts/bin/llc /tmp/llvm_WbIrdX/hello.bc -disable-fp-elim -o /tmp/llvm_WbIrdX/hello.s (null) </div><div style="color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;line-height:17px"><br></div><div style="color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;line-height:17px">unsupported GC: vmkit</div><div style="color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;line-height:17px">UNREACHABLE executed at /home/shyam/llvm-3.1.src/lib/CodeGen/GCMetadata.cpp:99!</div><div style="color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;line-height:17px">0  llc 0x08c83b58</div><div style="color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;line-height:17px">Stack dump:</div><div style="color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;line-height:17px">0.<span class="ecxApple-tab-span" style="white-space:pre"> </span>Program arguments: /home/shyam/llvmbuild/Release+Debug+Asserts/bin/llc /tmp/llvm_WbIrdX/hello.bc -disable-fp-elim -o /tmp/llvm_WbIrdX/hello.s </div><div style="color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;line-height:17px">1.<span class="ecxApple-tab-span" style="white-space:pre"> </span>Running pass 'Function Pass Manager' on module '/tmp/llvm_WbIrdX/hello.bc'.</div><div style="color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;line-height:17px"><br></div><div style="color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;line-height:17px">After observing the makefile of vmkit/tools/precompiler/trainer/Makefile i added the code to load the shared library StaticGCPrinter.so</div><div style="color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;line-height:17px"><br></div><div style="color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;line-height:17px"><span style="font-size:10pt"><b>shyam@shyam</b>:~$ llcj --main=hello hello.class -o hello</span></div><div style="color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;line-height:17px"><span style="font-size:10pt"><br></span></div><div><div><font color="#2a2a2a" face="Segoe UI, Tahoma, Verdana, Arial, sans-serif"><span style="line-height:17px">vmjc /home/shyam/classpath-0.97.2/lib/vmkit/Release+Debug+Asserts/bin/vmjc --main=hello hello.class -f -o /tmp/llvm_Wa4yw2/hello.bc </span></font></div><div><font color="#2a2a2a" face="Segoe UI, Tahoma, Verdana, Arial, sans-serif"><span style="line-height:17px"><br></span></font></div><div><font color="#2a2a2a" face="Segoe UI, Tahoma, Verdana, Arial, sans-serif"><span style="line-height:17px">llc /home/shyam/llvmbuild/Release+Debug+Asserts/bin/llc /tmp/llvm_Wa4yw2/hello.bc -disable-fp-elim -disable-branch-fold -disable-cfi -disable-debug-info-print -load=/home/shyam/classpath-0.97.2/lib/vmkit/Release+Debug+Asserts/lib/StaticGCPrinter.so -o /tmp/llvm_Wa4yw2/hello.s (null) </span></font></div><div><font color="#2a2a2a" face="Segoe UI, Tahoma, Verdana, Arial, sans-serif"><span style="line-height:17px"><br></span></font></div><div><font color="#2a2a2a" face="Segoe UI, Tahoma, Verdana, Arial, sans-serif"><span style="line-height:17px">llc: VmkitGCPrinter.cpp:283: llvm::Constant* FindMetadata(const llvm::Function&): Assertion `0 && "Should have found a JavaMethod"' failed.</span></font></div><div><font color="#2a2a2a" face="Segoe UI, Tahoma, Verdana, Arial, sans-serif"><span style="line-height:17px">0  llc 0x08c83b58</span></font></div><div><font color="#2a2a2a" face="Segoe UI, Tahoma, Verdana, Arial, sans-serif"><span style="line-height:17px">Stack dump:</span></font></div><div><font color="#2a2a2a" face="Segoe UI, Tahoma, Verdana, Arial, sans-serif"><span style="line-height:17px">0.<span class="ecxApple-tab-span" style="white-space:pre">      </span>Program arguments: /home/shyam/llvmbuild/Release+Debug+Asserts/bin/llc /tmp/llvm_Wa4yw2/hello.bc -disable-fp-elim -disable-branch-fold -disable-cfi -disable-debug-info-print -load=/home/shyam/classpath-0.97.2/lib/vmkit/Release+Debug+Asserts/lib/StaticGCPrinter.so -o /tmp/llvm_Wa4yw2/hello.s </span></font></div><div><font color="#2a2a2a" face="Segoe UI, Tahoma, Verdana, Arial, sans-serif"><span style="line-height:17px">1.<span class="ecxApple-tab-span" style="white-space:pre">  </span>Running pass 'Function Pass Manager' on module '/tmp/llvm_Wa4yw2/hello.bc'.</span></font></div><div><font color="#2a2a2a" face="Segoe UI, Tahoma, Verdana, Arial, sans-serif"><span style="line-height:17px"><b>shyam@shyam</b>:~$ </span></font></div></div><div><font color="#2a2a2a" face="Segoe UI, Tahoma, Verdana, Arial, sans-serif"><span style="line-height:17px"><br></span></font></div><div><font color="#2a2a2a" face="Segoe UI, Tahoma, Verdana, Arial, sans-serif"><span style="line-height:17px">After checking the code of VmkitGcPrinter.cpp the function<b> Constant* FindMetadata(const Function& F)</b> cannot identify </span></font><b style="font-size:10pt">JnJVM_hello_main___3Ljava_lang_String_2 </b><font size="2">(a </font>function<font size="2"> from hello.ll)</font></div><div style="color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;line-height:17px"><br></div></div><div style="line-height:17px;color:rgb(42, 42, 42);font-family:'Segoe UI', Tahoma, Verdana, Arial, sans-serif;background-color:rgb(255, 255, 255)">Can anyone tell me what went wrong</div>                                      </div></div>                                        </div></body>
</html>