[PATCH][Revised2]PR41180 pt2: fix config.guess on darwin10

Jack Howarth howarth@bromo.med.uc.edu
Thu Sep 3 23:36:00 GMT 2009


On Thu, Sep 03, 2009 at 11:43:53AM -0700, Mike Stump wrote:
> On Sep 2, 2009, at 8:46 PM, Ben Elliston wrote:
>> On Wed, 2009-09-02 at 20:01 -0400, Jack Howarth wrote:
>>
>>> +	    i386) eval $set_cc_for_build
>>> +	          if $CC_FOR_BUILD -E -dM -x c /dev/null | grep __LP64__>/ 
>>> dev/null 2>&1 ; then
>>> +	            UNAME_PROCESSOR=x86_64
>>> +	          fi ;;
>>
>> OK.  It's a bit of a shame that we now need GCC installed just to run
>> config.guess.  I have been working hard to reduce the number of  
>> systems
>> that do this.
>
> One could check to see if CC_FOR_BUILD exists.  If it doesn't using  
> UNAME_PROCESSOR unchanged is fine.

Are you sure about that? The idea of the config.guess change is to make
sure that the output for UNAME_PROCESSOR matches that actual code type
being executed. Without the test with CC_FOR_BUILD, config.guess will
always report i386 despite x86_64 code being the default for execution.
I had pushed for a change in the default output of the arch command in
Snow Leopard so that it would report x86_64 in this case as the arch
manpage in shows...

     The arch command with no arguments, displays the machine's architecture
     type.

     The other use of the arch command it to run a selected architecture of a
     universal binary.  A universal binary contains code that can run on dif-
     ferent architectures.  By default, the operating system will select the
     architecture that most closely matches the processor type.  This means
     that an intel architecture is selected on intel processors and a powerpc
     architecture is selected on powerpc processors.  A 64-bit architecture is
     preferred over a 32-bit architecture on a 64-bit processor, while only
     32-bit architectures can run on a 32-bit processor.

So Apple has a gap in logic there. If the 64-bit architecture is preferred
over the 32-bit architecture, one would think that arch without arguments
should report this preferred architecture and not always i386.
           Jack



More information about the Gcc-patches mailing list