threadlib: Fix LIBMULTITHREAD on platforms where --as-needed is enabled.
commit426320901d46b1f3b63ba1ec8e9e60cb0e28cb77
authorBruno Haible <bruno@clisp.org>
Tue, 26 Jun 2018 00:18:40 +0000 (26 02:18 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 26 Jun 2018 00:18:40 +0000 (26 02:18 +0200)
treed7607d47bfa88682fac3852f64c828f3a82f17e0
parentd7cf3b8d27f6b7ccbcdcdd9d18d7e12208795e3d
threadlib: Fix LIBMULTITHREAD on platforms where --as-needed is enabled.

Reported by Erik Auerswald <auerswal@unix-ag.uni-kl.de>
in <https://lists.gnu.org/archive/html/coreutils/2018-06/msg00063.html>.

* m4/threadlib.m4 (gl_THREADLIB_BODY): Check whether the linker supports
--as-needed/--no-as-needed and --push-state/--pop-state. When defining
USE_POSIX_THREADS_WEAK or USE_SOLARIS_THREADS_WEAK or
USE_PTH_THREADS_WEAK, define LIBMULTITHREAD in such a way that -lpthread
/ -lthread / -lpth does not get optimized away by a preceding
--as-needed option.
ChangeLog
m4/threadlib.m4