https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109074
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- The reason for the abort is because you didn't catch the exception as libstc++ is throwing one because threads are not enabled at runtime via the linking of libpthread.