Gentoo's Bugzilla –
Attachment 858663 Details for
Bug 902777dev-debug/gdb-13.1-r1: undefined reference to `__atomic_fetch_add_4' on MIPS (/usr/lib/gcc/mips-unknown-linux-gnu/12/include/g++-v12/ext/atomicity.h:66: more undefined references to `__atomic_fetch_add_4' follow)