Re: lpthread errors while compiling 8.0beta

From: Shridhar Daithankar <shridhar(at)frodo(dot)hserus(dot)net>
To: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: lpthread errors while compiling 8.0beta
Date: 2004-08-09 16:47:22
Message-ID: 200408092217.22017.shridhar@frodo.hserus.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2004-08-09 16:53:29 Re: Add Missing From?
Previous Message Robert Treat 2004-08-09 15:48:42 lpthread errors while compiling 8.0beta