Re: V8 Beta 5 on AIX - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: V8 Beta 5 on AIX
Date
Msg-id 200412061753.iB6HrqU20797@candle.pha.pa.us
Whole thread Raw
In response to Re: V8 Beta 5 on AIX  (Brad Nicholson <bnichols@ca.afilias.info>)
Responses Re: V8 Beta 5 on AIX
Re: V8 Beta 5 on AIX
List pgsql-hackers
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_rAC_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 pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: [Testperf-general] Re: 8.0beta5 results w/ dbt2
Next
From: Bruce Momjian
Date:
Subject: Re: V8 Beta 5 on AIX