I am trying to build a cross compiler for Sparc on x386 host. I tried to run configure with
but in both cases I got llvm compiler for x86 target. Is there a way to build a cross compiler
for Sparc (or ARM)?
– Fima Rabin
If you're building llvmCore, then it builds a compiler for all targets by default. The target is selected at runtime. You can use -mtriple, -march and such as options to llc to control which target to emit code for.
e.g., to produce an ARM assembly file from a foo.bc bitcode file:
llc -march=arm foo.bc
If you haven't read it already, http://llvm.org/docs/GettingStarted.html has good information which should help. Likewise, if you're building the llvm-gcc front end as well as the llvmCore back-end, http://llvm.org/docs/GCCFEBuildInstrs.html should help get you moving in the right direction.