Invalid gcc profile
Tried to install a package today and received the following horrifying output from running emerge flac
configure: error: installation or configuration problem: C compiler cannot create executables.
Found out in this (excellent) Gentoo forum thread that it was only due to the fact that $CHOSTS flag (from /etc/make.conf) was not being exported at build-time due to gcc using an invalid profile.
So I ran gcc-config -l and sure enough it outputted the following:
# gcc-config -l
* /usr/bin/gcc-config: Profile does not exist or invalid setting for /etc/env.d/gcc/i686-pc-linux-gnu-4.1.1
[1] i686-pc-linux-gnu-4.1.1 * [invalid]
To fix this problem all I had to do was to run gcc-config again only this time I had to specify the profile to use which coincidently was the only one to use anyway.
# gcc-config 1
* Switching native-compiler to i686-pc-linux-gnu-4.1.1 ... [ ok ]
Now everything compiles properly. I believe this was caused after using revdep-rebuild which was recommended by emerge when I tried to use the prune option on the "world" ebuild meta-package with emerge -P world.