Mesa (master): configure.ac: add -pthread to PTHREAD_LIBS

Emil Velikov evelikov at kemper.freedesktop.org
Thu Jun 15 22:26:52 UTC 2017


Module: Mesa
Branch: master
Commit: e5aa806e5f01b842d1af4775f8e4c53282908304
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e5aa806e5f01b842d1af4775f8e4c53282908304

Author: Emil Velikov <emil.l.velikov at gmail.com>
Date:   Mon Jun  5 00:03:59 2017 +0100

configure.ac: add -pthread to PTHREAD_LIBS

As described inline - follow what's written in the manual and what works
for all platforms that Mesa supports.

We want to untangle things leaving only -pthread, yet that has a
potential of causing regressions. Thus we'll do it as a follow-up patch.

As a nice side-effect this resolves issues, where the system lacks
libpthread.so, yet the linker does not warn about it and we and up with
unresolved symbols.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101071
Cc: mesa-stable at lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom at imgtec.com>

---

 configure.ac | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/configure.ac b/configure.ac
index 2eed43615a..9b1c43a5b6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -837,6 +837,11 @@ dnl is not valid for that platform.
 if test "x$android" = xno; then
     test -z "$PTHREAD_LIBS" && PTHREAD_LIBS="-lpthread"
 fi
+dnl According to the manual when using pthreads, one should add -pthread to
+dnl both compile and link-time arguments.
+dnl In practise that should be sufficient for all platforms, since any
+dnl platforms build with GCC and Clang support the flag.
+PTHREAD_LIBS="$PTHREAD_LIBS -pthread"
 
 dnl pthread-stubs is mandatory on BSD platforms, due to the nature of the
 dnl project. Even then there's a notable issue as described in the project README




More information about the mesa-commit mailing list