Re: thread_test.c problems

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: wespvp(at)syntegra(dot)com
Cc: PostgreSQL-general <pgsql-general(at)postgresql(dot)org>, joseph speigle <joe(dot)speigle(at)jklh(dot)us>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: thread_test.c problems
Date: 2004-04-25 13:57:07
Message-ID: 200404251357.i3PDv7G01367@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

wespvp(at)syntegra(dot)com wrote:
> On 4/24/04 9:15 PM, "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us> wrote:
>
> > No, see pgsql/config/acx_pthread.m4. It does the THREAD_LIBS part
> > automatically, and the THREAD_SUPPORT part is gone. We run our thread
> > test as part of configure now.
>
> I must be missing something. I don't see a -lpthread anywhere. The libpq
> linking is:
>
> gcc -no-cpp-precomp -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes
> -Wmissing-declarations -bundle fe-auth.o fe-connect.o fe-exec.o fe-misc.o
> fe-print.o fe-lobj.o fe-protocol2.o fe-protocol3.o pqexpbuffer.o pqsignal.o
> fe-secure.o dllist.o md5.o ip.o wchar.o encnames.o noblock.o path.o thread.o
> -L../../../src/port -lssl -lcrypto -lkrb5 -lresolv -D_REENTRANT
> -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -o libpq.so.3.2
>
> How can this be linking in thread support without -lpthread?

In config/acx_pthreasd.m4, I see:

acx_pthread_flags="pthreads none -Kthread -kthread lthread \
-pthread -pthreads -mthreads pthread --thread-safe -mt pthread-conf
...

The configure test should be trying -lpthread as part of its work.

Can you check config.log to see why it is failing? Here is the code
that should be checking:

*)
AC_MSG_CHECKING([for the pthreads library -l$flag])
PTHREAD_LIBS="-l$flag"

I don't have any flags here so I can't test that. Maybe I should try on
FreeBSd.

Also, I am not happy the -D flags appear after the C files. I might
need to fix that in the Makefiles.

--
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

Browse pgsql-general by date

  From Date Subject
Next Message wespvp 2004-04-25 17:30:23 Re: thread_test.c problems
Previous Message Bruno Wolff III 2004-04-25 11:09:23 Re: target list evaluation wrt sequences

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2004-04-25 14:22:28 Re: [HACKERS] What can we learn from MySQL?
Previous Message Rob 2004-04-25 13:55:27 Re: [HACKERS] What can we learn from MySQL?