Skip to content

SWIG: detect dual libstdc++ ABI for Octave library compatibility

Karl Wette requested to merge ANU-CGA/lalsuite:swig-libstdcxx-abi into master

Description

GCC's modern C++ library libstdc++ has a dual ABI for C++11 compatibility. The ABI must be consistent between the Octave libraries and the SWIG Octave wrappings. A mismatch can occur when e.g. compiling LALSuite with a newer GCC (which assumes the new C++11 ABI by default) but using an Octave package compiled with an older GCC (which used the older ABI).

This MR adds a test to determine which ABI the Octave libraries use. It compiles a test module with either -D_GLIBCXX_USE_CXX11_ABI=0 or -D_GLIBCXX_USE_CXX11_ABI=1 and checks which module is loadable, in order to determine which ABI to use. (The test will fail if both test modules fail to compile/load due to an unrelated error.)

API Changes and Justification

Backwards Compatible Changes

  • This change does not modify any class/function/struct/type definitions in a public C header file or any Python class/function definitions
  • This change adds new classes/functions/structs/types to a public C header file or Python module

Backwards Incompatible Changes

  • This change modifies an existing class/function/struct/type definition in a public C header file or Python module
  • This change removes an existing class/function/struct/type from a public C header file or Python module

Review Status

cc @adam-mercer

Merge request reports