Re: [BUGS] 8.0.0beta1: -lpthread missing - Mailing list pgsql-patches

From Martin Münstermann
Subject Re: [BUGS] 8.0.0beta1: -lpthread missing
Date
Msg-id 411C8EE0.50507@betrusted.com
Whole thread Raw
In response to Re: [BUGS] 8.0.0beta1: -lpthread missing  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: [BUGS] 8.0.0beta1: -lpthread missing
List pgsql-patches
> OK, we now have thread compile failure reports on Debian and Slackware.
>
> The config/acx_pthread.m4 script basically tests these:
>
>     acx_pthread_flags=3D"pthreads none -Kthread -kthread lthread -pthread
>         -pthreads -mthreads pthread --thread-safe -mt pthread-config"
> =09
> in that order and exits once it finds the first one that can
> compile/link this:
>
>         AC_TRY_LINK([#include <pthread.h>],
>                     [pthread_t th; pthread_join(th, 0);
>                      pthread_attr_init(0); pthread_cleanup_push(0, 0);
>                      pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
>                     [acx_pthread_ok=3Dyes])
>
> Now, the big question is why -pthread can compile/link this successfully
> but -pthread isn't enough to build a library that uses threads.

I suspect that on Solaris, without "-lpthread" the pthread-stubs in
/usr/lib/libc.so might be called at runtime instead of the functional
ones in libpthread.so.

Could this easily be checked?

Martin

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [BUGS] 8.0.0beta1: -lpthread missing
Next
From: Martin Münstermann
Date:
Subject: Re: [BUGS] 8.0.0beta1: -lpthread missing