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

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

Thread Next
Steve Peters via RT
July 12, 2005 19:02
[perl #22959] missing symbols from embed.h when testing B::Generate
Message ID:
> [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/ -> blib/lib/B/
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/ -> blib/arch/auto/B/Generate/
> cc -shared -L/usr/local/lib -o blib/arch/auto/B/Generate/ 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/' for module
> \ B::Generate: blib/arch/auto/B/Generate/ undefined symbol: fold_constants 
> \ /usr/local/lib/perl5/5.8.1/i686-linux-thread-multi/ line 229.
 at 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

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

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About