https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106779
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Where does the: -I/tools/arch/Linux_3.10.0-x86_64/gcc-12.1.0-bootstrap//include come there? If it e.g. contains glibc fixincluded ansidecl.h, then that could explain why it breaks. But you don't want to use your build compiler's include directories in preference over the build tree ones.