https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88264
--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> --- Another tunable idea: disable exceptions from the runtime. We use _GLIBCXX_THROW_OR_ABORT so that throwing an exception will abort instead when -fno-exceptions is defined. However, this only works when the code doing the throw is compiled with that flag. For all the __throw_foo_error functions declared in <bits/functexcept.h> the actual definition is src/c++11/functexcept.cc which isn't affected by any -fno-exceptions that users compile with. You need to recompile libstdc++ itself with -fno-exceptions. We could add a tunable to disable all exceptions within the runtime. (If doing this, don't forget places like throw_revursive_init_exception in libsupc++/guard.cc which doesn't use _GLIBCXX_THROW_OR_ABORT because it wants to trap not std::abort(), presumably for freestanding reasons.)