gcc-config leaves traces of gcc installation inside /etc/clang even when gcc and gcc-config are removed from the system. The main culprit is /etc/clang/gentoo-gcc-install.cfg, which is included from /etc/clang/gentoo-common.cfg. Reproducible: Always Steps to Reproduce: 1. Have a llvm profile enabled 2. run: emerge --oneshot gcc 3. run: emerge --depclean 4. Try emerge any package which needs c and/or c++ code compiling Actual Results: Portage can't use any compiler. Tries to run clang, but clang complains about missing gcc installation Expected Results: A Working Portage which can compile c and c++ -based software. We had some conversation already at forums. Please see the URL. I don't see this as a very critical bug as one can either clean /etc/clang from gcc-config leftovers or just refraing from using (emerging) gcc in llvm based system. A quickest fix would be to add package.mask for gcc and gcc-config in llvm profiles. I accidentaly stumbled upon this because refind doesn't compile using clang at the moment. So masking gcc and gcc-config could potentially also block some other packages on llvm profiles.
1. gcc becomes depcleanable 2. gcc (and then gcc-config) are unmerged 3. /etc/clang/gentoo-gcc-install.cfg's --gcc-install-dir points to a now-non-existent path We should either clean it up in toolchain.eclass in pre/postrm or in pre/postrm in gcc-config. (prerm sounds better because we narrow the race then.) gcc-config might be able to do it by itself as well.
Also this gets printed when doing 'emerge --info' !!! No gcc found. You probably need to 'source /etc/profile' !!! to update the environment of this terminal and possibly !!! other terminals also. I'm not sure if this happens because gcc-config did leave something else hanging under /etc or if portage/emerge always expects gcc to be founf from the system even when using llvm based profile.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8f9703447530c55709c3462035ecdb7562347185 commit 8f9703447530c55709c3462035ecdb7562347185 Author: Sam James <sam@gentoo.org> AuthorDate: 2025-01-02 18:28:11 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2025-01-02 18:28:11 +0000 toolchain.eclass: cleanup /etc/clang/gentoo-gcc-install.cfg on removing last GCC Otherwise, /etc/clang/gentoo-gcc-install.cfg is left with a broken non-existent --gcc-install-dir value on LLVM-only profiles when the last installed GCC gets removed. Closes: https://bugs.gentoo.org/906040 Signed-off-by: Sam James <sam@gentoo.org> eclass/toolchain.eclass | 6 ++++++ 1 file changed, 6 insertions(+)