Sat Jan 7 20:31:00 CET 2006

Universal binaries problem?

I spend a lot of time these days on universal binaries stuff and general Mac OS X OpenOffice.org work. Thus I'm building with gcc-3.3 and gcc-4.0.1 and mix various setups on one machine. Today, I forgot to gcc_select back to gcc 4.0.1 and tried to build universal binaries with gcc-3.3. This was the result:
cc -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
   -arch i386 -arch ppc -c -o ex.o ex.c
cc: cannot specify -o with -c or -S and multiple compilations
First I was surprised what I have done wrong and then I realized I forgot to gcc_select 4.0.1. This works with gcc-4.0.1 without problems.

This brought interesting question that I'm still not able to answer.

My goal is to have universal binary form of OpenOffice.org that will (in the future) work on both PPC and Intel based Macintoshes on both Panther (PPC) and Tiger (PPC and Intel). This means I have to use gcc-3.3 for PowerPC platform and gcc-4 for Intel platform. Xcode has the settings for this described in the Cross-Development Programming Guide. But how to achieve this on command line. Is it possible at all without using lipo?

Can you help with this problem?

Posted by Pavel | Permanent link | File under: Mac OS X