LibCxxOnOlderSystems - and more software that is pushing for gcc

Ken Cunningham ken.cunningham.webuse at gmail.com
Sun Sep 25 05:29:49 PDT 2016


> 
> The problem is not really about libc++; it's about mixing multiple C++
> runtimes.

Indeed.

What is happening exactly on my MacPros running 10.11, I wonder? Software installed by macports on 10.11 is using clang++ (mostly) and g++ (sometimes). clang++ is linking against libc++, and g++ is presumably  linking against libstdc++ as that is what it does -- yet there appear to be no visible issues...and these libraries find each other. 

Why exactly is the situation different on a LibCxxOnOlderSystems installation?


> 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. 

But not easily to link c++ code against libc++. I sent the link on how to do that previously, and may be forced to explore that. It just looks like a lot of messing with the compiler commands on every port using g++, which seems unpleasant -- unless I were to wrap g++ in a shell script that does it automatically, perhaps...
<http://libcxx.llvm.org/docs/UsingLibcxx.html#using-libc-with-gcc>


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

but won't work on LibCxxOnOlderSystems, if it links the binaries against lilbstdc++

> What links against libstdc++, specifically?

gcc6 itself, at least. And by default at least, any c++ code gcc would compile 

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

I wasn't thinking he'd need to read the gcc compiler code.

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

It's an alternative way to get c++11 code compiled; I was just noticing that clang++/libc++ aren't the only option for c++11.


It would appear there are a few choices.

1. give up and accept it's an either / or situation
2. just let it go on, and see how it works with cross linking -- is this what 10.11 macports does?
3. figure out how to make this work: <http://libcxx.llvm.org/docs/UsingLibcxx.html#using-libc-with-gcc>, possibly by wrapping g++ in a shell script that does it for every use.
4. a parallel installation of macports with libstdc++ and gcc, to install gimp, octave, qemu, and whatever other similar gcc-requiring ports come along.



K
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-users/attachments/20160925/df5ac12f/attachment.html>


More information about the macports-users mailing list