3

after extracting so much useful information from this community I finally decided to join this one as well.

I have a specific question about the procedure to upgrade glibc. Yes, I know this is 'risky' and probably a bad idea, but it should be possible right? There's another question here: libc 2.29 on buster but it doesn't seem to have a reliable answer. My question isn't specific to 2.29; for example I'm trying to install 2.32.

glibc is compiled by my cross-compile toolchain (crosstool-ng) using the armv6-unknown-linux-gnueabihf template. Due to a bug in the 2.28 compilation of glibc there that I cannot seem to solve (see: github), the other option I'm left with is upgrading the glibc version on the target.

I tried replacing the libc.so in the rootfs by just mounting the SD card to my linux host machine (so no program would be using libc) but then mayhem occurs. The pi seems to boot just fine and responds to pings, but ssh'ing for instance becomes impossible.

I'm hoping for someone with a little more experience on the matter that hopefully points out the obvious thing I'm missing here.

YVbakker
  • 73
  • 1
  • 1
  • 9

1 Answers1

4

The Pi can still boot because the kernel does not use userspace libraries, so it's unaffected. However, almost every userspace Linux program uses glibc, so when you replace that library, you will break programs which happen to use any functions which are not compatible anymore.

In general, it's helpful to look at glibc compatibility chart, even though it applies to amd64 version of the library. There appear to be big changes between versions 2.29 and 2.30, affecting even the most basic functions such as open(), and version 2.32 brings even more differences to the table.

Short of recompiling the whole Pi OS with the new library, you won't be able to use it. You might create a chroot environment with a different glibc, and run your code inside that environment, but I assume that's not what you want (you'll have to populate it with libraries and tools all built against the new glibc!). If you plan to distribute binaries which are supposed to work on stock Pi OS, you'll have to get the right glibc in your toolchain.

Dmitry Grigoryev
  • 28,277
  • 6
  • 54
  • 147