swig-1.3.21 was already correctly built on my Gentoo box but without the +tcltk flag. During a re-emerge with the new flag, the build failed with a "#include nested too deep" error message. In fact, /usr/include/limits.h includes /usr/include/gentoo-multilib/amd64/limits.h and vice-versa hence the infinite recursion. From /usr/include/limits.h, we have : #ifdef __x86_64__ #include "gentoo-multilib/amd64/limits.h" #endif /* __x86_64__ */ and practically nothing else. From /usr/include/gentoo-multilib/amd64/limits.h, we have: #if defined __GNUC__ && !defined _GCC_LIMITS_H_ /* `_GCC_LIMITS_H_' is what GCC's file defines. */ # include_next <limits.h> ... some other lines ... #endif It seems that /usr/include/limits.h is just here for compatibility reasons and that all the important definitions are in /usr/include/gentoo-multilib/amd64/limits.h. Unfortunately, the latter does not seem to be aware of that... and tries to include /usr/include/limits.h which is clearly unnecessary. The solution I've used is to comment the #include_next <limits.h> from /usr/include/gentoo-multilib/amd64/limits.h and everything works well. Reproducible: Always Steps to Reproduce:
Emerge sync, re-emerge glibc and try again. *** This bug has been marked as a duplicate of 87560 ***