Upgrading glibc – How does it work without distribution’s patches

The Fedora 21 repository has glibc-2.20-8.fc21

I want to install glibc 2.21 from source. (I realize we’re days away from Fedora 22 release, but this question will apply next time I’m interested in installing a more recent version of glibc.)

Running configure on the 2.21 source says:

On GNU/Linux systems the GNU C Library should not be installed into
/usr/local since this might make your system totally unusable.

It references to see the glibc faq, which then says:

The GNU C compiler treats /usr/local/include and /usr/local/lib in a special
way, these directories will be searched before the system directories. Since
on GNU/Linux the system directories /usr/include and /usr/lib contain a ---
possibly different --- version of glibc and mixing certain files from
different glibc installations is not supported and will break, you risk
breaking your complete system. If you want to test a glibc installation, use
another directory as argument to --prefix. If you like to install this glibc
version as default version, overriding the existing one, use --prefix=/usr
and everything will go in the right places.

I’m debating which way I want to go (a separate directory other than /usr/local, or overriding in /usr).

But, I noticed somewhere that said if you’re going to do this, you want to make sure to use the same configure options your linux distribution used.

So, I downloaded glibc-2.20-8.fc21.src.rpm and extracted it. For the first time, I’ve seen what the linux distributions are doing to the upstream code. There’s 48 .patch files, 3 extra .c files, an extra .h file, and some .conf files.

Is it (and if so, how is it) safe to ever install glibc from source, regardless of if you’re using a second (non /usr/local) location or overwriting in /usr?

All those patches the RedHat/Fedora repository “people” have made are going to be skipped. (I assume these distribution-specific patches are important…) How are so many places saying upgrading glibc is generally safe?

For that matter, if many distribution packages have this amount of distribution customization, how does building anything from source even work? I’ve been running trunk source builds of gcc and gdb for a long time, and occasionally run into bumps because it isn’t release code, but it generally works… I don’t get how those work now, either, without the distribution repository patches.

Source: linux

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.