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

From Kenneth Marshall
Subject Re: V8 Beta 5 on AIX
Date
Msg-id 20041206180349.GD13240@it.is.rice.edu
Whole thread Raw
In response to Re: V8 Beta 5 on AIX  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: V8 Beta 5 on AIX
List pgsql-hackers
On Mon, Dec 06, 2004 at 12:53:52PM -0500, Bruce Momjian wrote:
> 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?
> 

We have until very recently supporting a number of applications
requiring threading on AIX 3/4/5. They always required much more
understanding of the entire compile/link/run cycle than any other
platform we use. Changing the CC line to cc_r works fine with the
only problem being the cascaded use of cc_r into any application
that links against libpq. Even with these complications, I think
we should still allow threading on AIX. Anyone who builds software 
on AIX already knows how to manage these issues.

Ken


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Call for port reports
Next
From: "Marc G. Fournier"
Date:
Subject: Re: branch for 8.0?