config-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch for config.guess for "cross-compiling" x86_64 -> powerpc on Ma


From: Mojca Miklavec
Subject: Re: Patch for config.guess for "cross-compiling" x86_64 -> powerpc on Mac OS X <= 10.6
Date: Wed, 19 Apr 2017 12:18:22 +0200

On 19 April 2017 at 03:52, Bruno Haible wrote:
> The patch looks good to me:

Thank you.

>   - The patch is complete: When you compile with "gcc -arch ppc64" you
>     get executables of type 'Mach-O 64-bit executable ppc64' but such
>     files are not directly executable on x86_64 Mac OS X 10.5.8:
>       $ ./a.out
>       -bash: ./a.out: Bad CPU type in executable

What do you actually get in that case?

I thought it would return powerpc64, but I'm not 100% sure how the
flow goes in that case.

>> The main problem is that config.guess is being used by various
>> software packages to answer two completely different questions and the
>> answer might not always be the same:
>>
>> (1) Which platform am I building for?
>> (2) Which platform am I running on / which binaries should I download?
>
> config.guess is the answer for (1). That's why it uses $CC_FOR_BUILD.

In that case CC='clang -arch i386' gives the wrong answer on OS X 10.7
and later.

But I'm sure there will be complaints if that changes to call the
compiler each time in cases where config.guess is (mis)used to
determine the current platform - which btw. works very well in most
cases.
(Confirmed by comments like "# Avoid executing cc on OS X 10.9".)

I'm still slightly confused about something else in that case. In the
past I always used

    CC=gcc
    CFLAGS="-arch ppc"

when compiling for another architecture. But I suspect that
config.guess ignores CFLAGS when checking the architecture? Is that on
purpose?

> For (2) there is no simple answer on bi-arch systems.

There might not be an unique answer, but there are usually reasonable
defaults (which could often be extracted without consulting the
compiler). And config.guess probably comes the closest to any other
alternative when determining that for such a wide range of platforms.

Mojca



reply via email to

[Prev in Thread] Current Thread [Next in Thread]