[Mesa-dev] [PATCH 2/4] configure.ac: remove explicit -lpthread link

Emil Velikov emil.l.velikov at gmail.com
Fri Jun 9 10:42:17 UTC 2017


Hi all,

On 5 June 2017 at 00:04, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
>
> As mentioned in last commit - pthread manual suggests using -pthread.
> Furthermore, to the best of my knowledge anything built with GCC and
> Clang should just work (tm) with the said flag.
>
> AFAICT using the Sun or Intel compiler may need special treatment, but
> that is to be confirmed/dismissed.
>
> Cc: Randy Fishel <randy.fishel at oracle.com>
> Cc: Niveditha Rau <niveditha.rau at oracle.com>
> Cc: Jon Turney <jon.turney at dronecode.org.uk>
> Cc: Tim Rowley <timothy.o.rowley at intel.com>
> Cc: Bruce Cherniak <bruce.cherniak at intel.com>
> Cc: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
> ---
> Ladies and gents,
>
> Please confirm if "-pthread" works on your platform/compiler combos.
> If fixup changes are needed, please send over a patch to squash.
>
> Thanks
> Emil
> ---
>  configure.ac     |  15 +--
>  m4/ax_pthread.m4 | 309 -------------------------------------------------------
>  2 files changed, 2 insertions(+), 322 deletions(-)
>  delete mode 100644 m4/ax_pthread.m4
>
> diff --git a/configure.ac b/configure.ac
> index 1c15eb482f9..2e4264cf592 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -825,23 +825,12 @@ AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
>  dnl Check for zlib
>  PKG_CHECK_MODULES([ZLIB], [zlib >= $ZLIB_REQUIRED])
>
> -dnl Check for pthreads
> -AX_PTHREAD
> -if test "x$ax_pthread_ok" = xno; then
> -    AC_MSG_ERROR([Building mesa on this platform requires pthreads])
> -fi
> -dnl AX_PTHREADS leaves PTHREAD_LIBS empty for gcc and sets PTHREAD_CFLAGS
> -dnl to -pthread, which causes problems if we need -lpthread to appear in
> -dnl pkgconfig files.  Since Android doesn't have a pthread lib, this check
> -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"
> +PTHREAD_CFLAGS="-pthread"
> +PTHREAD_LIBS="-pthread"
>
Humble ping? Anyone's testing would be appreciated, although I would
love to hear from anyone in the CC-chain.

If the commit message seems sparse/ambiguous or in general you think
more information is needed, please let me know.
I intentionally, tried to keep it concise although it might have gone too brief.

Thanks
Emil


More information about the mesa-dev mailing list