public inbox for [email protected]  
help / color / mirror / Atom feed
From: Martin Münstermann <[email protected]>
To: Bruce Momjian <[email protected]>
Cc: Robert Treat <[email protected]>
Cc: [email protected]
Subject: Re: 8.0.0beta1: -lpthread missing
Date: Wed, 11 Aug 2004 09:56:12 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

Hello!

Bruce Momjian wrote:
> Robert Treat wrote:
> 
>>>`pthread_once'
>>>../../../src/interfaces/libpq/libpq.so: undefined reference to
>>>`pthread_key_create'
>>>../../../src/interfaces/libpq/libpq.so: undefined reference to
>>>`pthread_setspecific'
>>>collect2: ld returned 1 exit status
>>>
>>>
>>>
>>>Please describe a way to repeat the problem.   Please try to provide a
>>>concise reproducible example, if at all possible:
>>>----------------------------------------------------------------------
>>># ./configure --prefix=/opt/postgresql-800beta1 --enable-thread-safety
>>># make
>>>
>>>
>>>If you know how this problem might be fixed, list the solution below:
>>>---------------------------------------------------------------------
>>>The binaries must be linked with pthread (-lpthread).
>>>
>>
>>Can you take a look at the thread below and report back if that fixes your 
>>problem?  http://archives.postgresql.org/pgsql-hackers/2004-08/msg00525.php

Yes, adding -lpthread to PTHREAD_LIBS and rebuilding solved the problem.
Note: when doing so, libpq.so is built with -lpthread, PTHREAD_LIBS is 
*not* used in the makefiles of the client binaries like initdb and psql.

> I looked at that.  The line that does the tests is in
> config/acx_pthread.m4:
> 	
> 	acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread
> 	-pthreads -mthreads pthread --thread-safe -mt pthread-conf ig"
> 
> so you should see that list tried.  Does that help?
> 
> I am majorly concerned that Slackware has the same problem as Unixware,
> meaning that if you use threading in the lib, you now need the flags on
> every applicaiton that uses the lib.  

At least on debian this is not the case (see above):
-lpthread is used when building libpq.so.3.2.
So the shared library contains a dependency on libpthread.so.
Then the client apps do not need a -lpthread at build time. The dynamic 
linker will resolve the dependency on libpthread.so (via libpq.so) at 
runtime.

Regards,
  Martin




view thread (20+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: 8.0.0beta1: -lpthread missing
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox