[cfe-dev] Clang and related tools are for ARM too ?

Jeffrey Walton noloader at gmail.com
Fri Aug 2 01:30:29 PDT 2013


On Fri, Aug 2, 2013 at 4:11 AM, Renato Golin <renato.golin at linaro.org> wrote:
> On 1 August 2013 13:47, Arji Cot <arjicot at gmail.com> wrote:
>>
>> It's possible to run clang and all the other related compiler tools on an
>> armv5 or armv7 device ?
> ...
> 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.
--sysroot is very helpful here
(http://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html). 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



More information about the cfe-dev mailing list