9

I'm a little bit confused with these libraries. I'm working on Ubuntu now, I use g++ 5 and I see that my applications link in libc.so. Is it a Ubuntu's implementation of C standard library? Is it different from glibc?

$ ldd application.exe
...
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6
...
Alexey
  • 710
  • 3
  • 7
  • 19

2 Answers2

12

Current Ubuntu uses glibc for the C standard library implementation. The source package is called glibc, but the installed binary package is called libc6 for historic reasons. You can see the exact version of the libc6 package on your system if you run this command:

dpkg -l libc6

There used to be a temporary fork of glibc called eglibc, but eglibc development has been abandoned; all active eglibc-specific ports were merged into glibc before that.

Ubuntu also has packages for alternative libc implementations such as musl, but the distribution itself does not use them because it is glibc-based.

Yaniv Oliver
  • 3,372
  • 1
  • 19
  • 20
Florian Weimer
  • 32,022
  • 3
  • 48
  • 92
8

Libc is the name of the standard library for the C programming language. Glibc is one of many different implementations of libc. In particular, Glibc is the libc implementation that is developed and maintained as part of the GNU project.

Glibc is one of many different implementations of libc. Some other well-known implementations are the Microsoft Visual C Runtime (which includes a libc), musl, dietlibc, µClibc, the various BSD libcs, and Google Bionic (the libc that is shipped with Android).

Jörg W Mittag
  • 363,080
  • 75
  • 446
  • 653
  • 1
    Thank you very much! How can I determine which implementation is used in Ubuntu? – Alexey Jan 05 '19 at 15:07
  • Unless you use a very specialized Linux distribution, you are using the Glibc. – Jörg W Mittag Jan 05 '19 at 15:14
  • I can assure you that [glibc is still very much part of the GNU project](http://www.gnu.org/software/libc/). Why do you think so otherwise? – Florian Weimer Jan 05 '19 at 15:27
  • I'm new to linux, ubunutu etc and I just want to know exactly what implementation if libc, libm I have - to search for a correct documentation for example. – Alexey Jan 05 '19 at 15:46
  • @FlorianWeimer: I remember a statement to that effect by Ulrich Drepper about 15-20 years ago. I recognize your name, so I'll naturally bow to your expertise. – Jörg W Mittag Jan 05 '19 at 17:03