Gentoo / Funtoo - How to repair gcc

From Linux - Help
Jump to navigation Jump to search

Gentoo-power.png Technology should be fun, powerful and free.

If you cannot update anymore and you have that type of error:

x86_64-pc-linux-gnu-gcc -V >&5 x86_64-pc-linux-gnu-gcc: error: unrecognized command line option '-V'

You can try to rebuild your GCC env by doing this:

# Fixing GCC
emerge -avk1 gcc
gcc-config -l
(output of compiler profiles use the reinstalled version in the next command)
gcc-config --force x86_64-pc-linux-gnu-5.4.0
. /etc/profile
# Fixing binutils
emerge -avk1 binutils
binutils-config -l
(output of binutils profiles again use the one reinstalled from binary)
binutils-config x86_64-pc-linux-gnu-2.29.1
# Fixing glibc
emerge -avk1 glibc

Then run this before trying to rebuild world:

emerge -ave @system

NOTE: If you also upgraded from a different major version of gcc, then you need to run (before @world and @preserved-rebuild):

revdep-rebuild --library '' -- --exclude gcc

Now you can rebuild world with the following:

emerge -avuDN --with-bdeps=y @world

And then if needed:

emerge -av @preserved-rebuild