https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67843
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> --- I've just realised this is probably the same issue as PR42734 If you compile for armv5 then shared_ptr uses a mutex internally, because armv5 doesn't support the necessary atomics. The library is compiled for armv7, so its shared_ptr uses atomics. When you pass a shared_ptr from an object compiled with armv5 to a library compiled as armv7 they disagree on the size and layout of the object, and all hell breaks loose.