Thanks Akira,<div>it worked!<br><br><div class="gmail_quote">On Thu, Feb 23, 2012 at 10:01 PM, Akira Hatanaka <span dir="ltr"><<a href="mailto:ahatanak@gmail.com">ahatanak@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

You will need to install a cross compiler.<br>
I think you can find one somewhere in this link:<br>
<a href="https://sourcery.mentor.com/GNUToolchain/" target="_blank">https://sourcery.mentor.com/GNUToolchain/</a><br>
<br>
Once you have a cross compiler, this should do what you want (if you<br>
want little-endian code):<br>
<br>
clang -target mipsel-unknown-linux  -ccc-clang-archs mipsel -O3<br>
hello.c -o hello.bc -emit-llvm<br>
llc -march=mipsel hello.bc  -o hello.s<br>
mips-linux-gnu-gcc hello.s -o hello -mips32 -EL<br>
<br>
You can also generate object code with this command:<br>
<br>
llc -march=mipsel hello.bc  -o hello.o -filetype=obj<br>
<br>
Then run the linker:<br>
mips-linux-gnu-gcc hello.o -o hello -mips32 -EL<br>
<div><div class="h5"><br>
On Thu, Feb 23, 2012 at 4:18 PM, Rafael BP <<a href="mailto:parizi.computacao@gmail.com">parizi.computacao@gmail.com</a>> wrote:<br>
> This is true?<br>
> clang/llvm cannot produce mips object code or executable (yet).<br>
> from:<br>
> <a href="http://old.nabble.com/How-to-get-MIPS-from-clang-%2B-llvm---td32822926.html" target="_blank">http://old.nabble.com/How-to-get-MIPS-from-clang-%2B-llvm---td32822926.html</a><br>
><br>
><br>
> On Thu, Feb 23, 2012 at 8:37 PM, Rafael BP <<a href="mailto:parizi.computacao@gmail.com">parizi.computacao@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Hi,<br>
>> How can I generate executable to mips with llvm-gcc.<br>
>> I'm using Ilvm-2.9, X86PC and the following commands:<br>
>><br>
>> llvm-gcc -emit-llvm hello.c -c -o hello.bc (OK)<br>
>> llc -march=mips hello.bc  -o hello.s (OK)<br>
>><br>
>> gcc hello.s -o hello (does not work).<br>
>><br>
>> Thanks,<br>
>><br>
>> --<br>
>> Rafael Parizi<br>
>><br>
>><br>
>><br>
><br>
><br>
><br>
> --<br>
> Rafael Parizi<br>
><br>
><br>
><br>
><br>
</div></div>> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:LLVMdev@cs.uiuc.edu">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><br clear="all"><div><br></div>-- <br><font><b><i>Rafael Parizi</i></b></font><br><br><br><br>
</div>