[Qt-interest] Qt 4.5 on Mac OSX: Attempt to build quad frameworks omits -arch i386 from CFLAGS/CXXFLAGS

Trenton Schulz trenton.schulz at nokia.com
Tue Mar 17 09:25:23 CET 2009


On 2009-03-16 22:54:10 +0100, Rush Manbert <rush at manbert.com> said:

> 
> On Mar 16, 2009, at 3:42 AM, Trenton Schulz wrote:
> 
>> On 2009-03-12 18:33:26 +0100, Rush Manbert <rush at manbert.com> said:
>> 
>>> Based on information from Mike Jackson, I attempted to build a  shared,
>>> framework-based, quad library version of Qt 4.5.
>>> 
>>> My configure command as:
>>> time ./configure -prefix /Users/rmanbert/temp/qt4.5.0-quadDylib - debug-
>>> and-release -no-qt3support -cocoa -framework -webkit -arch i386 -arch
>>> x86_64 -arch ppc -arch ppc64 -platform macx-g++
>>> 
>>> After building qmake, configure shows me this:
>>> Build type:    macx-g++
>>> Architecture:  macosx ( i386 x86_64 ppc ppc64 )
>>> Using framework: Cocoa
>>> 
>>> 
> 
> <snip>
> 
>>> 
>>> I ran make and noticed that none of the compile commands included -
>>> arch i386. They has the other 3 architectures specified, but not  i386.
>>> 
>>> I stopped the make, found some object files and ran lipo -info on
>>> them. Lipo says "Architectures in the fat file: qmutex.o are: ppc64
>>> ppc7400 x86_64"
>>> 
>>> Since I specified the i386 architecture first in my configure command
>>> and it was missing in the Makefiles, I tried again with ppc specified
>>> first. The Makefiles once again define these flags:
>>> CFLAGS        = -pipe -g -gdwarf-2 -arch ppc64 -Xarch_ppc64 -mmacosx-
>>> version-min=10.5 -arch x86_64 -Xarch_x86_64 -mmacosx-version- min=10.5 -
>>> arch ppc -Wall -W $(DEFINES)
>>> CXXFLAGS      = -pipe -g -gdwarf-2 -arch ppc64 -Xarch_ppc64 -mmacosx-
>>> version-min=10.5 -arch x86_64 -Xarch_x86_64 -mmacosx-version- min=10.5 -
>>> arch ppc -Wall -W $(DEFINES)
>>> LFLAGS        = -headerpad_max_install_names -arch ppc64 - Xarch_ppc64 -
>>> mmacosx-version-min=10.5 -arch x86_64 -Xarch_x86_64 -mmacosx-version-
>>> min=10.5 -arch ppc
>>> 
>>> and again the i386 is missing.
>>> 
>>> I'm building on an Intel Mac, so it almost seems like the Makefiles
>>> assume there will be a implicit compilation for i386, but the lipo
>>> results say that's not true.
>>> 
>>> I suspect this is a bug, but maybe I have done something wrong. Does
>>> anyone else have experience with this?
>> 
>> It shouldn't make a difference but could you adjust your configure  line
>> to do specify the arch like this:
>> 
>> -arch "ppc x86 ppc64 x86_64"
>> 
>> Note the quotes!
>> 
>> If that works, please file a bug, because both ways should work.
>> 
>> Good luck,
> 
> Hi Trenton,
> 
> So I tried what you wrote and it worked. I was filing the bug report  
> when I noticed that your arch specification says "x86" and not "i386".  
> I went back and tried again with "-arch ppc -arch x86 -arch ppc64 - 
> arch x86_64" and then grepped the Makefiles. This time they all have "- 
> arch i386" as part of the CFLAGS and CXXFLAGS.
> 
> IMHO, the real issue is that configure takes "-arch i386" but  
> internally only looks for "x86". While this is consistent with "-arch  
> x86_64", GCC (and Xcode) is inconsistent in this regard and uses  
> "i386". If the Qt configure is going to use a different architecture  
> name in its command line arguments than what the compiler wants to  
> see, doesn't it seem like it should complain about "-arch i386"?  
> Either that or it should look for it internally so it propagates into  
> the Makefiles.

Ah. I should have looked closer (serves me right for only skimming). 
We've had this inconsistency (between us and Apple) since we started 
doing universal stuff and we've kept it that way for the sake of 
consistency. However, I don't see what's wrong with making it a 
synonym. Could you please file a suggestion so we don't forget about 
this?

Thanks,

-- Trenton




More information about the Qt-interest-old mailing list