On Monday 09 Aug 2004 9:18 pm, Robert Treat wrote:
> but I was pretty sure I had lpthread library on my machine (and verified
> this with some help from irc). however Makefile.global told me
>
> PTHREAD_CFLAGS = -pthread -D_REENTRANT -D_THREAD_SAFE
> -D_POSIX_PTHREAD_SEMANTICS
> PTHREAD_LIBS =
>
> so I added -lpthread to the PTHREAD_LIBS line and it all compiled ok and
> passed regression. one theory of where the problem lies focused on this
> bit of config.log:
>
> configure:13260: checking for the pthreads library -lpthreads
> configure:13301: gcc -o conftest -O2 -fno-strict-aliasing -g -D_GNU_SOURCE
> conftest.c -lpthreads -lz -lreadline -ltermcap -lcrypt -lresolv -lnsl -ldl
> -lm >&5
> /usr/i386-slackware-linux/bin/ld: cannot find -lpthreads
> collect2: ld returned 1 exit status
> configure:13304: $? = 1
> configure: failed program was:
I noticed it on a slackware 9.1 system as well. I didn't noticed the above
part but I had to change Makefile.global.
My hypothesis was linuxthreads does not transmit libpthread.so dependency
correctly.(Out of memory, found while reading on differences between NTPL and
linuxthreads. Don't remember the exact source now).
I got a failure while linking initdb because it was linking against libpq,
which in turn linking against libpthreads.so. So in order to close the
linking unit, the linker needs -lpthreads mentioned against initdb(or in
global linker flags).
NTPL can take care of this situation IIRC.
Since linuxthreads are becoming extinct rapidly(barring slackware and may be
debian, of course), I didn't chase the issue much. May be we need to document
this.
Shridhar