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-17 15:22:01
Message-ID: 200408171522.i7HFM1k04107@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-patchespgsql-www
OK, I got it working now.  Seems the code needed more help to loop than
I though, and of course trying to change it as little as possible caused
me to miss that.

The attached, applied patch properly aggregates the thread flags.  The
bad news is that on my platform that needs _no_ thread flags or
libraries I have:

	PTHREAD_CFLAGS          =   -Kthread -kthread -pthread -pthreads
			-D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS
	PTHREAD_LIBS            =

I assume those are just ignored for portability so I assume we are OK.

---------------------------------------------------------------------------

Martin Mnstermann wrote:
> Bruce Momjian wrote:
> > OK, I found the cause. I forgot to run autoconf after the
> > config/acx_pthread.m4 updated.  I just did so.  Please retest.  Thanks.
> 
> Ok, I did an cvs update and rerun configure.
> Now it gives me an error:
> 
> [...]
> checking whether pthreads work with -pthread... no
> checking whether pthreads work with -pthreads... yes
> checking for the pthreads library -lpthread... yes
> checking whether pthreads work with -mt... yes
> checking for the pthreads library -lpthreads... yes
> checking whether pthreads work without any flags... yes
> checking whether pthreads work with -Kthread... yes
> checking whether pthreads work with -kthread... yes
> checking for the pthreads library -llthread... yes
> checking whether pthreads work with -pthread... yes
> checking whether pthreads work with -pthreads... yes
> checking whether pthreads work with -mthreads... yes
> checking for the pthreads library -lpthread... yes
> checking whether pthreads work with --thread-safe... yes
> checking whether pthreads work with -mt... yes
> checking for joinable pthread attribute... unknown
> configure: WARNING: we do not know how to create joinable pthreads
> 
> [Oooops.]
> 
> checking if more special flags are required for pthreads... no
> checking for cc_r... gcc
> checking pthread.h usability... yes
> checking pthread.h presence... yes
> checking for pthread.h... yes
> checking for strerror_r... no
> checking for getpwuid_r... no
> checking for gethostbyname_r... no
> checking whether getpwuid_r takes a fifth argument... no
> checking whether strerror_r returns int... no
> [...]
> checking thread safety of required library functions... no
> configure: error:
> *** Thread test program failed.  Your platform is not thread-safe.
> *** Check the file 'config.log'for the exact reason.
> ***
> *** You can use the configure option --enable-thread-safety-force
> *** to force threads to be enabled.  However, you must then run
> *** the program in src/tools/thread and add locking function calls
> *** to your applications to guarantee thread safety.
> 
> 
> Bruce, I will send you my config.log privately.
> 
> Regards,
>   Martin
> 
> > 
> > -------------------------------------------------------------------------=
> > --
> > 
> > Martin M=FCnstermann wrote:
> > 
> >>Bruce Momjian wrote:
> >>
> >>>>--> We need -lpthread on solaris, too.
> >>>
> >>>=20
> >>>=20
> >>>So the current CVS code is good?
> >>
> >>=20
> >>No. At least not for solaris8.
> >>=20
> >>configure says:
> >>checking whether pthreads work with -pthread... no
> >>checking whether pthreads work with -pthreads... yes
> >>checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
> >>checking if more special flags are required for pthreads... no
> >>checking for cc_r... gcc
> >>checking pthread.h usability... yes
> >>checking pthread.h presence... yes
> >>checking for pthread.h... yes
> >>=20
> >>=20
> >>Makefile.global:
> >>PTHREAD_CFLAGS          =3D -pthreads -D_REENTRANT -D_THREAD_SAFE=20
> >>-D_POSIX_PTHREAD_SEMANTICS
> >>PTHREAD_LIBS            =3D
> >>=20
> >>No -lpthread and the resulting binaries have no dependancy on=20
> >>libpthread.so, so at runtime only the stubs are being called.
> >>=20
> >>Regards,
> >>  Martin
> >>=20
> > 
> > 
> 

-- 
  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: Marc G. FournierDate: 2004-08-17 21:29:14
Subject: archive updates
Previous:From: Devrim GUNDUZDate: 2004-08-17 13:11:37
Subject: Re: New News Entry

pgsql-bugs by date

Next:From: Tom LaneDate: 2004-08-17 15:31:35
Subject: Re: BUG #1220: "alter table rename to" inside a transaction violates ACID ordering
Previous:From: Adam SahDate: 2004-08-17 15:14:24
Subject: Re: BUG #1220: "alter table rename to" inside a transaction

pgsql-patches by date

Next:From: Aleksander KmetecDate: 2004-08-17 15:34:21
Subject: Re: Win32 PostgreSQL 8.0 Beta 1 Installer available
Previous:From: Tom LaneDate: 2004-08-17 15:18:29
Subject: Re: [PATCHES] GUC variables invisible to contrib/ modules

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