[Mesa-dev] [PATCH] gbm: add pthread on libgbm LD_FLAGS

Alejandro Piñeiro apinheiro at igalia.com
Tue May 24 09:04:00 UTC 2016



On 24/05/16 10:58, Emil Velikov wrote:
> On 24 May 2016 at 09:21, Alejandro Piñeiro <apinheiro at igalia.com> wrote:
>> If not, mesa building fails with the following errors:
>> /mesa/src/gbm/../../include/c11/threads_posix.h:189: undefined reference to `pthread_mutexattr_init'
>> /mesa/src/gbm/../../include/c11/threads_posix.h:190: undefined reference to `pthread_mutexattr_settype'
>> /mesa/source/mesa/src/gbm/../../include/c11/threads_posix.h:192: undefined reference to `pthread_mutexattr_destroy
>> ---
>>  src/gbm/Makefile.am | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/gbm/Makefile.am b/src/gbm/Makefile.am
>> index aba8d1e..23a341e 100644
>> --- a/src/gbm/Makefile.am
>> +++ b/src/gbm/Makefile.am
>> @@ -23,7 +23,8 @@ libgbm_la_LDFLAGS = \
>>         -no-undefined \
>>         -version-info 1:0 \
>>         $(GC_SECTIONS) \
>> -       $(LD_NO_UNDEFINED)
>> +       $(LD_NO_UNDEFINED) \
>> +       -pthread
>>
> Seems like I'm one of the few people building mesa without -O0 ;-) But
> seriously: we might end up with another solution, regardless here is
> some feedback for future/other projects:
>
>  - Try to avoid hardcoding things - use AX_PTHREAD in configure and
> PTHREAD_{CFLAGS,LIBS} in places that need the symbols

FWIW, Im right now not hardcoding anything.

>  - Do not add -pthread and/or -lfoo into LDFLAGS. These belong in LIBADD/LDADD.

Ups, true. Sorry.

> Now I'm off to double-check the alternative solution and get things

Ok, I assume that you are looking to provide an alternative patch that
will fix this. Thanks.

BR


More information about the mesa-dev mailing list