<div dir="ltr">On 1 August 2013 13:47, Arji Cot <span dir="ltr"><<a href="mailto:arjicot@gmail.com" target="_blank">arjicot@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
It's possible to run clang and all the other related compiler tools on an armv5 or armv7 device ?<br></blockquote><div><br></div><div>Hi Arji,</div><div><br></div><div>You can download the ARMv7 binaries here: <a href="http://llvm.org/releases/download.html">http://llvm.org/releases/download.html</a></div>
<div><br></div><div>Or you can also use the x86 version, from your distro, or that download page, which you can use to cross-compile (as Jeffrey said, it's faster).</div><div><br></div><div>However, for both cases, you'll still need the correct libraries, generally provided by the GNU toolchain. There are several LLVM projects substituting the GNU libraries, but they're not mature enough yet to completely replace everything.</div>
<div><br></div><div>On ARM targets, you'll probably already have them, and on x86 hosts, you'll have to install them. If you're using Debian-based distro you can "apt-get install gcc-4.7-arm-linux-gnueabi" and point your clang (via -I and -L flags) to the include and library directories of the ARM toolchain.</div>
<div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">In other words: Can I use clang on an ARM device just like I'm used to on an X86 desktop machine ?<br>
</blockquote><div></div></div><br></div><div class="gmail_extra">Yes. If you're running on the ARM board, it should be just as easy as running on your x86 machine, because all the libraries and include headers will be on the right spot.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Cross-compilation is a bit of a pain, for now, as Clang has some trouble finding all tools (headers, libraries, binutils, etc) and it might end up sending some cryptic messages when it tried to use the native (x86) linker, for example. It's getting better, though, and it does know about most Linux distributions' preferences.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">On my Ubuntu machine, with gcc-4.7-multilib-arm-linux-gnueabihf installed, I call:</div><div class="gmail_extra"><br></div><div class="gmail_extra">$ clang -target arm-linux-gnueabihf -I /usr/arm-linux-gnueabihf/include -mcpu=cortex-a9 -mfpu=neon -mthumb file.c</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">And it works a charm, because Clang knows where binutils is (inferred from my target triple), however, it didn't infer my include path, which it could.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Feel free to post problems using Clang for ARM on this list and we'll strive to help the best we can.</div><div class="gmail_extra"><br></div><div class="gmail_extra">
cheers,</div><div class="gmail_extra">--renato</div></div>