Skip site navigation (1) Skip section navigation (2)

plperl difficulties

From: "Ragnar Hakonarson" <rhakonarson(at)conquestnetwork(dot)com>
To: <pgsql-general(at)postgresql(dot)org>, <pgsql-interfaces(at)postgresql(dot)org>, <pgsql-novice(at)postgresql(dot)org>
Subject: plperl difficulties
Date: 2000-05-22 18:54:59
Message-ID: NEBBIFOICLBACOFMLADIGECCCAAA.rhakonarson@conquestnetwork.com (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-interfacespgsql-novice
Hi,

I have statically linked the DynaLoader with plperl.so and modified plperl.c
so that plperl functions executes do not execute within the 'safe
compartment'.

plperl.c have been changed as follows:

	extern void boot_Opcode _((CV * cv));
	extern void boot_SPI _((CV * cv));
	extern void boot_DynaLoader _((CV* cv)); <------ Added

	static void plperl_init_shared_libs(void) {
        char *file = __FILE__;
        dXSUB_SYS; <------- Added

        newXS("Opcode::bootstrap", boot_Opcode, file);
        newXS("SPI::bootstrap", boot_SPI, file);
        newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
<---added
	}


I then compile plperl.c as follows:

	gcc -o blib/arch/auto/plperl/plperl.so  -shared -L/usr/local/lib plperl.o
	eloglvl.o SPI.o /usr/lib/perl5/5.00503/i586-linux/auto/Opcode/Opcode.so
	-L/usr/lib/perl5/5.00503/i586-linux/CORE -lperl `perl -MExtUtils::Embed -e
	ccopts -e ldopts`



When I try to import a perl module that relies on a C module I get the
following error message:

	ERROR:  creation of function failed : Can't load
	'/usr/lib/perl5/site_perl/5.005/i586-linux/auto/Pg/Pg.so' for module
	Pg: /usr/lib/perl5/site_perl/5.005/i586-linux/auto/Pg/Pg.so: undefined
	symbol: PL_sv_undef at /usr/lib/perl5/5.00503/i586-linux/DynaLoader.pm
	line 169.

	at /caseTracking/packages/SP.pm line 7 BEGIN failed--compilation aborted
	at /caseTracking/packages/SP.pm line 7.
	BEGIN failed--compilation aborted at (eval 1) line 2.


Any ideas?

Any help is highly appreciated :)

Regards
Ragnar


pgsql-novice by date

Next:From: gomathi rajuDate: 2000-05-24 15:37:27
Subject:
Previous:From: WOLF, PATRICKDate: 2000-05-22 16:28:13
Subject: RE: running Postgresql on Mandrake 7.0

pgsql-interfaces by date

Next:From: Anders BengtssonDate: 2000-05-23 10:05:30
Subject: Charsets in JDBC driver?
Previous:From: Tom LaneDate: 2000-05-22 16:19:06
Subject: Re: libpq++ tracing considered harmfu[Fwd: libpq++ tracing considered harmful (was Re: libpq++ memory problems)]

pgsql-general by date

Next:From: ozricDate: 2000-05-22 18:55:01
Subject: Re: INSERT WITH SELECT help
Previous:From: Culberson, PhilipDate: 2000-05-22 18:30:20
Subject: RE: Getting back names of databases

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group