<div dir="rtl"><div dir="ltr">+llvmdev</div><div dir="ltr"><br></div><div dir="ltr">Yes, the best solution would be to support COFF dynamic loading so you could load COFF object files from disk as well as JITed ones and run them together.</div><div dir="ltr"><br></div><div dir="ltr">Otherwise, you need to add -elf to the triple. Patching <span style="font-family:Consolas;font-size:12.8000001907349px">getProcessTriple() </span>would work but it's not the correct way, the change should be local, use EngineBuilder::setMArch.</div><div dir="ltr"><br></div><div dir="ltr">Yaron</div><div dir="ltr"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div dir="ltr">2015-02-17 0:37 GMT+02:00 llvm 999 <span dir="ltr"><<a href="mailto:llvm.999@outlook.com" target="_blank">llvm.999@outlook.com</a>></span>:</div><blockquote class="gmail_quote" style="margin:0 .8ex;border-left:1px #ccc solid;border-right:1px #ccc solid;padding-left:1ex;padding-right:1ex">


<div><div dir="ltr">If I understand correctly, the "really correct" solution is the provide a dynamic loader for COFF object format, which LLVM dos not currently support?<br> <br>To get example working, I did the following in host.cpp:<br> <br><font face="Consolas">std::</font><font color="#2b91af" face="Consolas"><font color="#2b91af" face="Consolas">string</font></font><font face="Consolas"> sys::getProcessTriple() {</font><br><font face="Consolas">
</font><br><font face="Consolas">  </font><font color="#2b91af" face="Consolas"><font color="#2b91af" face="Consolas">Triple</font></font><font face="Consolas"> PT(</font><font color="#2b91af" face="Consolas"><font color="#2b91af" face="Consolas">Triple</font></font><font face="Consolas">::normalize(</font><font color="#6f008a" face="Consolas"><font color="#6f008a" face="Consolas">LLVM_HOST_TRIPLE</font></font><font face="Consolas">));</font><br><font face="Consolas">

</font><br><font face="Consolas">  </font><font color="#0000ff" face="Consolas"><font color="#0000ff" face="Consolas">if</font></font><font face="Consolas"> (</font><font color="#0000ff" face="Consolas"><font color="#0000ff" face="Consolas">sizeof</font></font><font face="Consolas">(</font><font color="#0000ff" face="Consolas"><font color="#0000ff" face="Consolas">void</font></font><font face="Consolas"> *) == 8 && PT.isArch32Bit())</font><br> <br><font face="Consolas">
<br>    PT = PT.get64BitArchVariant();<br>
<br></font><font face="Consolas">  </font><font color="#0000ff" face="Consolas"><font color="#0000ff" face="Consolas">if</font></font><font face="Consolas"> (</font><font color="#0000ff" face="Consolas"><font color="#0000ff" face="Consolas">sizeof</font></font><font face="Consolas">(</font><font color="#0000ff" face="Consolas"><font color="#0000ff" face="Consolas">void</font></font><font face="Consolas"> *) == 4 && PT.isArch64Bit())</font><br> <br><font face="Consolas">
<br>    PT = PT.get32BitArchVariant();<br>

<br></font><font face="Consolas">  </font><font color="#0000ff" face="Consolas"><font color="#0000ff" face="Consolas">return</font></font><font face="Consolas"> PT.str()<strong><u> + </u></strong></font><font color="#a31515" face="Consolas"><font color="#a31515" face="Consolas"><strong><u>"-elf"</u></strong></font></font><font face="Consolas">;</font><br> <br><font face="Consolas">
<br>}<br> <br></font><br> It seems this has fooled the system into thinking we have an "elf" format object?<br> <br>Why did this work? (Should it have worked?)<br><div><hr>From: <a href="mailto:yaron.keren@gmail.com" target="_blank">yaron.keren@gmail.com</a><br>Date: Tue, 17 Feb 2015 00:18:13 +0200<br>Subject: Re: [LLVMdev] (no subject)<br>To: <a href="mailto:llvm.999@outlook.com" target="_blank">llvm.999@outlook.com</a><br>CC: <a href="mailto:llvmdev@cs.uiuc.edu" target="_blank">llvmdev@cs.uiuc.edu</a><br><br><div dir="rtl"><div dir="ltr">If you're running code under the JIT, it has a dynamic loader for ELF but not COFF object format , so you'll need to produce ELF objects. As the default under Windows is COFF you'll need to add -elf to the triple.</div><div dir="ltr"><br></div><div dir="ltr"><br></div></div><div><br><div><div dir="ltr">2015-02-17 0:01 GMT+02:00 llvm 999 <span dir="ltr"><<a href="mailto:llvm.999@outlook.com" target="_blank">llvm.999@outlook.com</a>></span>:</div><blockquote style="padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">


<div><div dir="ltr"> This is my first post so not sure I've done everything right.<br> <br>Just started playing with LLVM on Windows 7, VS C++.<br>Was trying to play with the example 4 and got the following error:<br> <br><pre><i>"LLVM ERROR: Incompatible object format"</i></pre><pre><em></em> </pre><pre><em>I was able resolve the problem by following the suggestion found here:</em></pre><pre><a href="http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-December/068395.html" target="_blank">http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-December/068395.html</a></pre><pre> </pre><pre>This issue seems to be an old one and it is now resurfacing?</pre><pre>Or was there anything I did wrong?</pre>                                       </div></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div></div>                                       </div></div>
</blockquote></div><br></div>