C compiler cannot create executables

Have been having this strange error appear for a while when attempting to compile sys-libs/db (and compiling other software with C has no problems). The package is fine as my other box compiles the package fine.

I’m using CCACHE and Gentoo 2006.0 AMD64.

For anybody else with this problem, the solution seems to be deleting (or moving) /usr/lib/ccache/bin/x86_64-pc-linux-gnu-cc (on AMD64 systems) or /usr/lib/ccache/bin/i686-pc-linux-gnu-cc on x86 systems.