Re: Compiler options for plperl

From: Reinhard Max <max(at)suse(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Compiler options for plperl
Date: 2002-10-31 17:53:52
Message-ID: Pine.LNX.4.44.0210311814510.9561-100000@wotan.suse.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

On Thu, 31 Oct 2002 at 12:11, Tom Lane wrote:

> If we try to do the above then we must also use the same compiler
> that was used for Perl. For example, your patch will instantly blow
> up on my system where Perl is built with HPUX's cc (per its default
> configuration) and Postgres is built with gcc (also its default
> choice) --- the compiler switches aren't even slightly alike.

I see.

Would it work for you, if only the preprocessor macro definitions were
derived from perl?

Here I get:

$ perl -MConfig -e 'print $Config{ccflags}'
-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64

> Please explain the problem you're trying to solve, rather than
> offering an unworkable patch with no explanation.

While I tried to compile PostgreSQL-7.3b3, I got:

gcc -O2 -g -fPIC -I.
-I/usr/lib/perl5/5.8.0/x86_64-linux-thread-multi/CORE
-I../../../src/include -c -o plperl.o plperl.c
In file included from
/usr/lib/perl5/5.8.0/x86_64-linux-thread-multi/CORE/op.h:480,
from
/usr/lib/perl5/5.8.0/x86_64-linux-thread-multi/CORE/perl.h:2209,
from plperl.c:61:
/usr/lib/perl5/5.8.0/x86_64-linux-thread-multi/CORE/reentr.h:602:
field `_crypt_struct' has incomplete type
/usr/lib/perl5/5.8.0/x86_64-linux-thread-multi/CORE/reentr.h:747:
confused by earlier errors, bailing out
make[3]: *** [plperl.o] Error 1

Adding -D_GNU_SOURCE to the gcc command line fixed this (crypt.h only
declares "struct crypt_data" when _GNU_SOURCE is defined). Our Perl
maintainer told me then, that these definitions should always be
fetched from Perl itself to be on the safe side.

cu
Reinhard

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Kris Jurka 2002-11-02 22:26:22 Re: DatabaseMetaData.getTables() problem
Previous Message Reinhard Max 2002-10-31 17:23:59 Re: test-and-set for s390x and powerpc64