Created attachment 318706 [details] emerge fail log sys-apps/which fails to build with clang-3.1-r4, both versions (2.19,2.20), with the same error. Attached is the build log.
update: both versions build and pass tests with GCC 4.6.3
This bug can be temporarily worked around by passing --disable-dependency-tracking option to configure. With GCC the configure check evaluates as "pch", whereas with clang evaluates as "none". This makes the compile step fail. The workaround forces configure to skip the check/set it to "none" a priori, possibly updating the environment accordingly and making the build succeed with both gcc and clang. Both versions available build fine with the workaround. I think the correct approach would be to fix the scripts to work properly, meanwhile a conditional for clang in the ebuild would do fine. AFAIK though, dependency tracking is used for incremental (re)compilation of large projects, disabling it entirely for such a small thing as sys-apps/which won't do any harm IMO.
Incoming clang 3.2 will work fine (tested with rc3): checking dependency style of clang... pch and it compiles/works fine :)