简体   繁体   中英

Link with specific GLIBC version

I am using a remote host pc with crosscompiller in order to build and deploy cpp code to BeagleBone Black. My problem is that since i tried to run my code with <time.h> functions i got a message:

/lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.17' not found (required by /home/debian/app)

So i have check what version I got on BBB using ldd --version and got:

ldd (Debian EGLIBC 2.13-38+deb7u8) 2.13
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

Is there a way to tell my crosscompiller to use GLIBC version 2.13 when linking instead of 2.17? Little research provided me with information that updating GLIBC on BBB is no simple solution so I was wondering about this way of doing it. I would apreciate all help.

After a lot of experimentation I came across this solution. It's possible to update the libc version to 2.17 on the Beaglebone Black. First download either libc6_2.17-0ubuntu5_armhf.deb (for compiling with hard floats) or libc6-armel_2.17-0ubuntu5.1_armhf.deb (for compiling with soft floats) from https://launchpad.net/ubuntu/raring/armhf/libc6/2.17-0ubuntu5 or https://launchpad.net/ubuntu/raring/armhf/libc6-armel/2.17-0ubuntu5.1 respectively.

Next, use scp to copy the file to the BBB.

scp libc6_2.17-0ubuntu5_armhf.deb root@beaglebone.local:/root

scp libc6-armel_2.17-0ubuntu5.1_armhf.deb root@beaglebone.local:/root

Finally, install the package.

sudo dpkg --install libc6_2.17-0ubuntu5_armhf.deb

sudo dpkg --install libc6-armel_2.17-0ubuntu5.1_armhf.deb

It worked for functions requiring the new version on my device, despite ldd --version still displaying as 2.13. You might also consider using sudo apt-get -f install to get rid of the old version.

Hope it helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM