https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91287
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hjl.tools at gmail dot com --- Comment #18 from Richard Biener <rguenth at gcc dot gnu.org> --- So the linker issue would be that during computing of the resolution when the linker decides a whole archive isn't necessary it doesn't re-consider it for the final actual link (which is where GCC exposes the atan2 UNDEF). Instead it happily resolves it to libm which libgfortran drags in? For C and without -lm it doesn't find it and thus _does_ re-consider the previously unused -lmass. I would have expected the link to fail with an unresolved symbol - so the behavior is at least inconsistent.