[cfe-dev] [LLVMdev] how to change a compiler from a host to a target in Clang's assembler and linker

Joerg Sonnenberger joerg at britannica.bec.de
Fri Jul 6 14:41:01 PDT 2012


On Fri, Jul 06, 2012 at 10:40:58PM +0400, Simon Atanasyan wrote:
> * Little-endian 32-bit
> $ clang -target mipsel-linux-gnu main.c -static \
>     --sysroot $MIPS/mips-linux-gnu/libc/el \
>     -I$MIPS/mips-linux-gnu/libc/usr/include \
>     -B$MIPS/lib/gcc/mips-linux-gnu/4.5.2/el \
>     -L$MIPS/lib/gcc/mips-linux-gnu/4.5.2/el \
>     -integrated-as

-isysroot $MIPS/mips-linux-gnu/libc might be better than the -I.
Your command doesn't give you the special handling for system headers.

Joerg



More information about the cfe-dev mailing list