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

Alexander Gaenko galexv at umich.edu
Mon Oct 3 19:35:59 PDT 2016


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"?

Thank you,
With best regards,

More information about the macports-dev mailing list