https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111934
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Last reconfirmed| |2023-11-12 Status|UNCONFIRMED |NEW Keywords|needs-reduction | --- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Confirmed. Note the difference between my build and the others is due to: # if __GLIBC_PREREQ(2, 34) // Since glibc 2.34 all pthreads functions are usable without linking to // libpthread. # define _GLIBCXX_GTHREAD_USE_WEAK 0 # endif That is I have a newer glibc which causes __weakref__ not to be needed/used here. So next time please attach the preprocessed source when running into a bug in the front-end, because different versions of glibc might produce different preprocessed sources and not able to reproduce the issue.