GCC and toolchain issues: Difference between revisions

From Elvanör's Technical Wiki
Jump to navigation Jump to search
No edit summary
(No difference)

Revision as of 11:02, 23 October 2009

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.


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