Re: solaris libpq threaded build fails - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: solaris libpq threaded build fails
Date
Msg-id 200901140341.n0E3fuq22178@momjian.us
Whole thread Raw
In response to Re: solaris libpq threaded build fails  (Andrew Chernow <ac@esilo.com>)
Responses Re: solaris libpq threaded build fails  (Andrew Chernow <ac@esilo.com>)
List pgsql-hackers
Andrew Chernow wrote:
> Andrew Chernow wrote:
> > Bruce Momjian wrote:
> >> I supposed Solaris 2.5.1 (release 1996) is just too old to add
> >> threading, and this code has been unchanged for years.
> >>
> > 
> > Yeah, its old.  Unfortunately for us, we still have to support it.
> > 
> > To set the record straight, the issue is not threads.  Threads work fine 
> > on 2.5.1.  This is a configure system linking issue, "gethostbyname" 
> > requires linking with libnsl.so.  So, thread_test.c must link with -lnsl.
> > 
> > The bigger issue is that the configure script needs to include -lnsl for 
> > older solaris platforms.  Solaris 2.5.1 has "gethostbyname_r" but the 
> > configure check fails for the same reason.
> > 
> > configure:19821: checking for gethostbyname_r
> > configure:19877: gcc -o conftest -O2 -Wall [...snip...]
> > Undefined     first referenced
> >  symbol           in file
> > gethostbyname_r                     /var/tmp//ccSuGLEn.o  (symbol 
> > belongs to implicit dependency /usr/lib/libnsl.so.1)
> > ld: fatal: Symbol referencing errors. No output written to conftest
> > collect2: ld returned 1 exit status
> > 
> > This is why thread_test.c thought it had to fall back on gethostbyname 
> > in the first place.
> > 
> 
> Forgot to mention, there is an easy fix:
> 
> ~]# LDFLAGS="-lnsl" ./configure --enable-thread-safety

But I assume that only works if I use gethostbyname_r(), right?  But we
do check for that in thread_test.c.  So that library that is all that is
needed?

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: solaris libpq threaded build fails
Next
From: KaiGai Kohei
Date:
Subject: Re: New patch for Column-level privileges