<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
There is also:<br>
<br>
1) an alternate clang driver at <a
href="http://code.google.com/p/alternate-clang-driver/">http://code.google.com/p/alternate-clang-driver/</a>
. This makes<br>
it more or less gcc compatible.<br>
<br>
2) there is a way to invoke it all directly with just a call to
clang as is with x86/linux but it's not totally<br>
finished. i will try and post something about this. the direct form
will work if you are on a <br>
mips linux machine but there are still some issues running it as a
cross.<br>
<br>
<br>
On 02/26/2012 05:36 PM, Rafael BP wrote:
<blockquote
cite="mid:CALhe0+Hm1q42jPBCk5DApsk0ozS1sRUHs=Brczg30wxppdzRQg@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
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 moz-do-not-send="true"
href="mailto:ahatanak@gmail.com">ahatanak@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
You will need to install a cross compiler.<br>
I think you can find one somewhere in this link:<br>
<a moz-do-not-send="true"
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
moz-do-not-send="true"
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 moz-do-not-send="true"
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
moz-do-not-send="true"
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 moz-do-not-send="true"
href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>
<a moz-do-not-send="true"
href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> <a moz-do-not-send="true"
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>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
</blockquote>
<br>
</body>
</html>