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_VERSION
differs 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.