https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109815
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Seems like the debug information for TLS variables are not being written out correctly and that is causing the link to fail. I think GCC 12 moved to dwarf2 debug information for AIX which is why it shows up in GCC 12+ only.