X-Original-To: pgsql-patches-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id EB9E05E46D2 for ; Fri, 13 Aug 2004 10:17:48 -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 55521-04 for ; Fri, 13 Aug 2004 13:17:43 +0000 (GMT) Received: from candle.pha.pa.us (candle.pha.pa.us [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 2ABC75E46CD for ; Fri, 13 Aug 2004 10:17:39 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id i7DDHb209607; Fri, 13 Aug 2004 09:17:37 -0400 (EDT) From: Bruce Momjian Message-Id: <200408131317.i7DDHb209607@candle.pha.pa.us> Subject: Re: [BUGS] 8.0.0beta1: -lpthread missing In-Reply-To: <411CA643.8050900@betrusted.com> To: =?ISO-8859-1?Q?Martin_M=FCnstermann?= Date: Fri, 13 Aug 2004 09:17:37 -0400 (EDT) Cc: Robert Treat , PostgreSQL-patches X-Mailer: ELM [version 2.4ME+ PL108 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UNKNOWN-8BIT 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/273 X-Sequence-Number: 12562 Martin Münstermann 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_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@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073