LibCxxOnOlderSystems - and more software that is pushing for gcc

Chris Jones jonesc at hep.phy.cam.ac.uk
Sun Sep 25 07:21:42 PDT 2016



> On 25 Sep 2016, at 2:49 pm, Yongwei Wu <wuyongwei at gmail.com> wrote:
> 
> 
> 
>> On 25 September 2016 at 21:35, Chris Jones <jonesc at hep.phy.cam.ac.uk> wrote:
>> 
>> 
>>> On 25 Sep 2016, at 2:25 pm, Brandon Allbery <allbery.b at gmail.com> wrote:
>>> 
>>> 
>>>> On Sun, Sep 25, 2016 at 8:29 AM, Ken Cunningham <ken.cunningham.webuse at gmail.com> wrote:
>>>> 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. 
>>> 
>>> An additional complication is that it's not using the same libstdc++: it's using the GPL3 one with C++11 support, not Apple's GPL2/pre-C++11 one. So potentially the clash here is between the two libstdc++ versions, not libstdc++ and libc++.
>> 
>> Indeed, mixing two different libstdc++ runtimes has the same sort of issues as mixing libstd++ with libc++.
> 
> I actually do not think this is normally an issue. If the dynamic libraries​ manage the lifetime of their own object, i.e. do not do something like creating an object in a library but not providing a function to destroy it (so that the application needs to delete it), bad things should not occur. At least that is the only case I am aware of. (I encountered this kind of problems on Windows, which was even worse, as each new release of MSVC brought in a different C/C++ runtime, which can also be either static or dynamic.)

Its exactly the same situation as with libc++ v libstdc++. There are ways it can be ok and ways you can run into problems. The only guaranteed way (I know of) to not have issues is not to do it.

> 
> -- 
> Yongwei Wu
> URL: http://wyw.dcweb.cn/
> _______________________________________________
> macports-users mailing list
> macports-users at lists.macosforge.org
> https://lists.macosforge.org/mailman/listinfo/macports-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-users/attachments/20160925/6b64b131/attachment.html>


More information about the macports-users mailing list