<div dir="ltr">llc will make an object file with MIPS machine code for only the functions in your test.bc. You then need to link it with any MIPS libraries it needs (usually at least the C runtime library that calls main() for you etc).<div><br></div><div>The generated code will have exactly the data types (e.g. integer sizes) and struct layouts specified in your test.bc. These might or might not be correct for MIPS. If you're running on bare hardware then it's probably ok, but if you call library functions then you need to be laying out the data in the correct way. If you wrote test.bc yourself then that's your job, but usually it's the job of e.g. clang, and you need to also tell clang that you're compiling for MIPS (and which ABI) so it does that correctly.</div><div><br></div><div>A random .bc file for a similar enough machine might work -- same sizes, same padding rules and so forth. But unless you know for sure those are the same then chances are good that it won't work.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 2, 2015 at 11:37 PM, fateme Hoseini via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span style="color:rgb(69,77,75);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13.44px;background-color:rgb(250,249,245)">Hi everyone, </span><br style="color:rgb(69,77,75);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13.44px;background-color:rgb(250,249,245)"><span style="color:rgb(69,77,75);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13.44px;background-color:rgb(250,249,245)">I am a new commer and I 'm tying to use LLVM to cross compile a code. I want to cross compile to MIPS and the host is the default x86. The more I read the document the more confused I get. I see documents on cross-compiling to ARM. But some install some gcc packages, while some use clang. I don't know where to start and how to do it. </span><br style="color:rgb(69,77,75);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13.44px;background-color:rgb(250,249,245)"><span style="color:rgb(69,77,75);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13.44px;background-color:rgb(250,249,245)">Is this just enough to run a command line like this: </span><br style="color:rgb(69,77,75);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13.44px;background-color:rgb(250,249,245)"><br style="color:rgb(69,77,75);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13.44px;background-color:rgb(250,249,245)"><span style="color:rgb(69,77,75);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13.44px;background-color:rgb(250,249,245)">llc -march=mips test.bc -o testmips </span><br style="color:rgb(69,77,75);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13.44px;background-color:rgb(250,249,245)"><br style="color:rgb(69,77,75);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13.44px;background-color:rgb(250,249,245)"><span style="color:rgb(69,77,75);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13.44px;background-color:rgb(250,249,245)">will the testmips file be executable for mips? </span><br style="color:rgb(69,77,75);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13.44px;background-color:rgb(250,249,245)"><span style="color:rgb(69,77,75);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13.44px;background-color:rgb(250,249,245)">I will appreciate if anyone help me with this problem. </span><br style="color:rgb(69,77,75);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13.44px;background-color:rgb(250,249,245)"><span style="color:rgb(69,77,75);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13.44px;background-color:rgb(250,249,245)">Thanks, </span><br style="color:rgb(69,77,75);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13.44px;background-color:rgb(250,249,245)"><span style="color:rgb(69,77,75);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13.44px;background-color:rgb(250,249,245)">Fami</span><br></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>