X-Original-To: pgsql-bugs-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 64CD214B281E for ; Wed, 11 Aug 2004 04:56:52 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 85024-06 for ; Wed, 11 Aug 2004 07:56:34 +0000 (GMT) Received: from mail1.trustcenter.de (mail1.trustcenter.de [193.194.157.1]) by svr1.postgresql.org (Postfix) with ESMTP id 1298914B286A for ; Wed, 11 Aug 2004 04:56:32 -0300 (ADT) Received: from hermes.trustcenter.de (hermes.trustcenter.de [192.168.202.5]) by mail1.trustcenter.de (8.12.11/8.12.11) with ESMTP id i7B7uKHE031275; Wed, 11 Aug 2004 09:56:20 +0200 (CEST) Received: from [192.168.201.14] (titan.trustcenter.de [192.168.200.244]) by hermes.trustcenter.de (8.12.10/8.12.10/Debian-5) with ESMTP id i7B7uCmX024595; Wed, 11 Aug 2004 09:56:12 +0200 Message-ID: <4119D11C.5010206@betrusted.com> Date: Wed, 11 Aug 2004 09:56:12 +0200 From: =?ISO-8859-1?Q?Martin_M=FCnstermann?= User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.7.1) Gecko/20040707 X-Accept-Language: en-us, en, de-de, it MIME-Version: 1.0 To: Bruce Momjian Cc: Robert Treat , pgsql-bugs@postgresql.org Subject: Re: 8.0.0beta1: -lpthread missing References: <200408110119.i7B1JIU29556@candle.pha.pa.us> In-Reply-To: <200408110119.i7B1JIU29556@candle.pha.pa.us> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/136 X-Sequence-Number: 8926 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