Notice these two RedHat Linux system configuration settings:
$ getconf GNU_LIBC_VERSION glibc 2.3.4 $ getconf GNU_LIBPTHREAD_VERSION NPTL 2.3.4
I see they correspond to some of the TLS libraries:
/lib/tls/libc-2.3.4.so /lib/tls/libm-2.3.4.so /lib/tls/libpthread-2.3.4.so /lib/tls/librt-2.3.4.so
I’d like to link against these libraries instead of the /usr/lib equivalents. I have a few questions:
- I’ve seen this on RedHat and Debian. Does it exist on all GNU Linux distributions?
- Is there any case where
GNU_LIBC_VERSIONdiffers fromGNU_LIBPTHREAD_VERSION? - Are those variables safe to use for identifying the shared libraries in
/lib/tls? I’d like to automate this in a Makefile, rather than hard-coding a magic glibc/pthread version number.
The NPTL project which first implemented pThreads on Linux was a separate project initially adding kernel support and providing its own library.
When it was stable enough it was merged into glibc. I would assume that those two versions are identical on all reasonably up-to-date installations.
On Ubuntu 8.10 the output is like this: