Thread: posgresql 7.3beta3 compile error in src/pl/plperl (perl extension)

posgresql 7.3beta3 compile error in src/pl/plperl (perl extension)

From
Igor Shevchenko
Date:
Hi.

I've got a compile-time error when trying to build postgresql 7.3beta3 with
perl:

./configure --with-perl
make
............
make[4]: Entering directory `/usr/src/postgresql-7.3b3/src/pl/plpgsql/src'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/usr/src/postgresql-7.3b3/src/pl/plpgsql/src'
make[3]: Leaving directory `/usr/src/postgresql-7.3b3/src/pl/plpgsql'
make[3]: Entering directory `/usr/src/postgresql-7.3b3/src/pl/plperl'
gcc -O2 -fpic -I. -I/usr/lib/perl5/5.8.0/i686-linux-thread-multi-64int-ld/CORE
-I../../../src/include   -c -o plperl.o plperl.c
In file included from
/usr/lib/perl5/5.8.0/i686-linux-thread-multi-64int-ld/CORE/op.h:480,
                 from
/usr/lib/perl5/5.8.0/i686-linux-thread-multi-64int-ld/CORE/perl.h:2209,
                 from plperl.c:61:
/usr/lib/perl5/5.8.0/i686-linux-thread-multi-64int-ld/CORE/reentr.h:602: field
`_crypt_struct' has incomplete type
In file included from
/usr/lib/perl5/5.8.0/i686-linux-thread-multi-64int-ld/CORE/perl.h:3368,
                 from plperl.c:61:
/usr/lib/perl5/5.8.0/i686-linux-thread-multi-64int-ld/CORE/proto.h:246: parse
error before `off64_t'
/usr/lib/perl5/5.8.0/i686-linux-thread-multi-64int-ld/CORE/proto.h:248: parse
error before `Perl_do_sysseek'
/usr/lib/perl5/5.8.0/i686-linux-thread-multi-64int-ld/CORE/proto.h:248: parse
error before `off64_t'
/usr/lib/perl5/5.8.0/i686-linux-thread-multi-64int-ld/CORE/proto.h:248:
warning: data definition has no type or storage class
/usr/lib/perl5/5.8.0/i686-linux-thread-multi-64int-ld/CORE/proto.h:249: parse
error before `Perl_do_tell'
/usr/lib/perl5/5.8.0/i686-linux-thread-multi-64int-ld/CORE/proto.h:249:
warning: data definition has no type or storage class
/usr/lib/perl5/5.8.0/i686-linux-thread-multi-64int-ld/CORE/proto.h:1378: parse
error before `Perl_PerlIO_tell'
/usr/lib/perl5/5.8.0/i686-linux-thread-multi-64int-ld/CORE/proto.h:1378:
warning: data definition has no type or storage class
/usr/lib/perl5/5.8.0/i686-linux-thread-multi-64int-ld/CORE/proto.h:1379: parse
error before `off64_t'
plperl.c: In function `compile_plperl_function':
plperl.c:543: warning: cast to pointer from integer of different size
plperl.c:724: warning: cast from pointer to integer of different size
make[3]: *** [plperl.o] Error 1
make[3]: Leaving directory `/usr/src/postgresql-7.3b3/src/pl/plperl'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/src/postgresql-7.3b3/src/pl'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/postgresql-7.3b3/src'
make: *** [all] Error 2


It's linux 2.4 on pentium III, gcc 2.95.3, glibc 2.2, perl 5.8 (with support
for large integers (long long, 8 byte)).

--
Regards,
Igor Shevchenko

Re: posgresql 7.3beta3 compile error in src/pl/plperl (perl extension)

From
Neil Conway
Date:
Igor Shevchenko <igor@followupmarketer.com> writes:
> I've got a compile-time error when trying to build postgresql 7.3beta3 with
> perl:

> gcc -O2 -fpic -I. -I/usr/lib/perl5/5.8.0/i686-linux-thread-multi-64int-ld/CORE
> -I../../../src/include   -c -o plperl.o plperl.c
> In file included from
> /usr/lib/perl5/5.8.0/i686-linux-thread-multi-64int-ld/CORE/op.h:480,
>                  from
> /usr/lib/perl5/5.8.0/i686-linux-thread-multi-64int-ld/CORE/perl.h:2209,
>                  from plperl.c:61:
> /usr/lib/perl5/5.8.0/i686-linux-thread-multi-64int-ld/CORE/reentr.h:602: field
> `_crypt_struct' has incomplete type

This is a bug in Perl 5.8.0. To workaround it, add '-D_GNU_SOURCE' to
the CFLAGS for PL/Perl.

I'm planning to send in a patch that works around this problem for 7.3
final, but I haven't got a chance yet (if someone feels like doing it,
go right ahead).

Cheers,

Neil

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