<div dir="ltr"><div>Removing the entire hunk causes build failures on CrOS mesa.  Refer to this for more information:</div><div><br></div><div><a href="http://stackoverflow.com/questions/17055279/autotools-for-pthreads-not-setting-correct-linker-flags" target="_blank">http://stackoverflow.com/<wbr>questions/17055279/autotools-<wbr>for-pthreads-not-setting-<wbr>correct-linker-flags</a><br></div><div><br></div><div>We can do one of the following:</div><div><br></div><div>(1) Keep as is, with special case for android</div><div>(2) Set PTHREAD_LIBS=$PTHREAD_CFLAGS in <a href="http://configure.ac">configure.ac</a></div><div>(3) Do a giant sed to convert PTHREAD_LIBS to PTHREAD_CFLAGS in the entire tree</div><div><br></div><div>Any strong preferences???</div><div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 28, 2016 at 10:24 AM, Matt Turner <span dir="ltr"><<a href="mailto:mattst88@gmail.com" target="_blank">mattst88@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Fri, Oct 28, 2016 at 8:06 AM, Emil Velikov <<a href="mailto:emil.l.velikov@gmail.com">emil.l.velikov@gmail.com</a>> wrote:<br>
> On 27 October 2016 at 17:06, Gurchetan Singh<br>
> <<a href="mailto:gurchetansingh@chromium.org">gurchetansingh@chromium.org</a>> wrote:<br>
>> In Android, the pthreads libs are in bionic.  When building<br>
>> Mesa for Android with the autotools workflow, we shouldn't<br>
>> set -lpthread or -pthread.<br>
>> ---<br>
>>  <a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> | 7 +++++--<br>
>>  1 file changed, 5 insertions(+), 2 deletions(-)<br>
>><br>
>> diff --git a/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> b/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
>> index 4761c59..3f21cd5 100644<br>
>> --- a/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
>> +++ b/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
>> @@ -823,8 +823,11 @@ if test "x$ax_pthread_ok" = xno; then<br>
>>  fi<br>
>>  dnl AX_PTHREADS leaves PTHREAD_LIBS empty for gcc and sets PTHREAD_CFLAGS<br>
>>  dnl to -pthread, which causes problems if we need -lpthread to appear in<br>
>> -dnl pkgconfig files.<br>
>> -test -z "$PTHREAD_LIBS" && PTHREAD_LIBS="-lpthread"<br>
>> +dnl pkgconfig files.  Since Android doesn't have a pthread lib, this check<br>
>> +dnl is not valid for that platform.<br>
>> +if test "x$android" = xno; then<br>
>> +    test -z "$PTHREAD_LIBS" && PTHREAD_LIBS="-lpthread"<br>
>> +fi<br>
>><br>
> Fwiw I'm inclined that we should drop this all together. At the same<br>
> time we might be missing PTHREAD_CFLAGS/LIBS but we can tackle them as<br>
> needed.<br>
> Furthermore git log shows that this is added for pkgconfig files in<br>
> mind. Shouldn't we just tackle that w/o touching PTHREAD_LIBS ?<br>
><br>
> Matt, being the author of commit<br>
> dd4fde8f674f5e3efa19e929f97de4<wbr>ecfd82391b can we have your input ?<br>
<br>
</div></div>I have no memories about that commit, but it seems odd. On Linux<br>
you're supposed to use CFLAGS=-pthread instead of linking with<br>
-lpthread. A minority of pkgconfig files on my system have -pthread in<br>
Cflags, but I suspect that would be the righe thing to do and then we<br>
should remove this hunk from <a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a>. At least, that's my guess<br>
:)<br>
</blockquote></div><br></div>