Why is one compiler on 10.6 able to generate PPC binaries and not the other?

Jeremy Huddleston Sequoia jeremyhu at macports.org
Fri Mar 11 00:35:13 PST 2016


> On Mar 10, 2016, at 17:20, Mojca Miklavec <mojca at macports.org> wrote:
> 
> On 10 March 2016 at 21:26, Ryan Schmidt wrote:
>>> On Mar 10, 2016, at 1:00 PM, Mojca Miklavec wrote:
>>> 
>>> Hi,
>>> 
>>> While following
>>>   https://trac.macports.org/wiki/LibcxxOnOlderSystems#Leopardppc
>>> on 10.6/x86_64 I tried to install clang 3.7 (thinking that version 3.7
>>> might have an even better support for PPC than 3.6).
>>> 
>>> The problem is that clang-mp-3.7 doesn't want to produce ppc binaries,
>>> so I wasn't able to install libcxx. I get:
>>> 
>>>> clang++-mp-3.7 a.cc -arch ppc
>>> ld: unknown/unsupported architecture name for: -arch ppc
>>> clang: error: linker command failed with exit code 1 (use -v to see invocation)

The linker you have installed doesn't support ppc.  You need to install ld64 with the +ld64_127 variant to get the last version of the linker that supported ppc.

>>> At the same time clang++-mp-3.4 works fine even though both clang 3.4
>>> and 3.7 are x86_64 only.

That's because it's actually just acting a s front-end to gcc for -arch ppc.

>>> I'm now trying to rebuild everything as +universal (with ppc included
>>> in the list of universal architectures) and hope that it will work
>>> afterwards.

Nope.  That has nothing to do with it.  That just means what architectures the clang executable will run on, not which architectures and platforms it will target.

>>> But I would be grateful for ideas about why clang 3.4
>>> would be able to create ppc binaries and clang 3.7 not.

3.4 doesn't.
3.7 does, but you didn't have the correct linker.

>>> Thank you,
>>>  Mojca
>>> 
>>> PS: I'm not actually using the PPC, I'm doing this all for fun and as
>>> a challenge. But I don't have any VM with 10.5, so I wanted to do the
>>> cross-compiling step on VM with 10.6.
>> 
>> Maybe:
>> 
>> https://trac.macports.org/changeset/129356
> 
> Weird. This changes predates the initial version of
>    https://trac.macports.org/wiki/LibcxxOnOlderSystems
> that suggests cross-compiling libcxxabi with ppc support.
> 
> Judging from
>    http://www.csl.cornell.edu/~fang/sw/llvm/
> I would imagine that there must be a way to compile libc++ (even on
> 10.4 and even if from another repository). The problem is a bit of a
> chicken-and-egg, requiring a working clang-3.6 (3.7?) compiler to
> build libc++; but 3.7 would refuse to do the linking step. Maybe I'll
> need to do that in multiple stages as described on that website.
> 
> I'm waiting for the universal build of clang 3.4 to finish first. I
> don't know if that will make any difference, but let's see.
> 
> Mojca



More information about the macports-dev mailing list