Markus Wichitill wrote:
Any difference with this patch:
-    load_module(PERL_LOADMOD_NOIMPORT,
-                newSVpvn("B::Deparse", 10),
-                newSVnv(SvOBJECT((SV*)cv) ? 0.61 : 0.60));
+    Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT,
+                     newSVpvn("B::Deparse", 10),
+                     newSVnv(SvOBJECT((SV*)cv) ? 0.61 : 0.60));


Yep, now it works.

OK, but then it's a perl problem? The perlapi manpage advertises this function is load_module(), not Perl_load_module(). I'm not sure what's happening.


Can you try compiling the attached program?

gcc -o load load.c `perl  -MExtUtils::Embed -e ccopts -e ldopts` -Wall -g

it should resolve to Perl_load_module_nocontext:

% nm load | grep load_module
         U Perl_load_module_nocontext

--
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com
/* clone.c */
#include <EXTERN.h>
#include <perl.h>

/*
 * gcc -o load load.c `perl  -MExtUtils::Embed -e ccopts -e ldopts` -Wall -g
 */

EXTERN_C void xs_init (pTHX);

EXTERN_C void boot_DynaLoader (pTHX_ CV* cv);

EXTERN_C void
xs_init(pTHX)
{
        char *file = __FILE__;
        dXSUB_SYS;
        /* DynaLoader is a special case */
        newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
}

#define TEST "print 'ok'"

int main(int argc, char **argv, char **env)
{
     char *embedding[] = { "", "-le", "0" };
     dTHX;
     PerlInterpreter *one_perl = perl_alloc();

     aTHX = one_perl;
     PERL_SET_CONTEXT(aTHX);
     perl_construct(one_perl);

     perl_parse(one_perl, xs_init, 3, embedding, (char **)NULL);
     /* DynaLoader must be preloaded before perl_clone, if DynaLoader
      * is to be required later */
     eval_pv("require DynaLoader;", TRUE);
     load_module(PERL_LOADMOD_NOIMPORT,
                 newSVpvn("B::Deparse", 10),
                 newSVnv(0.60));

     eval_pv(TEST, TRUE);

     perl_destruct(one_perl);
     perl_free(one_perl);

     exit(0);

} 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to