Clang and related tools are for ARM too ?

It’s possible to run clang and all the other related compiler tools on an armv5 or armv7 device ?

In other words: Can I use clang on an ARM device just like I’m used to on an X86 desktop machine ?

Thanks.

It's possible to run clang and all the other related compiler tools on an
armv5 or armv7 device ?

Apple usually handles the Clang port for their operating systems. The
a release lag, of course. The list has some messages about dialing in
the latest Clang to a Xcode installation.

AOSP/Android has ported Clang 3.2 and 3.3 to their NDK R9. The R8 NDK
included Clang 3.2.

In other words: Can I use clang on an ARM device just like I'm used to on an
X86 desktop machine ?

Well, I imagine it would be painful to run a compiler on a phone,
though some are doing it on tablets.

More often, a cross compiler is built for a host (your desktop) for a
target (your phone or tablet).

Jeff

It's possible to run clang and all the other related compiler tools on an
armv5 or armv7 device ?

Hi Arji,

You can download the ARMv7 binaries here:
http://llvm.org/releases/download.html

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).

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.

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.

In other words: Can I use clang on an ARM device just like I'm used to on

an X86 desktop machine ?

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.

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.

On my Ubuntu machine, with gcc-4.7-multilib-arm-linux-gnueabihf installed,
I call:

$ clang -target arm-linux-gnueabihf -I /usr/arm-linux-gnueabihf/include
-mcpu=cortex-a9 -mfpu=neon -mthumb file.c

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.

Feel free to post problems using Clang for ARM on this list and we'll
strive to help the best we can.

cheers,
--renato

--sysroot is very helpful here
(Directory Options (Using the GNU Compiler Collection (GCC))). It takes
nearly all the pain out of header and library paths. I've never had
any pains from the command line on Android or iOS using it.

Jeff