[Mesa-dev] [PATCH 1/2] configure.ac: Don't look for pthreads in Android platform

Gurchetan Singh gurchetansingh at google.com
Fri Oct 28 18:33:55 UTC 2016


Removing the entire hunk causes build failures on CrOS mesa.  Refer to this
for more information:

http://stackoverflow.com/questions/17055279/autotools-
for-pthreads-not-setting-correct-linker-flags

We can do one of the following:

(1) Keep as is, with special case for android
(2) Set PTHREAD_LIBS=$PTHREAD_CFLAGS in configure.ac
(3) Do a giant sed to convert PTHREAD_LIBS to PTHREAD_CFLAGS in the entire
tree

Any strong preferences???


On Fri, Oct 28, 2016 at 10:24 AM, Matt Turner <mattst88 at gmail.com> wrote:

> On Fri, Oct 28, 2016 at 8:06 AM, Emil Velikov <emil.l.velikov at gmail.com>
> wrote:
> > On 27 October 2016 at 17:06, Gurchetan Singh
> > <gurchetansingh at chromium.org> wrote:
> >> In Android, the pthreads libs are in bionic.  When building
> >> Mesa for Android with the autotools workflow, we shouldn't
> >> set -lpthread or -pthread.
> >> ---
> >>  configure.ac | 7 +++++--
> >>  1 file changed, 5 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/configure.ac b/configure.ac
> >> index 4761c59..3f21cd5 100644
> >> --- a/configure.ac
> >> +++ b/configure.ac
> >> @@ -823,8 +823,11 @@ if test "x$ax_pthread_ok" = xno; then
> >>  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.
> >> -test -z "$PTHREAD_LIBS" && PTHREAD_LIBS="-lpthread"
> >> +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
> >>
> > Fwiw I'm inclined that we should drop this all together. At the same
> > time we might be missing PTHREAD_CFLAGS/LIBS but we can tackle them as
> > needed.
> > Furthermore git log shows that this is added for pkgconfig files in
> > mind. Shouldn't we just tackle that w/o touching PTHREAD_LIBS ?
> >
> > Matt, being the author of commit
> > dd4fde8f674f5e3efa19e929f97de4ecfd82391b can we have your input ?
>
> I have no memories about that commit, but it seems odd. On Linux
> you're supposed to use CFLAGS=-pthread instead of linking with
> -lpthread. A minority of pkgconfig files on my system have -pthread in
> Cflags, but I suspect that would be the righe thing to do and then we
> should remove this hunk from configure.ac. At least, that's my guess
> :)
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161028/fd348711/attachment-0001.html>


More information about the mesa-dev mailing list