Re: PL/Perl and Perl 5.8 - Mailing list pgsql-hackers

From Neil Conway
Subject Re: PL/Perl and Perl 5.8
Date
Msg-id 873cr5r6q4.fsf@mailbox.samurai.com
Whole thread Raw
In response to Re: PL/Perl and Perl 5.8  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: PL/Perl and Perl 5.8  (Larry Rosenman <ler@lerctr.org>)
Re: PL/Perl and Perl 5.8  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:
> Neil Conway <neilc@samurai.com> writes:
> > As of current CVS, PL/Perl doesn't seem to compile against Perl 5.8.
> 
> Builds fine on HPUX 10.20 with Perl 5.8.0 and gcc 2.95.3.

It may also depend on the way Perl is configured. I've attached the
output of 'perl -V' on my system (using Debian's default Perl
packages).

> > The thread suggests a trivial fix: adding -D_GNU_SOURCE to the CFLAGS
> > for the affected files. I checked, and this gets PL/Perl to compile
> > correctly. That doesn't seem like the right fix, though.
> 
> In view of opposing comments like
> http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2002-03/msg01452.html
> I think we should stay out of this.

Well, I'd read that thread as saying that "Apache breaks when compiled
with -D_GNU_SOURCE", not claiming that there is something inherently
wrong with defining _GNU_SOURCE as a fix for the Perl problem.

> It is not our business to get random Perl code to compile on random
> OS installations, and certainly not our business to interject random
> symbol definitions that might well break whatever solution the Perl
> guys themselves decide on.

Well, I'm not happy with defining _GNU_SOURCE, but I don't agree that
just saying "it's a Perl problem" is a good answer. That may well be
the case, but it doesn't change the fact that a lot of people are
running 5.8.0, and will probably continue to do so during the 7.3
lifecycle[1]. We work around braindamage on other systems -- strictely
speaking, we could say "the snprintf() bug with 64-bit Solaris is a
Sun libc problem", for example.

Perhaps we can include a test for this in configure? (i.e. if
--with-perl is specified, try compiling a simple XS file that exhibits
the problem; if it fails, try it with -D_GNU_SOURCE).

Cheers,

Neil

[1] Note that I'm assuming that PL/Perl is broken with 5.8.0 on
systems other than mine, and another person's on IRC who reported the
problem to begin with. Can other people confirm the problem?

-- 
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC

Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration: Platform:   osname=linux, osvers=2.4.19,
archname=i386-linux-thread-multi  uname='linux cyberhq 2.4.19 #1 smp sun aug 4 11:30:45 pdt 2002 i686 unknown

             unknown gnulinux '   config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN -Dcccdlflags=-f

             PIC -Darchname=i386-linux -Dprefix=/usr -Dprivlib=/usr/share/perl/5.8.0 -Darchli

b=/usr/lib/perl/5.8.0-Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendora

rch=/usr/lib/perl5-Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.8.0

-Dsitearch=/usr/local/lib/perl/5.8.0-Dman1dir=/usr/share/man/man1 -Dman3dir=/u
                                                                                                      sr/share/man/man3
-Dman1ext=1-Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -U
                                                                                     afs -Ud_csh -Uusesfio -Uusenm
-Duseshrplib-Dlibperl=libperl.so.5.8.0 -Dd_dosuid
                                                                          -des'   hint=recommended, useposix=true,
d_sigaction=define  usethreads=define use5005threads=undef useithreads=define usemultiplicity=de

fine  useperlio=define d_sfio=undef uselargefiles=define usesocks=undef   use64bitint=undef use64bitall=undef
uselongdouble=undef  usemymalloc=n, bincompat5005=undef Compiler:   cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE
-DDEBIAN-fno-strict-aliasing
                                                     -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O3',   cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -I/usr/lo

cal/include'  ccversion='', gccversion='2.95.4 20011002 (Debian prerelease)', gccosandvers
                                                                                                                  =''
intsize=4,longsize=4, ptrsize=4, doublesize=8, byteorder=1234   d_longlong=define, longlongsize=8, d_longdbl=define,
longdblsize=12  ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize
                                                                                                                    =8
alignbytes=4, prototype=define Linker and Libraries:   ld='cc', ldflags =' -L/usr/local/lib'   libpth=/usr/local/lib
/lib/usr/lib   libs=-lgdbm -ldb -ldl -lm -lpthread -lc -lcrypt   perllibs=-ldl -lm -lpthread -lc -lcrypt
libc=/lib/libc-2.2.5.so,so=so, useshrplib=true, libperl=libperl.so.5.8.0   gnulibc_version='2.2.5' Dynamic Linking:
dlsrc=dl_dlopen.xs,dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'   cccdlflags='-fPIC', lddlflags='-shared
-L/usr/local/lib'


Characteristics of this binary (from libperl):  Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES
PERL_IMPLICIT_
                                     CONTEXT Built under linux Compiled at Sep 14 2002 17:36:21 @INC:   /etc/perl
/usr/local/lib/perl/5.8.0  /usr/local/share/perl/5.8.0   /usr/lib/perl5   /usr/share/perl5   /usr/lib/perl/5.8.0
/usr/share/perl/5.8.0  /usr/local/lib/site_perl
 



pgsql-hackers by date:

Previous
From: Gavin Sherry
Date:
Subject: Re: "COPY FROM" recognize \xDD sequence - addition to
Next
From: Larry Rosenman
Date:
Subject: Re: PL/Perl and Perl 5.8