| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
This is a belated follow-up to 907196b2ca1c36611c32cb8, where I
did the same for DynaLoader but failed to notice that XSLoader has
its own check for the .bs file before it invokes DynaLoader.
This finally gets the new bootstrap.t test added to XS::APItest
in 2e6f1ae9c4f7857e86f85fde07 passing on VMS.
|
|
|
|
| |
Fixes [perl #132247].
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using vars pragma is discouraged and has been superseded
by 'our' declarations available in Perl v5.6.0 or later.
Additionally using 'vars' pragma increase the memory consumption of a
program by about 700 kB for no good reason.
This commit is about replacing the usage of 'vars' pragma
by 'our' in blead where it makes sense. ( leaving 'cpan' directory
outside of the scope )
-- using vars
perl -e 'use vars qw(@ISA $AUTOLOAD $VERSION); print qx{grep RSS /proc/$$/status} '
VmRSS: 2588 kB
-- using our instead
perl -e 'our (@ISA, $AUTOLOAD, $VERSION); print qx{grep RSS /proc/$$/status} '
VmRSS: 1864 kB
|
|
|
|
|
| |
Because we're not actually doing anything with it, combine the check
with the one for the missing file.
|
|
|
|
|
|
| |
When a .bs file is found, XSLoader::load() falls back to
DynalLoader::bootstrap() which will load it, so there's no need to do
it twice.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
During the build of XS modules, an empty Foo.bs file is normally created
for each Foo.so file. If a Foo_BS file is present, instead this triggers
the auto-generatation of a .bs file which may have executable perl
content.
However, nothing in core currently generates a non-empty .bs file. So add
a test that this mechanism works, and fix up the three dynamic lib loaders
which implement the 'do $bs if -s $bs' mechanism to not rely on the
process having '.' present in @INC.
As it happens this already works currently, because the name of the
.bs file to load will usually be something like
../../lib/auto/Foo/Foo.bs
and the presence of the leading '..' causes 'do' to load the file directly
rather than via @INC. But locally fix up @INC anyway, in case '../' isn't
always the case.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Switch from two-argument form. Filehandle cloning is still done with the two
argument form for backward compatibility.
Committer: Get all porting tests to pass. Increment some $VERSIONs.
Run: ./perl -Ilib regen/mk_invlists.pl; ./perl -Ilib regen/regcharclass.pl
For: RT #130122
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Commit 08e3451d made XSLoader confirm that the file path it got
from (caller)[2] was in @INC if it looked like a relative path.
Not taking drive letters into account, it made that @INC search
mandatory on Windows and some other systems. It still worked, but
was slightly slower.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[rt.cpan.org #115808]
The logic in XSLoader for determining the library goes like this:
my $c = () = split(/::/,$caller,-1);
$modlibname =~ s,[\\/][^\\/]+$,, while $c--; # Q&D basename
my $file = "$modlibname/auto/$modpname/$modfname.bundle";
(That last line varies by platform.)
$caller is the calling package. $modlibname is the calling file. It
removes as many path segments from $modlibname as there are segments
in $caller. So if you have Foo/Bar/XS.pm calling XSLoader from the
Foo::Bar package, the $modlibname will end up containing the path in
@INC where XS.pm was found, followed by "/Foo". Usually the fallback
to Dynaloader::bootstrap_inherit, which does an @INC search, makes
things Just Work.
But if our hypothetical Foo/Bar/XS.pm actually calls
XSLoader::load from inside a string eval, then path ends up being
"(eval 1)/auto/Foo/Bar/Bar.bundle".
So if someone creates a directory named ‘(eval 1)’ with a naughty
binary file in it, it will be loaded if a script using Foo::Bar is run
in the parent directory.
This commit makes XSLoader fall back to Dynaloader’s @INC search if
the calling file has a relative path that is not found in @INC.
|
|
|
|
| |
to skip the worthless dl_last_error message
|
|
|
|
|
|
|
|
|
|
| |
@dl_resolve_using is only used on dld/freemint, and HPUX shlib loader OSes.
Dont create the array and glob on OSes where @dl_resolve_using is ignored.
sub dl_undef_symbols is only implmented on dld and freemint (freemint is
dld under a different name), otherwise it always returns empty list. Dont
call the sub on OSes where we knows it's constant retval. Saves ops+compile
time for sub bootstrap.
|
|
|
|
|
| |
This saves ~8ms on my mech HD Win64 system per load() call.
See [perl #123373] for details.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
When trying to locate the binary component of a module, use the caller
package to find the library root directory, not the passed in module
name. Since the file path it is using is always taken from the caller,
using the passed in package prevents it from finding the library root.
If in the package File::Spec::Unix, and given XSLoader::load("Cwd"), the
library root is three levels up from the filename of the
File::Spec::Unix module, not one.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Android's linker has some unusual behavior, in that it only uses
the basename of a library in its cache. That means that, as far as
dlopen() is concerned, the libraries for Hash::Util and List::Util,
both of which are called Util.so, are the same.
This commit teaches DynaLoader about d_libname_unique. When
defined, it signals DynaLoader define a mod2fname sub that renames
the .so files to something "unique" -- so for example,
Hash/Util/Util.so becomes Hash/Util/PL_Hash__Util.so.
|
| |
|
|
|
|
|
|
| |
Don't pass parameters that old ExtUtil::MakeMaker doesn't understand.
Ensure that $DynaLoader::dl_debug exists prior to calling into DynaLoader's
XS code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[DELTA]
0.15 - 2011.04.17 - SAPER #PerlQA2011
- [DIST] CPAN-RT#54456: Set INSTALLDIRS to "site" when installed on
Perl 5.11+ (thanks to Todd Rinaldo).
- [DOC] Document a known bug under Perl 5.8.4 and 5.8.5.
- [TESTS] Fixed tests to pass under Perl 5.8.4 and 5.8.5.
0.14 - 2011.04.16 - SAPER #PerlQA2011
- [CODE] Updated from bleadperl:
- XSLoader::load() with no arguments can use caller to find
a default package (Nicholas Clark).
- Avoid defining a full XSLoader::bootstrap_inherit post 5.6,
as it's not needed (Nicholas Clark).
- Small optimisation: for the generated XSLoader.pm, avoid a
runtime lexical which is constant (Nicholas Clark).
- [TESTS] Updated from bleadperl, solving RT-CPAN #54132, #61332.
- [TESTS] Fixed tests for old Perls.
- [TESTS] Added t/00-load.t and t/01-api.t, to provide basic tests
when the main ones are skipped.
|
|
|
|
|
| |
In the case of dynamic linking, it's already using caller to get a filename, so
this isn't usually any extra work.
|
|
|
|
|
| |
Document that all arguments are passed on to the module's bootstrap function,
and the behaviour of the bootstrap function in modules built by xsubpp.
|
|
|
|
|
|
|
|
|
| |
Previously the full pre 5.6 XSLoader::bootstrap_inherit emulation code was
always declared, but only used with a *runtime* check of Perl version.
However, it appears to be part of the implicit API of XSLoader that
XSLoader::bootstrap_inherit exists, so keep a stub implementation post 5.6
the commit.
|
|
|
|
|
|
|
| |
XSLoader_pm.PL had been resolving $Config::Config{dlext}, and writing it as
the constant initialiser for a lexical variable in XSLoader.pm. In turn,
that lexical was used only once, in string interpolation. So the interpolation
can be done instead at build time.
|
|
|