summaryrefslogtreecommitdiff
path: root/ext/DynaLoader
Commit message (Collapse)AuthorAgeFilesLines
* dl_dyld.xs should not create a `mode` variable only to ignore itNicholas Clark2022-08-192-5/+3
| | | | | | | | | This unused variable dates back to when the file was first added. The code was structured as a static C wrapper emulating the dlopen() API with the native APIs, and then a copy of the existing XS code that called dlopen(). However, there is (and was) no need to keep it exactly this way, as the wrapper is only visible inside this file, meaning that it does not need to conform to any externally defined prototype.
* Remove NetWare supportDagfinn Ilmari Mannsåker2021-10-082-11/+3
| | | | The build has been broken since 2009.
* Remove undeclared $Is_VMS from DynaLoader_pm.PLCraig A. Berry2021-06-241-3/+0
| | | | | | The variable appears to have been unused since 1c7f9087b1206cc7, and the addition of strict in f0e0f25d5ce9118d61837a3 makes the generated DynaLoader.pm fail to compile. But only on VMS.
* Make DynaLoader strict-safeLeon Timmermans2021-06-201-2/+14
|
* Add warnings to DynaLoader/Makefile.PLLeon Timmermans2021-06-201-0/+2
|
* Add warnings to DynaLoader.tLeon Timmermans2021-06-201-0/+2
|
* style: Detabify indentation of the C code maintained by the core.Michael G. Schwern2021-01-171-15/+15
| | | | | | | | | | | This just detabifies to get rid of the mixed tab/space indentation. Applying consistent indentation and dealing with other tabs are another issue. Done with `expand -i`. * vutil.* left alone, it's part of version. * Left regen managed files alone for now.
* Make DynaLoader on MacOS check library existence with dlopenLeon Timmermans2020-12-221-4/+12
| | | | | | A number of system libraries no longer exist as actual files, even though dlopen will pretend they do, so now we fall back to dlopen if a library file can not be found.
* DynaLoader: use PerlEnv_getenv()Karl Williamson2020-11-292-2/+2
| | | | Doing so invokes thread-safe guards
* add gitignore exclusions for files in gitGraham Knop2020-11-231-0/+1
| | | | | | | | There are a number of files excluded using gitignore rules that are included in the repository. This can lead to confusion if something other than git tries to read the ignore files. Add rules to the gitignore files so that these files won't be ignored.
* Remove PERL_GLOBAL_STRUCTDagfinn Ilmari Mannsåker2020-07-202-13/+9
| | | | | | | | This was originally added for MinGW, which no longer needs it, and only still used by Symbian, which is now removed. This also leaves perlapi.[ch] empty, but we keep the header for CPAN backwards compatibility.
* Remove Symbian portDagfinn Ilmari Mannsåker2020-07-202-253/+0
| | | | | Also eliminate USE_HEAP_INSTEAD_OF_STACK and SETSOCKOPT_OPTION_VALUE_T, since Symbian was the only user of those.
* Fix a bunch of repeated-word typosDagfinn Ilmari Mannsåker2020-05-221-1/+1
| | | | | Mostly in comments and docs, but some in diagnostic messages and one case of 'or die die'.
* Dynaloader: Add, fix commentsKarl Williamson2020-03-161-1/+13
|
* Add strict and warnings to some .PL filesNicolas R2020-03-131-1/+6
| | | | | use a convoluted incantation to be able to set 'use strict; use warnings' only for Perl > 5.6
* ext/DynaLoader/dl_aix.xs: Use isDIGIT macroKarl Williamson2019-11-112-2/+2
| | | | which is more efficient
* Mark unused dl_unload_all_files() argumentDagfinn Ilmari Mannsåker2018-03-271-0/+1
|
* Fix building with -Accflags=-DDL_UNLOAD_ALL_AT_EXITDagfinn Ilmari Mannsåker2018-03-271-6/+3
| | | | | | | | | | Commit bb6a367ad5d replaced an XPUSHs inside a loop with an EXTEND outside it, but didn't move the dSP to match. Even if it did, that would have been wrong, since the loop might push more than one value. Revert that bit of the commit. In passing, move the declaration of dl_librefs and dl_libref into the scope where they're used.
* show modern usage for {XS,Dyna}LoaderZefram2017-12-161-2/+2
| | | | Fixes [perl #132247].
* DynaLoader simplify parsing option ruleNicolas R2017-11-151-6/+4
| | | | | | | | | | After review, comments & dumb benchmark. Simply using a substitute for these two '-L' and '-l' options parsing makes the code easier to maintain. The benchmark difference is pretty close, for matching, non matching (short or long) strings.
* Avoid unique REGCOMP in dynaloaderJ. Nick Koston2017-11-031-3/+3
| | | | | | | | | Dynaloader has 4 unique regex's that cannot be de-duplicated by perlcc. Switch them to index/substr References: CPANEL-15683 Signed-off-by: Nicolas R <atoomic@cpan.org>
* Convert strcmp into strEQ, strNEKarl Williamson2017-10-242-3/+3
| | | | The latter two are easier to read
* DynaLoader: Use strlcpy instead of strcpyKarl Williamson2017-10-242-2/+2
| | | | strlcpy is safer.
* 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.
* 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
* Change white space to avoid C++ deprecation warningKarl Williamson2016-11-182-2/+2
| | | | | | | | | | | | | | | | | | | | | | C++11 requires space between the end of a string literal and a macro, so that a feature can unambiguously be added to the language. Starting in g++ 6.2, the compiler emits a warning when there isn't a space (presumably so that future versions can support C++11). Unfortunately there are many such instances in the perl core. This commit fixes those, including those in ext/, but individual commits will be used for the other modules, those in dist/ and cpan/. This commit also inserts space at the end of a macro before a string literal, even though that is not deprecated, and removes useless "" literals following a macro (instead of inserting a blank). The result is easier to read, making the macro stand out, and be clearer as to the intention. Code and modules included with the Perl core need to be compilable using C++. This is so that perl can be embedded in C++ programs. (Actually, only the hdr files need to be so compilable, but it would be hard to test that just the hdrs are compilable.) So we need to accommodate changes to the C++ language.
* Patch unit tests to explicitly insert "." into @INC when needed.H.Merijn Brand2016-11-111-1/+1
| | | | | require calls now require ./ to be prepended to the file since . is no longer guaranteed to be in @INC.
* Remove references to USENET from ext/Dan Collins2016-06-202-3/+2
|
* DynaLoader shouldn't use mod2fname when finding .bs files.Craig A. Berry2016-02-131-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | Some platforms (probably only VMS and Android at the moment) take special steps via the function DynaLoader::mod2fname to construct a dynamic library name that will be unique and (if too long) truncated. Then DynaLoader looks for a bootstrap file with the exact same name as the dynamic library except with a .bs file extension. However, ExtUtils::MakeMaker has never produced bootstrap files that have been run through mod2fname, so while a Foo:Bar extension would produce a loadable library named PL__Foo_Bar.exe, the bootstrap would be called Bar.bs. That shouldn't be a problem since the bootstrap file is just Perl code read by Perl, but DynaLoader has (apparently forever) been looking for PL__Foo_Bar.bs and not finding it. So let's look for it by the name under which it actually exists. There are no core extensions that produce non-empty bootstrap files and no existing test coverage, but as-yet-unintegrated versions of MakeMaker do have such tests. See, for example, https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/commit/7f5e9a35addeea7ebfcded28277c85f723e1a5de
* fix an else nesting error from the last set of DynaLoader patchesTony Cook2015-11-252-2/+3
|
* fix symbian XS too, missed this when checking over the patchTony Cook2015-11-111-1/+1
| | | | Unfortunately the symbian SDK doesn't appear to be available anymore.
* DynaLoader: extend t/DynaLoader.t to be run from basedir alsoReini Urban2015-11-111-1/+6
| | | | This simplifies testing from core.
* DynaLoader/dl_*.xs: Define all PERL_IN_DL_*_XS markersReini Urban2015-11-118-1/+8
| | | | On Symbian harmonize with the rest.
* DynaLoader 1.36 dl_find_symbol add 3rd optional argumentReini Urban2015-11-1110-39/+54
| | | | | | | | | | | | On Darwin DynaLoader::bootstrap tries dl_find_symbol first with libhandle 0, to see if the shlib with the symbol is already loaded, e.g. with libc. We do not want to store the dl_last_error information for this mostly failing probe, so add an optional ign_err=0 argument. Similar for dl_find_symbol_anywhere, which is expected to fail for all librefs. Also support dl_last_error on symbian, as on all other platforms. TonyC: fix bad XS
* remove XSLoader and DynaLoader OS specific code on NA OSesDaniel Dragan2015-11-031-6/+7
| | | | | | | | | | @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.
* remove remains of dl_dld.xsDaniel Dragan2015-11-031-4/+0
| | | | dl_dld.xs was removed in 5.19.4 in commit 1e5d7f5401
* Replace 2 strcat()s with strlen() and memcpy() in dl_dlopen.xs.Nicholas Clark2015-10-171-4/+5
| | | | | | | | | | | | | | In the #if defined(DLOPEN_WONT_DO_RELATIVE_PATHS) block, there were two uses of strcat() that that the OpenBSD linker spotted and grumbled about. It can't see that the code was clear enough to be "obviously no bugs". However, I can see that with 2 successive calls to strcat() there's one more O(1) scan of the string length than there needs to be. So refactoring to eliminate strcat() also removes avoidable inefficiencies. Fortunately, this code isn't in a block that the MS compiler will ever see. So it won't be suggesting that memcpy_s() is obviously more secure than memcpy() (because two lengths are better than one).
* DynaLoader.t: Skip test on z/OSKarl Williamson2015-10-151-1/+1
| | | | | | | See thread beginning at http://nntp.perl.org/group/perl.perl5.porters/231613 dl_findfile() does not find z/OS hospitable.
* bump DynaLoader version to 1.35.Craig A. Berry2015-10-091-1/+1
|
* DynaLoader.doc was deleted 20 years ago in 3b35bae3Jarkko Hietaniemi2015-10-091-1/+0
|
* Do not inject use Config into Dynaloader.pm when PERL_BUILD_EXPAND_CONFIG_VARSTodd Rinaldo2015-08-271-2/+8
| | | | | The rest of the file automatically expanded Config variables, however the module was still accidentally loaded. This commit corrects the oversight.
* bump $DynaLoader::VERSION to 1.33Tony Cook2015-07-201-1/+1
|
* Replace reference to newXSUB with newXS.Matthew Horsfall (alh)2015-07-201-1/+1
| | | | newXSUB hasn't been around for a long time
* grok_atoUV: don't make part of APIHugo van der Sanden2015-03-0912-1/+12
| | | | .. but keep available to extensions.
* [perl #123814] replace grok_atou with grok_atoUVHugo van der Sanden2015-03-091-3/+7
| | | | | | | | | | | | Some questions and loose ends: XXX gv.c:S_gv_magicalize - why are we using SSize_t for paren? XXX mg.c:Perl_magic_set - need appopriate error handling for $) XXX regcomp.c:S_reg - need to check if we do the right thing if parno was not grokked Perl_get_debug_opts should probably return something unsigned; not sure if that's something we can change.
* Initialize RMS structs at clone time in dl_vms.xs.Craig A. Berry2015-01-312-1/+10
| | | | | | | | | | | | | | | When we clone the interpreter-specific data, we create new copies of these structures under my_cxtp. However, the copy contains pointers that reference portions of the old structure, not the copy. Surprisingly, this usually works, but it does mean using another thread's data and has recently turned into a test failure via an access violation in dist/Thread-Queue/t/02_refs.t. So let's copy a few lines from dl_private_init to the point at which we clone, thus making sure those structures are initialized once per thread. It seems I really should have done this way back in 8c472fc1d477e.
* Fix compilation errors in DynaLoader.c with MinGW/gcc -xc++Steve Hay2014-12-242-2/+2
| | | | error: invalid conversion from 'void*' to 'HMODULE'
* Bump Dynloader version to satisfy porting/cmp_version.tChris 'BinGOs' Williams2014-11-271-1/+1
|
* HP-UX dynaloading uses shl_t, not void ptr.Jarkko Hietaniemi2014-11-271-1/+1
|
* printf type-matching.Jarkko Hietaniemi2014-11-271-5/+5
|