https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91394
Bug ID: 91394 Summary: C++ ABI incompatibility (stdexcept) Product: gcc Version: 7.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tomas_paukrt at conel dot cz Target Milestone: --- Some C++ programs cross-compiled with GCC 7.4.0 using -std=gnu++11 do not work on a system which have glibc 2.25 cross-compiled with GCC 4.9.4 even if the symbol _GLIBCXX_USE_CXX11_ABI was set to zero during cross-compilation. There are several places in the file "stdexcept" like this: > class out_of_range : public logic_error > { > public: > explicit out_of_range(const string& __arg) _GLIBCXX_TXN_SAFE; > #if __cplusplus >= 201103L > explicit out_of_range(const char*) _GLIBCXX_TXN_SAFE; > #endif > virtual ~out_of_range() _GLIBCXX_USE_NOEXCEPT; > }; A program that calls constructor out_of_range(const char*) will be using symbol _ZNSt12out_of_rangeC1EPKc@GLIBCXX_3.4.21 which is not present on the old system, so I suggest to change the conditional compilation on such places to this: > #if _GLIBCXX_USE_CXX11_ABI && __cplusplus >= 201103L > explicit out_of_range(const char*) _GLIBCXX_TXN_SAFE; > #endif