[Mesa-dev] [PATCH 1/2] configure.ac: Don't set PTHREAD_LIBS when it is not present

Emil Velikov emil.l.velikov at gmail.com
Thu Nov 10 20:15:26 UTC 2016


On 10 November 2016 at 19:04, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> On 9 November 2016 at 21:22, Gurchetan Singh
> <gurchetansingh at chromium.org> wrote:
>> AX_PTHREADS sets PTHREAD_CFLAGS and PTHREAD_LIBS, and we should
>> not append to it.
>>
>> This breaks building EGL since PTHREAD_CFLAGS isn't specified, so
>> let's add it here.
>>
>> I couldn't find any other places where this breaks the build in
>> my configuration.  If other configurations get broken, we should
>> add PTHREAD_CFLAGS where needed.
>>
> As mentioned before - we ought to [briefly] audit things.
> On second thought I'll give it a try - might be better :-P
>
Actually dropping the PTHREAD_LIBS configure bits leads to nearly(?)
every test failing to link amongst a few others such as the ANV
driver.

The gist is that as we create a static lib, the PTHREAD_CFLAGS
(-pthread) isn't stored in the .la file, but it isn't translated to
-lpthread either. Thus when linking the final object one has to
know/track if any of the static objects use pthreads. And if so add
PTHREAD_{CFLAGS,LIBS}.

Some interesting detail which I did not see earlier :-)

That said, I'm inclined to go with your original patch. Thanks for
sticking - seems like thing were messier than anticipated ;-)

Emil
P.S. For everyone else - we'll just check with distro maintainers
[what works on their systems] and work from there.


More information about the mesa-dev mailing list