Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can you determine installed versions of the glibc libraries?

I'm working with an embedded Linux deployment and am using a cross compiler tool chain that doesn't compile I2C library function calls.

How do I determine the precise versions of the libraries on the system so that I may rebuild the tool chain?

I don't intend to replace the libraries deployed, as I do know they work (including I2C), so I believe I need the following:

  • Binutils version
  • GCC version
  • GLIBC
  • Kernel (for the headers)

I think I can assume from the following that the binutils library is version 2.2.5. The kernel is modded for which I've the source.

root@dev-box />ls /lib/ -al
drwxrwxrwx  3 root root     1024 Apr 27 09:44 .
drwxrwxrwx 14 root root     1024 Jan  1  1970 ..
-rwxrwxrwx  1 root root   105379 Jan  1  1970 ld-2.2.5.so
lrwxrwxrwx  1 root root       16 Jan  1  1970 ld-linux.so.2 -> /lib/ld-2.2.5.so
lrwxrwxrwx  1 root root       16 Jan  1  1970 ld.so.1 -> /lib/ld-2.2.5.so
-rwxrwxrwx  1 root root  1288601 Jan  1  1970 libc.so.6
-rwxrwxrwx  1 root root    25441 Jan  1  1970 libcrypt.so.1
-rwxrwxrwx  1 root root    14303 Jan  1  1970 libdl.so.2
-rwxrwxrwx  1 root root    36800 Jan  1  1970 libgcc_s.so.1
-rwxrwxrwx  1 root root   530401 Jan  1  1970 libm.so.6
-rwxrwxrwx  1 root root    86626 Jan  1  1970 libnsl.so.1
-rwxrwxrwx  1 root root    17533 Jan  1  1970 libnss_dns.so.2
-rwxrwxrwx  1 root root    46324 Jan  1  1970 libnss_files.so.2
-rwxrwxrwx  1 root root    98633 Jan  1  1970 libpthread.so.0
-rwxrwxrwx  1 root root    69966 Jan  1  1970 libresolv.so.2
-rwxrwxrwx  1 root root    12897 Jan  1  1970 libutil.so.1
like image 881
Jamie Avatar asked Apr 27 '10 15:04

Jamie


People also ask

How do you know the version of a library in Linux?

Or from the command line, you can first search for the name of the associated package using dpkg -S /usr/lib/libnuma. so. 1 , which probably returns libnuma1 as the package name. Then run apt-cache showpkg libnuma1 to find the package version.

How do I check my libc So 6 version?

so. 6 you can call the so file with the –version to get its version information e.g.: lsof -p $$ | grep libc | awk ' { print $NF" --version"; } ' | sh GNU C Library stable release version 2.11.

Can you have multiple versions of glibc?

So, in a way, we can have multiple versions of glibc on our machine and have a libglib-2.0.so link to a specific version. The linker will look for the soname field in the shared object and embed it in the resulting binary. The soname field specifies the filename for our target shared library.


1 Answers

To know the current installed version of glibc, please compile and run the following C code.

#include <stdio.h>
#include <gnu/libc-version.h>
int main (void) { puts (gnu_get_libc_version ()); return 0; }

Cheers !!!

like image 112
Monir Avatar answered Nov 05 '22 19:11

Monir