libplperl.so and libperl.so

From: David Walker <david(at)cosmicfires(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: libplperl.so and libperl.so
Date: 2004-11-13 20:15:38
Message-ID: 20041113201538.9605EABD@daahman.cosmicfires.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Your name : David Walker
Your email address : david(at)cosmicfires(dot)com

System Configuration
---------------------
Architecture (example: Intel Pentium) : Intel PII(Linux) and Intel
PPro(FBSD)

Operating System (example: Linux 2.4.18) : Linux 2.6.9 & FreeBSD
4.10-RELEASE-p3

PostgreSQL version (example: PostgreSQL-7.4.6) : PostgreSQL-7.4.6

Compiler used (example: gcc 2.95.2) : Linux: gcc version 3.3.4
FreeBSD: gcc version 2.95.4 20020320

Please enter a FULL description of your problem:
------------------------------------------------

If PostgreSQL is compiled with PL/Perl enabled and linked against Perl
compiled with libperl.so rather than libperl.a, then when postmaster tries to
load libplperl.so, libperl can't be found (Linux, one version of Perl
installed) or is linked with the wrong version of Perl (FreeBSD system Perl in
/usr and ports Perl in /usr/local).

Please describe a way to repeat the problem. Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------

Compile PostgreSQL with PL/Perl enabled and linked against Perl compiled with
libperl.so. Run "createlang plperl test" (assuming you have a database named
"test").
The command will fail with or "libperl.so not found" "Symbol not found".

If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

This problem occurs because the library path to libperl.so is not included in
libplperl.so.

This patch to postgresql-7.4.6/config/perl.m4 fixes the problem:

*** postgresql-7.4.6/config/perl.m4 Sat Nov 13 12:03:28 2004
--- postgresql-7.4.6-orig/config/perl.m4 Tue May 28 09:57:53 2002
***************
*** 30,35 ****
AC_MSG_CHECKING(for flags to link embedded Perl)
pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
! perl_embed_ldflags=`echo X"$pgac_tmp1" | sed "s/^X//"`
AC_SUBST(perl_embed_ldflags)dnl
AC_MSG_RESULT([$perl_embed_ldflags])])
--- 30,35 ----
AC_MSG_CHECKING(for flags to link embedded Perl)
pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
! perl_embed_ldflags=`echo X"$pgac_tmp1" | sed "s/^X//;s%$pgac_tmp2%%"`
AC_SUBST(perl_embed_ldflags)dnl
AC_MSG_RESULT([$perl_embed_ldflags])])

Thanks to AndrewSN in #postgresql on FreeNode for figuring out how to fix this.

David Walker
--------
http://howto.mainstreamlinux.com

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Stephan Szabo 2004-11-13 21:41:53 Re: Error in sql sintax
Previous Message Stefanos Harhalakis 2004-11-13 11:47:26 Bogus error message about private key (not a bug).