summaryrefslogtreecommitdiff
path: root/lib/ExtUtils
Commit message (Collapse)AuthorAgeFilesLines
* test and fix using T_CVREF_REFCOUNT as an output parameterTony Cook2021-09-131-1/+1
|
* test and fix using T_AVREF_REFCOUNT as an output parameterTony Cook2021-09-131-1/+1
|
* test and fix using T_HVREF_REFCOUNT as an output parameterTony Cook2021-09-131-1/+1
|
* test and fix using T_SVREF_REFCOUNT as an output parameterTony Cook2021-09-131-1/+1
|
* test and fix using T_SV as an OUTPUT parameterTony Cook2021-09-131-1/+1
|
* incorporate review feedbackFelipe Gasper2021-05-201-30/+25
|
* Give SV information in default typemapFelipe Gasper2021-05-201-15/+40
| | | | Issue #18461
* Remove PERL_GLOBAL_STRUCTDagfinn Ilmari Mannsåker2020-07-201-27/+0
| | | | | | | | 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.
* lib/ExtUtils/t/Embed.t: Skip on EBCDICKarl Williamson2019-10-091-0/+5
| | | | This is not currently implemented for EBCDIC
* Declaration after statement in typemapFather Chrysostomos2017-12-101-1/+1
| | | | A follow-up to 6da090e6cb and 732d3893ab.
* Avoid newGVgen in default typemapFather Chrysostomos2017-12-101-4/+8
| | | | | | | | | newGVgen leaks memory, because it puts it vivifies a typeglob in the symbol table, without arranging for it to be deleted. A typemap is not an appropriate place to use it, since callers of newGVgen are responsible for seeing that the GV is freed, if they care. This came up in #115814.
* Replace multiple 'use vars' by 'our' in libNicolas R2017-11-112-11/+7
| | | | | | | | Using vars pragma is discouraged and has been superseded by 'our' declarations available in Perl v5.6.0 or later. This commit is about replacing the usage of 'vars' pragma by 'our' in 'lib' directory.
* 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
* Fix various pod errors.Karl Williamson2016-03-111-4/+7
| | | | Mostly these are too long verbatim lines.
* add parallelness to win32/GNUmakefileDaniel Dragan2016-01-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -.UPDATEALL is dmake only, doesn't exist in gmake, create more targets instead GNUmakefile:1319: warning: overriding recipe for target '.UPDATEALL' GNUmakefile:1024: warning: ignoring old recipe for target '.UPDATEALL' -fix ok/nok targets on dmake and gmake -dont delete old mini config.h, the copy overwrites it, for dmake and gmake 1 less process to run this way -modify whitespace and comments between 2 makesfiles so there are less delta lines if the 2 are diffed, this aids in diagnostics -remove perlmainst.c/perlmain.c build products, just use runperl.c directly 1 less disk file to create and later clean and git status and 2 less nodes in the make graph to traverse, also better for C debugger, since "runperl.c" is around after a git clean of the source tree, and runperl.c is in every single callstack in perl. -remove copying mini config.h to CORE dir, pointless since (mini) config.h isn't an input to config_h.PL, remove the exit 1 from commit 137443ea0a from 5.003, rewriting config.h is not a reason to stop the build with a fatal error, vivify CORE dir or else sub copy() fails -deshell UNIDATAFILES/mktables, 1 less cmd.exe process and 1 less .bat file written to disk for gmake (dmake always uses cmd.exe ATM) -combining mini config.h AKA $(MINIDIR)\.exists shell append lines is for another commit -perlglob.exe is not installed, it doesn't need to be rebased, it is only needed for module building, removing the dep makes the dep graph simpler -rename PERLIMPLIB so the lib is built in its final location in CORE dir this removes an extra xcopy process run. Since perl dll's .a/.lib is not longer in the root of the source tree, change the 2 tests and ExtUtils::CBuilder::Platform::Windows to look at the uninstalled final location dir, not the root dir -fix typo 0.282224->0.280224 in dist/ExtUtils-CBuilder/Changes -for GCC PERLEXPLIB must be used, passing "perldll.def" on cmd line to g++ means all data globals with EXTCONST are exported (which have dllexport on their declaration) instead of just what is in perldll.def and globvar.sym, INTERN/EXTERN.h could be revised to fix that, but I am not doing that at this time. Also drop linking GCC perl523.dll from 3 processes to just 1 process like with VC builds. Removing 2nd run of dlltool fixes a race condition where libperl523.a was generated twice. This caused a race condition failure where linking a XS DLL failed because the GCC linker of the XS DLL saw a partially written libperl523.a. -Relocation was tested with $(LINK32) -v -mdll -o $@ -Wl,--disable-auto-image-base -Wl,--image-base -Wl,0x400000 $(BLINK_FLAGS) $(PERLDLL_OBJ) $(shell @type Extensions_static) $(LIBFILES) $(PERLEXPLIB) to g++ linker to force an address conflict and verified with VMMap (unrelocated perl523.dll has ~40KB private memory, relocated has ~240KB private memory on Win 7 32b), historically there are problems with dllexport and dlltool and relocation problems with mingw -$(COREDIR)\ppport.h in gmake is separate lines since gmake normally launches processes directly, not through the shell, so it is more efficent to keep it as multiple lines for gmake, while dmake likes to burn CPU and IO between each line, and runs each line through cmd.exe -disable parallel building in make_ext.pl by not passing MAKEFLAGS env var to any subprocess, EUMM is not ready for parallelness inside a module building on Win32 -have harness proc and child .t procs share same disk perl.exe and perl523.dll files, this way they share memory pages, makefile.mk does the same thing
* lib/ExtUtils/typemap: silence g++ warning.David Mitchell2016-01-191-3/+11
| | | | | | | | | | | | From the added code comment: The weird way this is written is because g++ is dumb enough to warn "comparison is always false" on something like: sizeof(a) > sizeof(b) && a > B_t_MAX (where the LH condition is false)
* lib/ExtUtils/t/Embed.t: Fix for z/OSKarl Williamson2015-10-221-1/+1
|
* fix up EXTEND() callersDavid Mitchell2015-10-021-1/+5
| | | | | | | | | | | | | | | | | | | | | | The previous commit made it clear that the N argument to EXTEND() is supposed to be signed, in particular SSize_t, and now typically triggers compiler warnings where this isn't the case. This commit fixes the various places in core that passed the wrong sort of N to EXTEND(). The fixes are in three broad categories. First, where sensible, I've changed the relevant var to be SSize_t. Second, where its expected that N could never be large enough to wrap, I've just added an assert and a cast. Finally, I've added extra code to detect whether the cast could wrap/truncate, and if so set N to -1, which will trigger a panic in stack_grow(). This also fixes [perl #125937] 'x' operator on list causes segfault with possible stack corruption
* fix #124181 double free/refcnt problems in IO types in typemapDaniel Dragan2015-07-081-12/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 50e5165b96 "stop T_IN/OUT/INOUT/STDIO typemaps leaking" changed newRV to newRV_noinc, but the GV * returned by newGVgen() is owned by the package tree, like the SV * returned by get_sv(). Now when the RV to GV is freed on mortal stack, the GV * in the package tree is freed, and now there is a freed GV * in the package tree, if you turn on "PERL_DESTRUCT_LEVEL=2" (and perhaps DEBUGGING is needed too), the package tree is destroyed SV * by SV *, and perl will eventually warn with "Attempt to free unreferenced scalar" which a very bad panic type warning. commit 50e5165b96 was reverted in commit bae466e878 "Revert "stop T_IN/OUT/INOUT/STDIO typemaps leaking" for 5.22's release to stop the panic, but reintroduced the SV/RV leak. So fix the RV leak (the val passed as source arg of sv_setsv) by freeing it after the copying. In a very unlikely scenario, the RV could still leak if sv_setsv dies. Also fix the problem, that if this OUTPUT: type is being used for an incoming arg, not the outgoing RETVAL arg, you can't assign a new SV* ontop of the old one, that only works for perl stack return args, so replace "$arg = &PL_sv_undef;" with "sv_setsv($arg, &PL_sv_undef);" if its not RETVAL, this way OUTPUT on incoming args also works if it goes down the error path. For efficiency, in a RETVAL siutation, let the undef original SV* in $arg which is typically obtained from sv_newmortal() by xsubpp pass through if we error out. Also for efficiency, if it is RETVAL (which is more common) dont do the sv_setsv/SvREFCNT_dec_NN stuff (2 function calls), just mortalize (1 function call) the ex-temp RV and arrange for the RV to wind up on perl stack. Also, the GV * already knows what HV * stash it belongs to, so avoid the stash lookup done by gv_stashpv() and just use GvSTASH which are simple pointer derefs.
* Revert "stop T_IN/OUT/INOUT/STDIO typemaps leaking"David Mitchell2015-05-181-24/+8
| | | | | | | | | | | | This reverts commit 50e5165b9638b94be310f15477b42935c79e82d5. That commit fixed the leak too well and instead introduced a potential premature free. This re-introduces the long-standing leak, which will be addressed post 5.22 release. See RT #124181
* ExtUtils::Embed: silence test warningDavid Mitchell2014-12-191-1/+9
| | | | | | | | | | From the added code comments: XXX DAPM 12/2014: ExtUtils::Embed doesn't seem to provide API access to $Config{optimize} and so compiles the test code without optimisation on optimised perls. This causes the compiler to warn when -D_FORTIFY_SOURCE is in force without -O. For now, just strip the fortify on optimised builds to avoid the warning.
* stop T_IN/OUT/INOUT/STDIO typemaps leakingDavid Mitchell2014-12-121-8/+24
| | | | | These typemaps (which are ancient; mostly going back to 1994 or so) each leaked a GV and an RV.
* Perl_croak->Perl_croak_nocontext in core typemap + win32 static gitignoreDaniel Dragan2014-12-111-15/+15
| | | | | -1 less asm op for every very rarely executed branch on threaded perl -add a build product to ignore on the rarely tested Win32 static perl build
* my_plvarsp nulling and PERL_GLOBAL_STRUCT_PRIVATEDavid Mitchell2014-04-241-1/+7
| | | | | | | | | | | | | | | | | | | With PERL_GLOBAL_STRUCT_PRIVATE, all "global" vars are in a malloc()d structure pointed to by the static var my_plvarsp. At exit, this struct is freed and my_plvarsp is set to NULL. My previous commit c1181d2b skipped the free if PL_veto_cleanup is set (as it would be if other threads are still running for example), but still left my_plvarsp getting set to NULL. Thus other threads could still deref a null pointer if they accessed a "global" var just as the main thread was exiting. This commit makes the veto skip the NULLing in addition to the freeing. This commit is quite late into the code freeze, but it's a follow-up to the earlier attempt to get smokes not to fail, and all the affected code is within #ifdef PERL_GLOBAL_STRUCT_PRIVATE, so it shouldn't affect mainstream builds at all. (Famous last words.)
* lib/ExtUtils/t/Embed.t: Skip tests is cross-compiling and $Config{cc} is not ↵Brian Fraser2014-01-222-5/+7
| | | | available
* Revert "Squash COWs in the char* typemap"Father Chrysostomos2013-11-271-21/+1
| | | | This reverts commit 77ca9de6373481d905eed6af2904599353a658b3.
* Squash COWs in the char* typemapFather Chrysostomos2013-11-231-1/+21
| | | | | | | | | | | | | | | | | Some XS modules expect to be able to modify strings passed in as char pointers. Copy-on-write breaks that ability. So this commit makes the T_PV typemap uncow mutable COWs when passing them. const char* is now mapped to the new T_ROPV entry, to avoiding unnec- essarily slowing it down. Steffen Müller writes in <52912E9C.3030403@cpan.org> that the typemap is not dual-lifed, so it is not necessary to make this 5.16-compati- ble. However, I had already written the patch, and I think it is good to keep it possible to drop this typemap into a CPAN distribution. Any self-respecting C compiler should be able to optimise away the extra SvIsCOW(t_pv_tmp_sv) == 1 check, so there is no slowdown as a result of compatibility.
* skip lib/ExtUtils/t/Embed.t when cross-compilingFrançois Perrad2013-09-171-0/+4
| | | | | The toolchain is not installed on the target when cross-compiling. So, this test must be skipped, see patch below.
* [perl #52000] use PL_exit_flags in the test so it works non-threadedTony Cook2013-07-291-1/+1
|
* [perl #52000] Warn/abort on attempted perl exitJohn Gardiner Myers2013-07-291-6/+7
|
* ExtUtils::Embed::canon needs to *globally* substitute / for $asNicholas Clark2013-07-151-1/+1
| | | | | | Otherwise the results are buggy for package names with two or more separators. This bug broke a -Uusedl build, once ExtUtils::Embed was refactored to use the existing but always-buggy functionality.
* For -DPERL_GLOBAL_STRUCT, eliminate local variable plvarsp in main().Nicholas Clark2013-07-121-4/+5
|
* Fix SEGVs and test failures for -DPERL_GLOBAL_STRUCT_PRIVATENicholas Clark2013-07-121-0/+4
| | | | | | | | | | | | | With PERL_GLOBAL_STRUCT_PRIVATE "global" variables are in a structure in malloc()ed memory, not in global static variables or a global static structure. Hence no global variables are implicitly initialised to zero. * PL_curinterp and PL_op_sequence need initialising to NULL * The global structure is free()d before handlers registered with atexit() run, so be defensive about this. * Some C code checks SvOK(PL_sv_placeholder) so ensure that its SvFLAGS() are 0. * Zero PL_hash_seed
* Use more semantic markup in the Pod for ExtUtils::Embed.Nicholas Clark2013-07-091-48/+36
| | | | | | | | | | Instead of B<> use F<> for filenames. Instead of B<> use C<> for code. Instead of B<> use I<> for parameter names. Instead of F<> use C<> for e-mail addresses. Remove semantically unnecessary blank lines, and trailing spaces from edited lines.
* Refactor ExtUtils::Embed::xsi_{protos,body} to use a scalar $retval.Nicholas Clark2013-07-091-20/+26
| | | | | | | Previously the code was accumulating the return value by pushing lines onto an array @retval, then joining it to a single scalar on return. As nothing needs the individual lines, reduce the complexity by concatenating directly to a scalar.
* Refactor xsinit generation code in ExtUtils::Embed.Nicholas Clark2013-07-091-30/+17
| | | | | | | | | | Remove tautological comments about loading modules. Simplify xsi_protos() and static_ext(). canon('/','DynaLoader') is just 'DynaLoader' so inline the constant. Refactor canon() to consistently use 1 regex pattern delimiter, avoid map in void context, and teach it that extensions can be in 'dist' and 'cpan' as well as 'ext'. Remove obsolete C<require 5.002> statement.
* Refactor ExtUtils::Miniperl to use ExtUtils::Embed.Nicholas Clark2013-07-091-4/+0
| | | | | | | | There is now only one copy of Perl code to generate the C for an xsinit() function. This also eliminates ExtUtils::Miniperl::canon(), which was not exported, and is no longer needed.
* Tweak ExtUtils::Embed's generated C code to be closer to ExtUtils::Miniperl.Nicholas Clark2013-07-091-11/+12
| | | | | | | | Use #include "..." instead of #include <...> in xsi_header(), and don't add a trailing newline (and add a newline in xsinit() to compensate). Use four spaces instead of a tab for indenting. If there are no extensions and hence no calls to newXS() don't declare file[] and don't add a trailing newline.
* Propagate bugfixes from {mini,}perlmain.c into ExtUtils::Embed.Nicholas Clark2013-07-091-2/+4
| | | | | | | | | | | xs_init() must pass a static char* when creating &DynaLoader::boot_DynaLoader (commit 1b77350017006d9e) Avoid linker errors on Win32 by including perlapi.h (via XSUB.h) (commit 3ecadf9633330795) my_perl might be unused (commit 96a5add60f1f39d3)
* Refactor ExtUtils::Embed to work with miniperl.Nicholas Clark2013-07-091-6/+6
| | | | | | | | Remove the use of FileHandle, which relies on IO, and XS module. Only load Getopt::Std if it is needed (in xsinit()), to avoid needing to add Getopt::Std to lib/buildcustomize.pl Require File::Spec instead of using it, as it exports nothing, so there is no benefit to using it (but it costs a BEGIN block).
* Increase $ExtUtils::XSSymSet::VERSION to 1.3Father Chrysostomos2013-06-221-1/+1
|
* Fixed verbatim lines in POD over 79 charactersBrian Gottreu2013-06-221-1/+2
|
* release the global struct *after* we've finished using itTony Cook2013-01-251-4/+4
|
* when the output isn't RETVAL, update the SV instead of replacing itTony Cook2012-12-201-1/+1
| | | | | | | | | | Previously OUTPUT argument parameters would replace ST(n) instead of updating it, this meant that the caller's supplied value would not be updated. This change means that OUTPUT T_BOOL arguments called RETVAL won't be handled correctly, but since the OUTPUT didn't work previously for *any* case, this is a net improvement.
* Make CV * typemap entry support overloadingSteffen Mueller2012-05-221-10/+10
| | | | See RT #96872.
* Remove dead and obscure typemap entriesSteffen Mueller2012-02-021-7/+0
| | | | | | | | T_DATAUNIT and T_CALLBACK are nowhere to be found in a CPAN module and are not used in core. Their purpose is entirely unclear and they are trivial. They'll always be available from CPAN from the ExtUtils::Typemaps::Excommunicated module. See perlxstypemap for details on how to use that if you need it.
* Also add repaired variants for CV and SVREF typemapsSteffen Mueller2011-10-111-4/+35
|
* A repaired, properly refcounting AV&HV typemapSteffen Mueller2011-10-111-1/+36
| | | | | | The T_AVREF_REFCOUNT_FIXED and T_HVREF_REFCOUNT_FIXED can be used in place of T_AVREF/T_HVREF. They do away with having to remember to decrement refcounts manually.
* The Borland Chainsaw MassacreSteve Hay2011-09-101-7/+0
| | | | | Remove support for the Borland C++ compiler on Win32, as agreed here: http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2011-09/msg00034.html
* Version bumps for modules changed by a6d37805ca8a9ba8 ($Id$ removal).Nicholas Clark2010-12-161-1/+1
|