]> git.ipfire.org Git - thirdparty/libbsd.git/commit
build: Use __register_atfork() only if really available
authorGuillem Jover <guillem@hadrons.org>
Tue, 6 Aug 2019 21:16:42 +0000 (23:16 +0200)
committerGuillem Jover <guillem@hadrons.org>
Thu, 8 Aug 2019 01:21:49 +0000 (03:21 +0200)
commitb0ebb0d4c26b281facbab7a774510b541637b13b
tree796e3780672ec9fa80fc0f519998d50fe9e3c7ce
parent73aea4f8083e8c35ce1123e36a9967ecd6a26c97
build: Use __register_atfork() only if really available

This is a glibc-specific symbol that has no public declaration. But is
being used by the OpenBSD and this implementation as a hack to avoid
having to link against the pthread library. This interface is at least
included in LSB 5.0 [L], and using pthread_atfork() is otherwise
problematic anyway [P].

 [L] <https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/baselib---register-atfork.html>
 [P] <http://austingroupbugs.net/view.php?id=851>

One problem is that we were using it whenever __GLIBC__ is defined,
which is supposed to be defined only on an actual glibc, but uClibc
defines that macro, but it does not provide the symbol on its noMMU
variant.

We add a new configure check that will try to link a program that uses
that symbol to make sure it is present.

Closes: !2
Reported-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
configure.ac
src/Makefile.am
src/arc4random_linux.h
src/arc4random_unix.h