GCC and toolchain issues

From Elvanör's Technical Wiki
Jump to navigation Jump to search

The gcc compiler suite is a crucial element of a working Gentoo system (probably the most important). This article lists some issues I have encountered with respect to gcc.

gcc Portage updates

  • When upgrading gcc, a simple revdep-rebuild may not be enough because of libtool files (even for minor updates like moving from gcc-4.3.2 to gcc-4.3.4). You should run:
fix_libtool_files.sh 4.3.2 # 4.3.2 is the OLD gcc version
  • Another tool is dev-util/lafilefixer:
lafilefixer --justfixit

gcc on AMD64

x86_64-pc-linux-gnu-gcc vs. i686-pc-linux-gnu-gcc

If you encounter problems while trying to emerge stable programs, and the emerge fails in the configure stage with errors such as "C compiler cannot create executables", probably something is wrong with your gcc setup.

First make sure that the correct gcc profile is selected with gcc-config. gcc-config -l lists all the available profiles. gcc-config 3 selects for example the third profile.

If everything seems ok with your gcc-profile, the problem may lie with unnecessary gcc binaries lying around. After searching a little, I discovered that in /usr/bin there were basically two versions of the gcc programs (gcc, c++, g++, g77 etc...). One had the prefix i686-pc-linux-gnu-gcc while the other ahd the correct one for my architecture, x86_64-pc-linux-gnu-gcc. It seems that the i686 ones were not necessary and apparently dangerous on my system.

I removed them completely and everything seemed to work fine.


Useful Links