llvm-gcc 4.0 question

Hi,

I am using the llvm-gcc 4.0 front end binaries from llvm.org on an intel
mac running 10.5.8. A couple of questions:

1) these binaries have "darwin8" as part of the file name. Are these
compatible with OS X 10.5.8 aka darwin9?

2) assuming (1) is ok, if I compile a hello world program using: gcc
-arch ppc hello.c, I get a ppc binary, but if I use llvm-gcc -arch ppc
hello.c, I get an i386 binary. Is there a way to tell llvm-gcc 4.0 to
produce a ppc binary? I've tried various options such as -march=ppc (or
powerpc), -mpowerpc, but no luck.

For llvm-gcc 4.2, the -arch ppc flag works.

Thanks,

Jose

Jose Rangel
QA Engineer
Arxan Technologies, Inc.

llvm-gcc-4.0 is no longer maintained. Use llvm-gcc-4.2.

Hi Dale,

Thanks for getting back. I may not be able to switch to llvm 4.2 at this
time. I did try:

llvm-gcc --emit-llvm -c sumarray.c -o sumarray.bc
llc -march=ppc32 sumarray.bc
gcc -arch ppc sumarray.s

And this produced a ppc binary that worked (at least in this case).

Do you know if this approach is worthwhile?

Thx,

Jose

Hi Dale,

Thanks for getting back. I may not be able to switch to llvm 4.2 at this
time. I did try:

llvm-gcc --emit-llvm -c sumarray.c -o sumarray.bc
llc -march=ppc32 sumarray.bc
gcc -arch ppc sumarray.s

And this produced a ppc binary that worked (at least in this case).

Do you know if this approach is worthwhile?

That won't work in the general case, because there are things about the ABI, such as calling convention, that are embedded in the .bc file. The front end needs to know you're targeting ppc.

Hi Dale,

Is there a way to get llvm 4.2 and os x 10.4 to work together? I am
trying to build on x86 10.5 for ppc 10.4 (using 10.4 sdk).

Thx,

Jose

Thanks again, Dale. Hopefully, someone has the answer.

Jose