[LLVMdev] Is cross-compiling for ARM on x86 with llvm/Clang possible?

Tim Northover t.p.northover at gmail.com
Wed Nov 21 10:13:50 PST 2012


Hi Negar,

> In file included from ../../../../LLVM/project/file1.cpp:8:
> /usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../include/c++/4.6/iostream:38:10:
> fatal error:
>       'bits/c++config.h' file not found
> #include <bits/c++config.h>
>          ^

That's a compile-time error rather than link-time. Clang does its best
to find all the bits of the cross-toolchain it needs, but it doesn't
always succeed. The immediate error is it not knowing about the
directory where c++config.h is stored, but in fact that path it's
getting "iostream" from looks a little dodgy too. If I'm calculating
my ..s correctly, it's "/usr/include/c++/4.6/iostream" which is
probably the host's copy. It *may* be compatible, but then again it
may not.

Some combination of --sysroot, -gcc-toolchain and -target may be
enough, but for more complex installations you may need to manually
give it some -isystem options too.

What clang command-line (and/or configure options) are you using to
tell it where to find the arm-linux-gnueabi toolchain?

Tim.



More information about the llvm-dev mailing list