building clang as a crosscompiler

Hi,

I’m having some problems building clang as a crosscompiler.
What’s the status on crosscompilation?
Can you, say, build clang on a x86_64 to compile for powerpc? (I got error while building clang)
Can you build clang to compile for pic16? I can’t get configure to accept the target.

Thanks,
Luís Marques

Luís Marques a écrit :

Hi,

I'm having some problems building clang as a crosscompiler.
What's the status on crosscompilation?
Can you, say, build clang on a x86_64 to compile for powerpc? (I got error while building clang)
Can you build clang to compile for pic16? I can't get configure to accept the target.

Thanks,
Luís Marques

I think you just need to compile clang/llvm for your devel architecture (x86_64) and then you pass the correct architecture (or triple) argument to clang when exectuting. you may need to add your architecture in clang.

Cédric

I don't know about the current status of this function but AFAK this is not a build configuration option.
You can build it using a "./configure && make" command and then using it using the arch argument:

clang -arch ppc myFile.c
clang -arch i386 myFile.c