Skip site navigation (1) Skip section navigation (2)

Re: [BUGS] 8.0.0beta1: -lpthread missing

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Martin Münstermann <mmuenstermann(at)betrusted(dot)com>
Cc: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>,PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [BUGS] 8.0.0beta1: -lpthread missing
Date: 2004-08-13 13:17:37
Message-ID: 200408131317.i7DDHb209607@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-patchespgsql-www
Martin Mnstermann wrote:
> Hi!
> 
> Martin M?nstermann wrote:
> >> 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?
> 
> I can confirm this suspect for Solaris8/gcc 3.2.3.
> How to reproduce it:
> Add a line like
>       printf("### NOTE: check_sigpipe_handler called.\n");
> to check_sigpipe_handler() in fe-secure.c and rebuild libpq.so.
> 
> The line is only dumped out (indicating that check_sigpipe_handler() is 
> being called), when the library is linked with -lpthread.
> Without -lpthread no complains from the compiler or linker, but 
> check_sigpipe_handler() is not called, because the stub of 
> pthread_once() in libc.so does nothing.
> 
> --> We need -lpthread on solaris, too.

So the current CVS code is good?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

Responses

pgsql-www by date

Next:From: Josh BerkusDate: 2004-08-13 16:38:20
Subject: Re: PGSQL-WINDOWS mailing list?
Previous:From: Martin MünstermannDate: 2004-08-13 11:30:11
Subject: Re: [BUGS] 8.0.0beta1: -lpthread missing

pgsql-bugs by date

Next:From: J. HondiusDate: 2004-08-13 13:28:48
Subject: Sequence problem in stresstest on 8.0-beta1 (windows)
Previous:From: Hans-Ulrich SchaeferDate: 2004-08-13 12:41:26
Subject: postgresql 8.0.0 beta1

pgsql-patches by date

Next:From: Andrew DunstanDate: 2004-08-13 13:20:30
Subject: Re: 8.0 Beta 1 // Environment Vars // .pgpass
Previous:From: Joerg HessdoerferDate: 2004-08-13 12:57:26
Subject: Re: 8.0 Beta 1 // Environment Vars // .pgpass

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group