https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102992
--- Comment #14 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- (In reply to Iain Sandoe from comment #6) > I had a brief look at some new fails on macOS12 / Darwin21 for gcov. > > It seems that .mod_term_funcs entries are not being run - so if libgfortran > relies on something defined as __attribute__((destructor)) [e.g. to flush > file output] that might explain the issue. Well, there is (at the end of main.c) /* Cleanup the runtime library. */ static void __attribute__((destructor)) cleanup (void) { close_units (); } I guess that could be put into main, after the call to __MAIN, instead.