How can I resolve this issue: libm.so.6: version `GLIBC_2.29' not found, C/C++?

59.3k views Asked by At

When I've tried to execute my C++ demo app on RPI CM4, app that was cross compiled on Ubuntu OS:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:    20.04
Codename:   focal

This is my errors from RPI:

root@rpi-cm4:/home/pi# ./demoApp
./demoApp: /lib/arm-linux-gnueabihf/libm.so.6: version `GLIBC_2.29' not found (required by ./demoApp)
./demoApp: /lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by ./demoApp)

Some info's about my RPI:

# lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 10 (buster)
Release:        10
Codename:       buster

# uname -a
Linux rpi-cm4 5.15.65-v7l+ #1582 SMP Mon Sep 5 15:34:37 BST 2022 armv7l GNU/Linux

# ldd --version
ldd (Debian GLIBC 2.28-10+rpi1) 2.28


# ldd --verbose /lib/arm-linux-gnueabihf/libm.so.6
        linux-vdso.so.1 (0xbefe7000)
        /usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so => /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so (0xb6e4d000)
        libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6cec000)
        /lib/ld-linux-armhf.so.3 (0xb6ee4000)

        Version information:
        /lib/arm-linux-gnueabihf/libm.so.6:
                ld-linux-armhf.so.3 (GLIBC_2.4) => /lib/ld-linux-armhf.so.3
                libc.so.6 (GLIBC_PRIVATE) => /lib/arm-linux-gnueabihf/libc.so.6
                libc.so.6 (GLIBC_2.4) => /lib/arm-linux-gnueabihf/libc.so.6
        /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so:
                libc.so.6 (GLIBC_2.4) => /lib/arm-linux-gnueabihf/libc.so.6
        /lib/arm-linux-gnueabihf/libc.so.6:
                ld-linux-armhf.so.3 (GLIBC_2.4) => /lib/ld-linux-armhf.so.3
                ld-linux-armhf.so.3 (GLIBC_PRIVATE) => /lib/ld-linux-armhf.so.3

How can I make a GLIBC update?

5

There are 5 answers

3
talsim On

You can try to download the glibc from their official website and install it:

wget -4c https://ftp.gnu.org/gnu/glibc/glibc-2.29.tar.gz
tar -zxvf glibc-2.29.tar.gz
cd glibc-2.29
./configure --prefix=/opt/glibc
make
make install
0
rahvey solvadt On

I have some error at debian, and solve it via install deb package glibc https://packages.debian.org/buster/amd64/libc6/download

sudo dpkg -i your_package_name
2
Zane Durante On

Modifying talsim's answer from below to what worked for me.

wget -4c https://ftp.gnu.org/gnu/glibc/glibc-2.29.tar.gz
tar -zxvf glibc-2.29.tar.gz
cd glibc-2.29
mkdir build_dir
cd build_dir
sudo ../configure --prefix=/opt/glibc
sudo make
sudo make install
0
Robert G. Schaffrath On

I ran into this problem trying to run Node.js 20 on a Raspberry Pi that is running Buster. As this and other threads have noted, updating the system libraries is very unwise as the OS depends on specific versions. As I also have Raspberry's running Bullseye, and Node.js 20 runs on Bullseye, it was easy enough to get various updated libraries to experiment with. I created a subdirectory in my home directory called ~/lib and then issued the command export LD_LIBRARY_PATH=~/lib. By copying various newer libraries from my Bullseye system to my ~/lib directory on the Buster system, I was able to determine that only libm.so.6 and libstdc++.so.6 were the out of date libraries preventing Node.js 20 from running.

So if I want to run Node.js 20, I use a bash script that exports the LD_LIBRARY_PATH variable and then invokes node. For me, it is a good workaround until I migrate this system to Bookworm.

I should note that the older the system is, the harder it will be to catch all the dependencies. Just as test, I booted an SD card with an old Wheezy system on it. I was unable to find any collection of libraries that would allow a relatively recent Node.js release to run. I suspect that if I was trying to get Node.js 20 to run under Stretch, it would probably be even more involved than just two libraries and even that might not work due to the age of the system.

0
John On

I tried from @Zane Durante on Ubuntu 18.04, the os suspend and may be install the new one.