summaryrefslogtreecommitdiff
path: root/dist/XSLoader/XSLoader_pm.PL
Commit message (Collapse)AuthorAgeFilesLines
* XSLoader shouldn't use mod2fname when finding .bs files.Craig A. Berry2017-12-311-4/+7
| | | | | | | | | 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.
* show modern usage for {XS,Dyna}LoaderZefram2017-12-161-12/+11
| | | | Fixes [perl #132247].
* fix other pod versions that had become out of date, and add reminder commentsKaren Etheridge2017-11-181-2/+2
|
* Replace multiple 'use vars' by 'our' in distNicolas R2017-11-111-5/+4
| | | | | | | | | | | | | | | | | | | | 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
* Further simplify XSLoader .bs file handlingDagfinn Ilmari Mannsåker2017-10-231-7/+2
| | | | | Because we're not actually doing anything with it, combine the check with the one for the missing file.
* Avoid loading .bs files twice when using XSLoaderDagfinn Ilmari Mannsåker2017-10-231-3/+2
| | | | | | 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.
* fix and test execution of non-empty .bs filesDavid Mitchell2017-04-071-2/+2
| | | | | | | | | | | | | | | | | | | | | 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.
* Fix typo in the name the .pm file is generated from.Abigail2017-01-201-1/+1
|
* Switch most open() calls to three-argument form.John Lightsey2016-12-231-2/+2
| | | | | | | | | | 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
* Upgrade XSLoader from version 0.22 to 0.24Steve Hay2016-09-071-2/+2
|
* Synchronize blead with CPAN XSLoader 0.22Sébastien Aperghis-Tramoni2016-07-051-1/+1
|
* Fix XSLoader to recognize drive lettersFather Chrysostomos2016-07-041-1/+13
| | | | | | | | 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.
* Increase $XSLoader::VERSION to 0.22Father Chrysostomos2016-07-031-1/+1
|
* Don’t let XSLoader load relative pathsFather Chrysostomos2016-07-031-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [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.
* XSLoader 0.21: use dl_find_symbol 3rd optional argumentReini Urban2015-11-111-4/+5
| | | | to skip the worthless dl_last_error message
* remove XSLoader and DynaLoader OS specific code on NA OSesDaniel Dragan2015-11-031-1/+10
| | | | | | | | | | @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.
* dont test for bootstrap file twice in XSLoaderDaniel Dragan2014-12-051-2/+3
| | | | | This saves ~8ms on my mech HD Win64 system per load() call. See [perl #123373] for details.
* Bump XSLoader version after 4821216b2814.Craig A. Berry2014-10-311-1/+1
|
* XSLoader: Amend the mod2fname generation to detect more casesBrian Fraser2014-10-311-2/+5
|
* bump $XSLoader::VERSIONTony Cook2014-10-031-1/+1
|
* Allow XSLoader to load modules from a different namespaceGraham Knop2014-10-031-2/+3
| | | | | | | | | | 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.
* DynaLoader: Introduce d_libname_uniqueBrian Fraser2014-01-031-2/+4
| | | | | | | | | | | | 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.
* Upgrade to XSLoader 0.16Sebastien Aperghis-Tramoni2012-09-031-3/+3
|
* Eliminate warnings from XSLoader on 5.005 and 5.004.Nicholas Clark2011-09-111-3/+23
| | | | | | 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.
* Updated XSLoader to CPAN version 0.15Chris 'BinGOs' Williams2011-06-091-7/+13
| | | | | | | | | | | | | | | | | | | | | | | [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.
* XSLoader::load() with no arguments can use caller to find a default package.Nicholas Clark2010-10-141-13/+17
| | | | | In the case of dynamic linking, it's already using caller to get a filename, so this isn't usually any extra work.
* Improve XSLoader::load documentation.Nicholas Clark2010-10-071-4/+8
| | | | | 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.
* Avoid defining a full XSLoader::bootstrap_inherit post 5.6, as it's not needed.Nicholas Clark2010-10-061-8/+23
| | | | | | | | | 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.
* For the generated XSLoader.pm, avoid a runtime lexical which is constant.Nicholas Clark2010-09-021-15/+10
| | | | | | | 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.
* Move XSLoader from ext/ to dist/Nicholas Clark2009-09-291-0/+407