You can compile gcc
without upgrading the GLIBC
. I did it numerous times and usually you just need a recent enough version of the binutils
, gmp
, mpfr
and mpc
. Actually, these have nothing to do with each other. By that, I mean that there is no reason to change or recompile GLIBC
if you change your version of gcc
.
However, if you do install a gcc
version you compiled yourself, never do it system-wide: this can be as bad as bluntly changing the GLIBC
. Instead, you can keep a working version of gcc
in your home and provide runtime information to link to the right libraries (by tweaking LD_LIBRARY_PATH
).
Now, GLIBC
is backward-compatible, not forward-compatible (to a certain extent at least). If no GLIBC
update has been done by yourself, that simply means that the problem is that the gcc
version you installed has been compiled with a newer GLIBC
. On my system, firefox
for instance is linked to:
linux-vdso.so.1 (0x00007fff92d8a000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007ff8a7711000)
libdl.so.2 => /usr/lib/libdl.so.2 (0x00007ff8a750d000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007ff8a718b000)
libm.so.6 => /usr/lib/libm.so.6 (0x00007ff8a6e87000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007ff8a6ae5000)
/lib64/ld-linux-x86-64.so.2 (0x00007ff8a792e000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007ff8a68cf000)
and most of them are provided by gcc
(hence the GLIBC
error in firefox
which is actually raised by gcc
).
The second possibility is that you updated GLIBC
(depending on how you installed gcc
, this can be as easy as there was a more recent version of GLIBC
in the repository you used). In that case, that shouldn't be a problem: programs compiled with prior versions of GLIBC
should work with newer versions (to a limited extent). However, some programs keep reference to a very specific versions of GLIBC
for various reasons. So that could also be it.
To revert that mess...
If you used an external repository and you can still install packages, just remove the repository and downgrade.
If you installed gcc
manually, you can always try to reinstall the repo version of it. But don't have too much hope: you might need to reinstall your distrib.