https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124268
--- Comment #10 from Iain Sandoe <iains at gcc dot gnu.org> --- I suspect part of this is that GCC has a mechanism for eliding calls to module initialisers when it can prove they are not needed. AFAIK clang has not implemented that (yet). For linux the iostreams global is handled differently from macOS (and, presumably Windows) so that [my inference] is that GCC decides that the module init is not needed on Linux - hence no reference - but does not make that decision on macOS (although, in practice, the init is a NOP). As Jonathan says, we can solve this by adding std.o to the library .. I was also intending to investigate whether macOS could actually adopt the same handling for the iostreams stuff as Linux (but not sure when I will be able to fit that in).
