Red Hat Bugzilla – Bug 985495
p11-kit: hard dependency on libpthread
Last modified: 2017-11-09 07:13:04 EST
It should be possible to avoid a dependency on libpthread by using explicit mutex initialization with PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP, an ELF constructor instead of pthread_once, and __thread for thread local storage. pthread_atfork would have to be referenced as a weak symbol. For other functions, glibc contains stubs.
At present, this is not very interesting because all of our crypto libraries link against libpthread, but that might change.
(Quite a few libraries use faster algorithms or implementations when running inside a process that hasn't mapped libpthread, so this change would result in some indirect performance gains.)