Brad Nicholson wrote:
> >OK, I assume you used --enable-thread-safety in configure.  
> >
> Correct.
> 
> >This should
> >have added some PTHREAD link flags to your libpq build, and those
> >settings should have followed the libpq library into your pg_ctl link
> >line.
> >
> >Would you look in your Makefile.global for PTHREAD_* settings and report
> >those.  The second question is why saying those libraries are needed by
> >libpq is not passing down to uses of libpq, like in pg_ctl.
> >  
> >
> 
> PTHREAD_CFLAGS          =    -pthread  -D_REENTRANT -D_THREAD_SAFE 
> -D_POSIX_PTHREAD_SEMANTICS
> PTHREAD_LIBS            =  -lpthread      -lpthreads

OK, great.  Can I see the link line that creates libpq?  It should contain
the PTHREAD_LIBS flags.

If it does, the next question is why AIX doesn't pass those flags.

Oh, I think I see the cause.  I now remember from
config/acx_pthread.m4:

        # More AIX lossage: must compile with cc_r
        AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC})

Seems AIX wants a special _compiler_ to be used whenever threading is
involved, even by a linked-in library.  I didn't implement using
PTHREAD_CC because there was just too much code disruption for threading
on one platform.  I wonder if we should just disable threading on AIX.  

Let me ask --- if you change the CC line in Makefile.global to cc_r,
does everything build OK?  That might be a clean solution because the
change could be made in one place.  Of course this would mean the
backend would also be compiled using cc_r and I have no idea of the
effect.

Of course, the idea that any use of libpq has to use cc_r is going to
make building things complex without some adjustments.

Also, what version of AIX are you using?  Are other AIX folks having
thread build problems?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  [EMAIL PROTECTED]               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to