Re: Patch for: 7.4.2 build broken on Solaris 7 and 8 with

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Patch for: 7.4.2 build broken on Solaris 7 and 8 with
Date: 2004-03-14 23:51:46
Message-ID: 200403142351.i2ENpkd25179@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


I have updated the solaris template file in CVS HEAD and 7.4.X to
reflect your changes. I had already fixed the thread.c typo.

Thanks.

---------------------------------------------------------------------------

Jim Seymour wrote:
> Hi All,
>
> The following patch fixes building PostgreSQL 7.4.2 under Sun (Sparc)
> Solaris 7 and 8 (possibly earlier and later versions, as well) with
> --enable-thread-safety.
>
> The first addresses what would appear to be a coding error in
> thread.c. The second ensures the proper pthread function call
> semantics.
>
> Build tested using GCC 3.3.1 under Solaris 7 and 8. Tested with
> ancient version of Sun's commercial development package under Solaris
> 8.
>
> Note: I don't know that --enable-thread-safety actually *works* on
> these platforms. But the package now builds.
>
> Regards,
> Jim
>
>
> *** ./src/port/thread.c-orig Tue Mar 2 13:38:28 2004
> --- ./src/port/thread.c Sun Mar 14 10:07:04 2004
> ***************
> *** 186,192 ****
> * broken (well early POSIX draft) gethostbyname_r() which returns
> * 'struct hostent *'
> */
> ! *result = gethostbyname_r(name, resbuf, buffer, buflen, herrno);
> return (*result == NULL) ? -1 : 0;
>
> #else
> --- 186,192 ----
> * broken (well early POSIX draft) gethostbyname_r() which returns
> * 'struct hostent *'
> */
> ! *result = gethostbyname_r(name, resultbuf, buffer, buflen, herrno);
> return (*result == NULL) ? -1 : 0;
>
> #else
> *** ./src/template/solaris-orig Wed Jan 7 23:21:20 2004
> --- ./src/template/solaris Sun Mar 14 14:39:40 2004
> ***************
> *** 12,19 ****
> THREAD_SUPPORT=yes
> NEED_REENTRANT_FUNCS=yes # 5.6 2003-09-13
> if test "$GCC" = yes
> ! then THREAD_LIBS="-pthread"
> ! else THREAD_CPPFLAGS="-mt"
> THREAD_LIBS="-lpthread"
> fi
>
> --- 12,20 ----
> THREAD_SUPPORT=yes
> NEED_REENTRANT_FUNCS=yes # 5.6 2003-09-13
> if test "$GCC" = yes
> ! then THREAD_CPPFLAGS="-D_POSIX_PTHREAD_SEMANTICS"
> ! THREAD_LIBS="-pthread"
> ! else THREAD_CPPFLAGS="-mt -D_POSIX_PTHREAD_SEMANTICS"
> THREAD_LIBS="-lpthread"
> fi
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>

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

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2004-03-15 06:23:56 Custom format for pg_dumpall
Previous Message Bruce Momjian 2004-03-14 23:48:28 Re: Timing of 'SELECT 1'