develooper Front page | perl.perl5.porters | Postings from July 2005

[perl #22959] missing symbols from embed.h when testing B::Generate

Thread Next
From:
Steve Peters via RT
Date:
July 12, 2005 19:02
Subject:
[perl #22959] missing symbols from embed.h when testing B::Generate
Message ID:
rt-3.0.11-22959-117088.6.37927081610563@perl.org
> [jimc - Sun Jul 13 22:36:22 2003]:
> 
> When doing 'make test' on B::Generate on 5.8.1-19893,
> I get missing symbols, which are defined in embed.h,
> and used successfully in core.  For me at least, theyre
> not available to this XS module (though other non-CORE
> XS's build ok).

> I dunno whether its a bug in CORE, in B::Generate, or
> a PEBCAK error, but I thought it safest to flag it,
> in case it impacts 5.8.1.

> [jimc@harpo maintperl]$ grep -r fold_constants *
> embed.fnc:p     |OP*    |fold_constants |OP* arg
> embed.h:#define fold_constants          Perl_fold_constants
> embed.h:#define fold_constants(a)       Perl_fold_constants(aTHX_ a)
> op.c:Perl_fold_constants(pTHX_ register OP *o)
> op.c:    return fold_constants(o);
> op.c:    return fold_constants((OP *) unop);
> op.c:    return fold_constants((OP *)binop);
> op.c:    o = fold_constants(o);
> op.c:       return fold_constants(o);
> proto.h:PERL_CALLCONV OP*       Perl_fold_constants(pTHX_ OP* arg);



> [jimc@harpo B-Generate-1.06-mod]$ make
> /usr/local/bin/perl5.8.1 ./Build
> lib/B/Generate.pm -> blib/lib/B/Generate.pm
> cc -c -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-
strict-aliasing -
> \ I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/
gdbm -g -O2
> \ -I/usr/local/lib/perl5/5.8.1/i686-linux-thread-multi/CORE -o lib/B/Generate.o
> \ lib/B/Generate.c
> lib/B/Generate.bs -> blib/arch/auto/B/Generate/Generate.bs
> cc -shared -L/usr/local/lib -o blib/arch/auto/B/Generate/Generate.so lib/B/Generate.o
> [jimc@harpo B-Generate-1.06-mod]$ make test
> /usr/local/bin/perl5.8.1 ./Build test
> test....Can't load 'blib/arch/auto/B/Generate/Generate.so' for module
> \ B::Generate: blib/arch/auto/B/Generate/Generate.so: undefined symbol: fold_constants 
at
> \ /usr/local/lib/perl5/5.8.1/i686-linux-thread-multi/DynaLoader.pm line 229.
 at test.pl line 4

The issue here is that C<fold_constants> is not part of the public API and is supposed to 
only be available only in the Perl core.  A more complete look at embed.h shows

    #ifdef PERL_CORE
    #define find_script             Perl_find_script
    #define force_list              Perl_force_list
    #define fold_constants          Perl_fold_constants
    #endif

So, given this, I'd say this is a bug in B::Generate, rather than the Perl core.  




Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About