Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Simultaneously compiling for G3 and G4

Setting CFLAGS to "-arch ppc -arch ppc64 -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk"

allows me to generate a multi-architecture binary containing ppc G3, ppc G5 and i386 code (ppc/ppc64/i386) using GCC.

How do I generate a multi-architecture binary containing ppc G3 and ppc G4 code in a single compilation (i.e. a multi-architecture binary containing ppc and ppc7450 architectures), i.e. without compiling in several passes and using lipo?

It seems that multiple -mcpu / -mtune / -march flags are not supported.

Thank you.

iBook G4, Mac OS X (10.4.10)

Posted on Aug 27, 2007 9:30 AM

Reply
2 replies

Aug 27, 2007 12:28 PM in response to Dr. T

Hi,

G3 and G4 aren't actually different architectures, they are both 32bit PowerPC; the only big difference is that the G4 supports Altivec. If your application doesn't benefit from Altivec the performance differences are likely negligible (and the difference with Altivec is relevant only if you generate Altivec code yourself; if you use the relevant frameworks from Apple they will automatically use Altivec whenever available). In other words: why do you think that you need explicit G3 and G4 support?

Regards, Colin

Aug 27, 2007 1:00 PM in response to Cohi

To be honest I can't think of many real examples at the moment. I thought performance differences were greater and I'm mounting the same shared /usr/local on both a G3 iBook and a G4 iBook so wanted both binaries compiled.

The only real-life example I do, however, have is that anything that links statically with GMP will want to come in separate G3 and G4 versions (that's assuming I can work out how to get GMP to compile a ppc7450-optimized version without tagging it as a generic ppc object file).

Simultaneously compiling for G3 and G4

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.