Re: 7.4.2 on Solaris 9 - Error

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: wespvp(at)syntegra(dot)com, Kris Jurka <books(at)ejurka(dot)com>, Carmen Gloria Sepulveda Dedes <csepulveda(at)atichile(dot)com>, pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Re: 7.4.2 on Solaris 9 - Error
Date: 2004-03-27 13:35:33
Message-ID: 40658325.9070609@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Bruce Momjian wrote:

> wespvp(at)syntegra(dot)com wrote:
>> On 3/25/04 3:43 PM, "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us> wrote:
>>
>> > I assume you were using 7.4.0, rather than 7.4.2. Current CVS has in
>> > template/solaris:
>> >
>> >
>> > # tools/thread/thread_test must be run
>> > # -D_POSIX_PTHREAD_SEMANTICS enables 5-arg getpwuid_r, among other
>> > things
>> > 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
>>
>> I'm right in the middle - using 7.4.1 with GCC. However, I did try 7.4.2
>> and it has the same problem.
>>
>> Looks like a typo in template/solaris, and certainly explains the bad
>> parameter on gcc. The "if gcc" has the incorrect "-pthread".
>>
>> This would seem an appropriate place to add - -D_REENTRANT to fix the errno
>> issue, wouldn't it?
>
> Are you sure your change is correct? We just added
> "-D_POSIX_PTHREAD_SEMANTICS" in post 7.4.2, and the submitters did not
> mention any problems with the -pthread line for gcc.
>
> I just tried it on Sourceforge's Solaris 9 and I see:
>
> bash-2.05$ gcc -pthread
> gcc: unrecognized option `-pthread'
> gcc: no input files
>
> which seems to indicate you are right. I am kind of surprised. Some
> platforms to take -pthread, some -lpthread, so I am pretty sure it was
> specified by the original Solaris guy.

there are also platforms using -pthreads, -kthread, -Kthread, -mthreads,
-mt and --thread-safe ... with dependancies on other compiler flags like
-D_REENTRANT, -D_THREAD_SAFE, order dependencies (like need to check for
pthreads before -lpthread on AIX) and sometimes resulting in a different
compiler program called alltogether.

Jan

>
> OK, new template/solaris version applied to 7.4.X and head:
>
> ---------------------------------------------------------------------------
>
>
> if test "$GCC" != yes ; then
> CC="$CC -Xa" # relaxed ISO C mode
> CFLAGS="-O -v" # -v is like gcc -Wall
> fi
>
> # Pick right test-and-set (TAS) code.
> case $host in
> sparc-*-solaris*) need_tas=yes; tas_file=solaris_sparc.s ;;
> i?86-*-solaris*) need_tas=yes; tas_file=solaris_i386.s ;;
> esac
>
> THREAD_SUPPORT=yes
> NEED_REENTRANT_FUNCS=yes # 5.6 2003-09-13
> THREAD_CPPFLAGS="-D_POSIX_PTHREAD_SEMANTICS"
> if test "$GCC" != yes
> then THREAD_CPPFLAGS="$THREAD_CPPFLAGS -mt"
> fi
> THREAD_LIBS="-lpthread"
>

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Welty 2004-03-27 14:30:44 Re: Physical Database Configuration
Previous Message David Garamond 2004-03-27 11:22:23 Re: License on PostgreSQL