2

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.

Łukasz Przeniosło
  • 2,725
  • 5
  • 38
  • 74
  • What if try "--nodefaultlibs" (http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html), install in another directory glibc 2.13 and use "gcc -L" to tell where to look for libc 2.13? –  Jun 30 '15 at 16:17
  • How can I install a specific GLIBC version for my crosscompiller? I have downloaded is as a whole package. – Łukasz Przeniosło Jun 30 '15 at 16:21
  • I have not done this for crosscompilers so I can't be sure 100%. However as for glibc you can **easily** have two versions of `glibc` on one computer: http://stackoverflow.com/questions/847179/multiple-glibc-libraries-on-a-single-host. So I assume you need build glibc 2.13 with your crosscompiler and put in somethere not in the default directory. –  Jun 30 '15 at 18:41

1 Answers1

2

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!