What it does is rely on which to return the first instance of gcc in $PATH. If this is a symlink, then we're not calling gcc. This has a direct effect on distcc and a plan to integrate distcc and portage with userpriv. (See bug 29171) In a nutshell, bug 29171 creates directories for portage and when Portage calls '`which gcc` - dumpversion' (in 'emerge') as root, it calls gcc _through_ distcc. Distcc, when invoked, creates a lock file owned by the user who starts distcc. So Portage is creating a root-owned lock file that distcc can't delete it - and the lock file remains when Portage drops root privs, and distcc gets errors out the wazoo when it tries to overwrite the root-owned lock file.
Created attachment 18130 [details, diff] Patch for emerge New patch for figuring out gcc version, has several fallbacks for determining version, and will eventual fall back on the old way of determining gcc version but warn the user that it might break distcc.
Oh yeah, this was diffed against this emerge version: # : /home/cvsroot/gentoo-src/portage/bin/emerge,v 1.224 2003/08/21 01:01:26 carpaski Exp $
Created attachment 18132 [details, diff] Fixed patch for emerge Now diffed against # $Header: /home/cvsroot/gentoo-src/portage/bin/emerge,v 1.226 2003/09/11 03:36:21 carpaski Exp $
Included in 49-r6