Using Clang/LLVM on sparc/solaris


I have an instrumented version of clang that I want to use to emit
code for a sparc simulator. I tried installing clang+llvm on solaris,
and got a number of build issues.

I also tried to cross compile using my x86 build of clang, targeting
sparc, but I had two problems with that
1) I can't figure out what options to use in clang to generate solaris/sparc.
2) If I just emit llvm ir using clang, and then try to compile it
using llc -march=sparc I get sparc assembly that is rejected by a
solaris compiler with the error "invalid character (0x40)"

Has anyone successfully done this? Any tips about what I could be
doing differently?

Thanks a lot!