[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: compiling back-perl with perl 5.8.0




Hi Matthew,

The perl backend needs a little updating.

I can't remember the details right now, but how we build back-perl depends on how perl itself was built. The needed change is due to the change in the perl embed api between versions 5.6 and 5.6.1, I believe.

Currently, If perl is built with MULTIPLICITY ( which allows more than one interpreter to run ) then OpenLDAP could crash on the first use of the interpreter in a thread that did not create it. Thats because PERL_SET_CONTEXT macro has to be called with the interpreter needed.

The new MULTIPLICITY flag is where most of the change occurs, and to be more precise, some of the changes protected by HAVE_WIN32_ASPERL should be protected under HAVE_PERL_MULTIPLICITY which should be set at config time using 'perl -V' autoconf type test to figure out if it is needed.

Do a 'perl -V' and check what defines perl was built with.

The 'my_perl' errors are due to the new naming of the implicit perl interpreter variable, I believe. It use to be called something else. Another perl define that may need to be looked at is IMPLICIT_CONTEXT

http://perldoc.com/perl5.8.0/pod/perlembed.html for more info.

I'd be happy to help anyone who's interested in making the updates.

--Kervin

Matthew J Backes wrote:
Under perl 5.8.0, I cannot get the perl backend to compile as
packaged:

cc -g -O2 -I../../../include -I../../../include -I.. -I./.. -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl/5.8.0/CORE -c init.c  -fPIC -DPIC -o .libs/init.lo
init.c: In function `perl_back_initialize':
init.c:74: warning: passing arg 2 of `perl_parse' from incompatible pointer type
init.c: In function `perl_back_db_open':
init.c:147: `my_perl' undeclared (first use in this function)
init.c:147: (Each undeclared identifier is reported only once
init.c:147: for each function it appears in.)
init.c: In function `perl_back_xs_init':
init.c:182: `my_perl' undeclared (first use in this function)
init.c:182: warning: passing arg 3 of `Perl_newXS' from incompatible pointer type

(Debian Linux, Sid, Intel, gcc 2.95.4, perl 5.8.0, openldap 2.1.8)

Yet if I define HAVE_WIN32_ASPERL, all of the necessary 5.8.0 changes are made and it compiles fine.  I think.

export CPPFLAGS='-DHAVE_WIN32_ASPERL' doesn't work as then everything
tries to include "asperl_undefs.h" which doesn't exist on this
system...  enabling it in perl_back.h works around this, but is
clearly not the right way to fix the problem.

running "perl -MExtUtils::Embed -e ccopts" reports:
-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl/5.8.0/CORE


running "perl -MExtUtils::Embed -e ldopts" reports:
-rdynamic  -L/usr/local/lib /usr/lib/perl/5.8.0/auto/DynaLoader/DynaLoader.a -L/usr/lib/perl/5.8.0/CORE -lperl -ldl -lm -lpthread -lc -lcrypt

Has anyone else had similar experience with the perl-backend?

Matthew Backes
lucca@csun.edu