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

XS_Loader.pm .bs strangeness

Thread Next
From:
Konovalov, Vadim ** CTR **
Date:
July 21, 2008 10:13
Subject:
XS_Loader.pm .bs strangeness
Message ID:
D16F05D0CAAA234BA2B753B80DE6100DA1A75F@DEEXC1U02.de.lucent.com
Hi,

it is widely known that XSLoader is lightweight version of Dynaloader, with some missing features that are documented:

<quote>
Many (most) features of "DynaLoader" are not implemented in "XSLoader", like for example the "dl_load_flags", not honored by "XSLoader".
</quote>

During dyna-loading, Dynaloader honors .bs files but XSLoader has only remnants of this logic so it does not honour .bs:

XSLoader contains

    my $bs = $file;
    $bs =~ s/(\.\w+)?(;\d*)?$/\.bs/; # look for .bs 'beside' the library

    goto retry if not -f $file or -s $bs;
... and no other $bs occurence in it.

Dynaloader contains

    # Execute optional '.bootstrap' perl script for this module.
    # The .bs file can be used to configure @dl_resolve_using etc to
    # match the needs of the individual module on this architecture.
    my $bs = $file;
    $bs =~ s/(\.\w+)?(;\d*)?$/\.bs/; # look for .bs 'beside' the library
    if (-s $bs) { # only read file if it's not empty
        print STDERR "BS: $bs ($^O, $dlsrc)\n" if $dl_debug;
        eval { do $bs; };
        warn "$bs: $@\n" if $@;
    }

IMO XSLoader should also have the lines

    if (-s $bs) { # only read file if it's not empty
        print STDERR "BS: $bs ($^O, $dlsrc)\n" if $dl_debug;
        eval { do $bs; };
        warn "$bs: $@\n" if $@;
    }

Either way, there is an inconsistency to be fixed.

BR,
VK.

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