On 21-11-2007 18:15:57 +0100, Fabian Groffen wrote:
[tefnut:/var/tmp] % powerpc-apple-darwin8-gcc -m64 -o test.ppc64 -c test.c [tefnut:/var/tmp] % powerpc-apple-darwin8-gcc -o test.ppc -c test.c [tefnut:/var/tmp] % file test.ppc{,64} test.ppc: Mach-O object ppc test.ppc64: Mach-O 64-bit object ppc64 [tefnut:/var/tmp] % uname -a Darwin tefnut 8.11.0 Darwin Kernel Version 8.11.0: Wed Oct 10 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC Power Macintosh powerpc PowerMac8,2 Darwin [tefnut:/var/tmp] % lipo -create test.ppc{,64} -output test [tefnut:/var/tmp] % /usr/bin/file test test: Mach-O fat file with 2 architectures test (for architecture ppc): Mach-O object ppc test (for architecture ppc64): Mach-O 64-bit object ppc64
This actually also works on a non-64-bits machine, as code generation is not the problem. Running it is, of course.
The proof of the pudding is in the eating of course: [build-macosx:/var/tmp] % powerpc-apple-darwin8-gcc-4.0.1 -m64 -o test test.c [build-macosx:/var/tmp] % file test test: Mach-O 64-bit executable ppc64 [build-macosx:/var/tmp] % ./test tcsh: ./test: Bad CPU type in executable.