Dual g++ ABI in libraries --- how to handle it?

Chris Jones jonesc at hep.phy.cam.ac.uk
Mon Oct 3 21:50:58 PDT 2016



> On 4 Oct 2016, at 3:35 am, Alexander Gaenko <galexv at umich.edu> wrote:
> 
> Hi,
> 
> The build of our C++ library
> (https://www.macports.org/ports.php?by=name&substr=alpscore) fails
> with g++-mp-6 --- apparently due to the fact that Boost libraries used
> by our code were compiled with the "old" pre-C++11 ABI, and g++ >=5.1
> by default compiles using the "new" ABI.
> 
> I know that it is possible to compile our library with the "old" ABI
> by defining "_GLIBCXX_USE_CXX11_ABI=0".  But this would force any code
> that links with our library to use the "old" ABI, too.
> 
> This situation could be remedied by using Boost variant compiled with
> the "new" ABI --- however, there seems to be no such variant in the
> Boost port.
> 
> The question: what is the current/recommended way to handle this
> "old"/"new" ABI transition?
> Do all C++ libraries ports that use Boost set ABI to "old"?

Do not use FCC to build your library, as this will end up with mixed c++ runtimes. Use the same compiler as mac ports uses, which for recent OS X versions will be the system clang++ compiler.

> 
> Thank you,
> With best regards,
>   Alexander.
> _______________________________________________
> macports-dev mailing list
> macports-dev at lists.macosforge.org
> https://lists.macosforge.org/mailman/listinfo/macports-dev



More information about the macports-dev mailing list