From 9e9040de9eb5c93d3a73c855c9cac153ee56346e Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Fri, 2 Jun 2017 18:04:46 +0100 Subject: [PATCH] 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 should catch issues, where the system lacks libpthread.so, yet the linker does not give us an error/warning and we and up with unresolved symbols. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101071 Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Emil Velikov --- configure.ac | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac index 0a07064506d..af9ef1852d0 100644 --- a/configure.ac +++ b/configure.ac @@ -835,6 +835,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, with the only +dnl potential suspects being - Solaris, Darwin, Cygwin and MSYS/MINGW. +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 -- 2.12.2