Is any clang version known to work in PPC/Tiger?

Mojca Miklavec mojca at macports.org
Sun Apr 3 22:31:19 PDT 2016


On 4 April 2016 at 00:44, César wrote:
> On 3 de April 2016, Mojca Miklavec wrote:
>> On 3 April 2016 at 22:13, César wrote:
>> > I've read that clang/llvm have been improving their PPC support over the
>> > years. But, is any version known to build?
>>
>> I have clang-3.4 installed on 10.5 PPC. Installing the latest versions
>> requires quite a bit of bootstrapping headaches:
>>     https://trac.macports.org/wiki/LibcxxOnOlderSystems
>
> I tried several clang versions and port rejected to do so, telling that
> Intel was required. I don't remember if it was 3.4 or 3.3 the most recent
> version that didn't stop with that error (I think it was 3.3 but I'm not
> sure now).

I don't see anything obvious that would prevent one from compiling 3.3
on PPC, but I made just a short glimpse. In any case I would go for
3.4 rather than 3.3.

> BTW, reading that wiki link, makes me feel it's quite scary to use clang for
> distributable apps in anything older than Mountain Lion.

That should be "anything older that Lion". Lion comes with libc++
preinstalled. Only 10.6 and earlier lack that library. And even then
it's not about clang per se, but about using the latest versions of
clang which support C++11 and also require libc++. Version 3.4 works
with the default stdlibc++ installed on the system.

> Does that article
> mean that the users machines must install a working libc++ if the app has
> C++ code?

If the app has C++11 code, you won't even be able to compile it
without libc++ (or without libstdc++ version 3 & a recent GCC, but in
that case you would be facing exactly the same problem: you would have
to install a separate libstdc++).

But yes, if the app has C++ code and if you use clang > 3.4 (or maybe
> 3.5, I'm not sure), the binaries will link against libc++ that you
would have to ship with the binary.

> Can't executables be built statically without such requirement?

I never tested that, but it might work.

I know that TeX Live (http://tug.org/svn/texlive/trunk/Build/source/)
uses some hack to build against libstdc++ statically, so that the
binaries can be "universally" distributed.

And google finds a number of recipes. I have zero experience with
doing that on 10.5/PPC with the latest clang though.

> I'd prefer to move to clang in all my Macs because I like it more than gcc,
> but I'm beginning to feel it's wiser to keep using gcc in <10.8 Macs.

When you say "clang" you need to specify which version and whether or
not C++11 support is needed. 10.7 comes with libc++ and fully
functional clang/clang++ 3.2svn (with certain bugs every now and then
and cases when one needs to switch to a newer compiler). Even 10.6
comes with clang (but without clang++ and without libc++). And only
10.9 implemented support for C++11 by default.

You should be able to use version 3.4 on all systems, but using newer
versions might require a bit of extra effort.

Mojca


More information about the macports-users mailing list