[LLVMdev] cross llvm

Mike Stump mrs at apple.com
Fri Apr 10 13:07:35 PDT 2009

On Apr 10, 2009, at 12:04 PM, Greg McGary wrote:
> How do I use clang as a cross compiler?

In clang-cc speak, it is:

$ clang-cc --help | grep trip
   -triple=<string>                    - Specify target triple (e.g.  

> I don't see a configure step for specifying a target arch/cpu when  
> building clang, yet I also don't see options to specify a target  
> arch/cpu.

Around here, we use options like -arch ppc to do this.  They modify  
the cpu, but no so much the OS or vendor parts of the triple.  The  
problem is that gcc doesn't do it quite like this.

   -V version  -b machine

are the usual options that come the closest to doing this.  You can  
ask on the clang list and see if Daniel has a preferred method yet for  
doing this, but I'm thinking it was still just a fixme.  -barm-linux  
or some such might be the way forward.  See HostInfo.cpp, if you want  
to roll your own target with -arch.

More information about the llvm-dev mailing list