I had problem building modular X on athlon64. Problem seems to be caused by impropper symlinks at /usr/include/GL pointing for example to /usr/lib32/opengl/include files instead of /usr/lib64 (or just lib) /opengl/include files. Of course this is caused by some previous ebuild emerged.
Remember to search for bugs before filing a new one
*** This bug has been marked as a duplicate of 115029 ***