LibCxxOnOlderSystems - and more software that is pushing for gcc

Lawrence Velázquez larryv at macports.org
Sat Sep 24 21:39:35 PDT 2016


> On Sep 24, 2016, at 10:12 PM, Ken Cunningham
> <ken.cunningham.webuse at gmail.com> wrote:
> 
> I realize I asked this a bit ago about qemu, and received a very
> reasonable big caution regarding any attempt to combine gcc of any
> version on a system set up with LibCxxOnOlderSystems...
> 
> but I just thought I'd mention that a few more fairly common ports
> appear to be failing to install without access to gcc, so this might
> turn out to be a problem.

The problem is not really about libc++; it's about mixing multiple C++
runtimes. The problem also existed pre-libc++ (albeit much more subtly)
because our GCC C++ compilers didn't use the same libstdc++/libsupc++
that Apple's compilers did.

Corollary: This all only concerns the GCC C++ compiler / standard
library / runtime. As far as I know, you can use the C or Fortran
compilers as much as you'd like. Several ports do this for various
reasons. Perhaps they need to compile Fortran code, in which case GCC is
their only option. Or maybe their C code is optimized significantly
better by GCC or requires GCC extensions/libraries. (Example: Until
relatively recently, anything using OpenMP had to be compiled with GCC.)

> in gimp's case, it pulls in py27-numpy that seems to want to pull in
> gcc6 no matter what variants I try.

> octave has what seems to be a hard build dep for gcc6 directly, even
> if I select the +clang37 variant...

These dependencies are coming from the +gfortran variants, which
instruct the builds to use the Fortran compiler from gcc6. This is fine
and expected.

> and letting gcc6 start building, it certainly links against libstdc++
> (in the freshly built libgcc), which will blow everything up.

What links against libstdc++, specifically?

> So this could turn out to be a hard choice for systems set up like
> this, I guess, unless Jeremy has a fancy trick up his sleeve.

Jeremy unfortunately cannot do much of anything about GCC. I believe
Apple employees are not allowed to look at GPL3 code.

> At the moment, it appears you can either get c++11 ports, OR any ports
> which require gcc, but not both. But then I see "-std=gnu++11" in this
> long line, which puzzles me a bit...

I wouldn't be surprised if GCC used C++11 features. It doesn't really
matter because it is self-hosted.

vq


More information about the macports-users mailing list