summaryrefslogtreecommitdiff
path: root/makedef.pl
Commit message (Collapse)AuthorAgeFilesLines
* Remove NetWare supportDagfinn Ilmari Mannsåker2021-10-081-156/+3
| | | | The build has been broken since 2009.
* Move `use strict;` *out* of the BEGIN block in makedef.plNicholas Clark2021-09-291-3/+3
| | | | | | | | | `use strict;` was moved into the BEGIN block in 2015 as part of commit 196f7c461ba85005: export data symbols as data on Win32 This mistake wasn't spotted at the time, and meant that only the code within the BEGIN block was subject to strictures.
* The Makefile must run makedef.pl with -Ilib on the command lineNicholas Clark2021-09-291-1/+0
| | | | | | | | | | | | | | | | | It can't rely on adding 'lib' to @INC in a BEGIN block because during the build not all modules *are* in lib yet. For miniperl the two are not equivalent - adding -Ilib means that lib/buildcustomize.pl is run, and this sets up @INC properly to include all the toolchain modules in dist and cpan. In particular, constant is dual life and hence not available as lib/constant.pm until it has been copied from dist/constant/lib as part of the build process. Hence with a parallel build on AIX, before this commit there was a race condition between the job that builds dist/constant and the job that builds perl.exp. Sometimes the race was lost, resulting in a mysterious failed build. All other users of makedef.pl already invoke it with the appropriate -Ilib or -I..\lib, so this change won't affect them.
* MACH-O can't support C11 thread local in shared objects, so disable it.Nicholas Clark2021-09-071-1/+2
| | | | | | | | | | | | | | Apple's clang happily passes the probe and compiles _Thread_local no problem, but building extensions fails with ld: illegal thread local variable reference to regular symbol _PL_current_context for architecture arm64 The Internet suggests that the MACH-O format fundamentally can't support what is needed to implement C11 thread local storage in shared objects. It's frustrating that the error message is "Less Than Awesome" at explaining that this is the real problem here. Hence disable the use of C11 thread local storage in the hints file, and hence keep using pthreads.
* If we have thread local storage, use it instead of posix_getspecific().Nicholas Clark2021-09-071-0/+3
| | | | | | | | | | | | Declare and use a variable PL_current_context to store a pointer to the thread's interpreter struct. Use this to implement implicit context undef ITHREADS, instead of a call to posix_getspecific(). For normal threaded code, this will eliminate function calls. For threaded code in shared objects (the typical configuration for Linux distribution builds) there still needs to be a function call to get the pointer to thread local variables, but there will only be one per function, not one per read of the variable.
* replace all instances of PERL_IMPLICIT_CONTEXT with MULTIPLICITYTomasz Konojacki2021-06-091-3/+3
| | | | | | | | | | | | Since the removal of PERL_OBJECT (acfe0abcedaf592fb4b9cb69ce3468308ae99d91) PERL_IMPLICIT_CONTEXT and MULTIPLICITY have been synonymous and they're being used interchangeably. To simplify the code, this commit replaces all instances of PERL_IMPLICIT_CONTEXT with MULTIPLICITY. PERL_IMPLICIT_CONTEXT will stay defined for compatibility with XS modules.
* export the win32 symlink related symbolsTony Cook2021-01-051-0/+3
| | | | | | | I couldn't make the build fail due to these missing exports while I was developing the win32 symlink() support, but I did have it fail while testing an unrelated change, and reproduced it, so export them.
* Fix broken PERL_MEM_LOG under threadsKarl Williamson2020-12-191-0/+4
| | | | | | | | | | | | | This fixes GH #18341 There are problems with getenv() on threaded perls wchich can lead to incorrect results when compiled with PERL_MEM_LOG. Commit 0b83dfe6dd9b0bda197566adec923f16b9a693cd fixed this for some platforms, but as Tony Cook, pointed out there may be standards-compliant platforms that that didn't fix. The detailed comments outline the issues and (complicated) full solution.
* Refactor locale mutex setupKarl Williamson2020-12-081-3/+0
| | | | | | | | | | | | | | | | | | | | | | | This was prompted by my realization that even on a locale thread-safe platform, there are functions we call that may not be thread-safe in that they return their results in an internal static buffer, which may be process-wide instead of per-thread. Tomasz Konojacki++ briefly looked at Windows source code for localeconv() and this indeed did appear to be the case. If we thought a platform was thread-safe, no locale mutexes were set up, and instead the calls in the code to lock were no-oops. This would lead to potential races, the most likely candidate being localeconv(). None have been reported, at least as far as we know. Likely that function isn't called frequently. This would be true on both Posix 2008 and Windows platforms, except possibly for FreeBSD, which may be the only platform that we support that has a localeconv_l() function, which is supposed to be immune from this issue.. The solution adopted here is to test for all the possible functions that the Perl core uses that may be susceptible to this, and to set up the mutex if any are found. Thus there won't be no-ops where there should be a lock.
* Remove obsolete FCRYPT ifdefs and associated PL_cryptseen (#17624)Richard Leach2020-07-301-1/+0
| | | Co-authored-by: Karl Williamson <khw@cpan.org>
* Remove PL_appctx and PL_timesbase interpreter variablesDagfinn Ilmari Mannsåker2020-07-201-8/+0
| | | | These were only ever needed by Symbian.
* Remove PERL_GLOBAL_STRUCTDagfinn Ilmari Mannsåker2020-07-201-39/+3
| | | | | | | | 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 the final remnants of 5005threads supportDagfinn Ilmari Mannsåker2020-07-201-30/+0
| | | | Only THREAD_RET_TYPE is still used.
* 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'.
* don't export PL_mbrlen_ps, PL_mbrtowc, PL_wcrtomb if not definedTony Cook2020-03-271-0/+12
| | | | | | | | | | | | | | These variables are only defined when the appropriate symbols are defined in config.h, which are controled by their respective names in config.sh/%Config. Note that the earlier code in makedef.pl only defines the intrpvar.h symbols for non-multiplicity builds, so there's no need to special case this check for threaded/multiplicity builds where these symbols are never defined. A sufficiently modern MSVC CRT does turn out to define these symbols, but fixing this error first.
* Add mutex for accessing ENVKarl Williamson2020-03-111-0/+1
|
* makedef.pl: Add commentKarl Williamson2020-03-021-0/+1
|
* The VC6 Chainsaw MassacreSteve Hay2019-10-171-1/+1
| | | | | Remove MS Visual C++ 6.0 support as agreed in the thread starting here: https://www.nntp.perl.org/group/perl.perl5.porters/2019/07/msg255625.html
* makedef.pl: export symbols flagged as CCraig A. Berry2019-09-201-1/+1
| | | | | | | | | | 0923255565af0741 broke the build on any platform that does not promiscuously export all symbols from a shared library because it moved a bunch of symbols from being API (A flag) to core-only (C flag), but the new C flag was unknown to the program that generates the export list. Some of these functions are already used outside the core (such as by the Encode extension) so we can't simply pull the plug on them.
* The Windows CE Chainsaw MassacreSteve Hay2019-06-181-183/+168
| | | | | Remove WinCE support as agreed in the thread starting here: https://www.nntp.perl.org/group/perl.perl5.porters/2018/07/msg251683.html
* embed.fnc: Change x flag to eKarl Williamson2019-05-301-1/+1
| | | | | | | | | | | | autodoc.pl has the x flag in the '=for apidoc' lines mean something completely different, but Devel::PPPort combines both these lines and the contents of embed.fnc into one file, expecting the flags to be consistent. This commit changes the 'x' in embed.fnc to be 'e', which means to not export this function. Changing embed.fnc and makedef.pl keeps the changes more contained, and lessens the chance that some module will be adversely affected (I didn't see anything likely in grepping cpan).
* Use POSIX locale functions if setlocale not availableKarl Williamson2019-03-061-21/+32
| | | | | | POSIX 2008 added an independent set of locale handling functions beyond the venerable setlocale. This commit changes so they can be used rather than have no locale handling if there is, say, a problem with setlocale.
* perlvars.h: remove #ifdef DEBUGGINGDavid Mitchell2019-02-191-1/+0
| | | | | | | | | | Under PERL_GLOBAL_STRUCT, all the "global" vars are put in a structure, which means perlvars.h needs a similar constraint to intrpvar.h: its size and alignment shouldn't change between debugging and non-debugging builds. This is because regcomp/exec.c are compiled both with and without DEBUGGING. [Fixed by Karl]
* fix thread issue with PERL_GLOBAL_STRUCTDavid Mitchell2019-02-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | The MY_CXT subsystem allows per-thread pseudo-static data storage. Part of the implementation for this involves each XS module being assigned a unique index in its my_cxt_index static var when first loaded. Because PERL_GLOBAL_STRUCT bans any static vars, under those builds there is instead a table which maps the MY_CXT_KEY identifying string to index. Unfortunately, this table was allocated per-interpreter rather than globally, meaning if multiple threads tried to load the same XS module, crashes could ensue. This manifested itself in failures in ext/XS-APItest/t/keyword_plugin_threads.t The fix is relatively straightforward: allocate PL_my_cxt_keys globally rather than per-interpreter. Also record the size of this struct in a new var, PL_my_cxt_keys_size, rather than doing double duty on PL_my_cxt_size.
* Add global hash to handle \p{user-defined}Karl Williamson2019-02-141-0/+1
| | | | | | | A global hash has to be specially handled. The keys can't be shared, and all the SVs stored into it must be in its thread. This commit adds the hash, and initialization, and macros for context change, but doesn't use them. The code to deal with this is entirely confined to regcomp.c.
* Add mutex for dealing with qr/\p{user-defined}/Karl Williamson2019-02-141-0/+1
| | | | This will be used in future commits
* makedef.pl: Fix to work with -DNO_LOCALE config optKarl Williamson2019-02-061-1/+2
| | | | We shouldn't export non-existent variables
* PERL_OP_PARENT is always defined, stop testing for itTony Cook2019-01-251-6/+0
| | | | | | | | PERL_OP_PARENT is the new reality, leaving the pre-processor checks is more confusing that anything else. I left the test in perl.c for consistency with the other checks in that code.
* Allow forcing use of POSIX 2008 locale fcnsKarl Williamson2018-11-191-3/+9
| | | | | | | These thread-safe functions are not normally used on unthreaded builds, retaining the use of the library functions that have long been used. But, it is now possible to tell Configure to use them on unthreaded builds.
* win32: fix argumentless sleep()Tomasz Konojacki2018-08-011-0/+1
| | | | | | | | | | | | | | Before this commit, pause() was implemented as a macro calling win32_sleep((32767L << 16) + 32767), which was causing the following problems with argumentless sleep(): - it was sleeping for 4262198 seconds (~50 days) instead of forever - it was triggering "sleep(2147450879) too large" warning This commit implements pause() as a proper function which calls win32_msgwait() with an INFINITE timeout. [perl #133376]
* Fix to compile under -DNO_LOCALEKarl Williamson2018-07-011-0/+6
| | | | | Several problems with this compile option were not caught before 5.28 was frozen.
* #133125 revise -DNO_MATHOM logic again in makedef.plDaniel Dragan2018-04-211-1/+2
| | | | | | | | | | | | | | | | | | | Revision of patch in #133098. There is a problem described in #133125 with XS-APITest using with "Perl_" mathomed C symbols instead of the Perl_-less ones which would get preprocessor redirected to newer C funcs, then link failure of XS-APITest on Win32 because missing symbols. These symbols were missing because they were marked "m" and I thought in commit 1545ba5b04 "m" means no C symbol, ever, but that isn't true. It seems that "b" means must export on a with-mathoms default perl. So put back part of the original code before commit 1545ba5b04 from commit 3f1866a8f6, so that on with mathoms builds all "b"s are exported, but on no mathom builds, all "b"s are removed/not exported. There are some logic holes here for strange or impossible combinations of flags, like flags "Abi" or just "b" without "A", that I wont address here.
* fix -DNO_MATHOMS build, mathomed syms were not removed from perldll.defDaniel Dragan2018-04-151-2/+2
| | | | | | | | | | | | | | | | | | | Commit 3f1866a8f6 assumed "A" flag means a function can't be mathomed. Not true. Many funcs were listed in embed.fnc as "A" yet were in mathoms.c. This caused a missing symbol link failure on Win32 with -DNO_MATHOMS, since the "A" mathomed funcs were now put into perlldll.def while previously they were parsed out of mathoms.c by makedef.pl. Revise the logic so "b" means instant removal from the export list on a no mathoms build. embed.fnc "b" flag adds were generated from a missing symbol list from my linker, some funcs not in my build/platform config might need to be "b" flagged in future. Some funcs like ASCII_TO_NEED were already marked "b" but still being by mistake exported because they were also "A". sv_2bool, sv_eq and sv_collxfrm also needed a "p" flag or a Perl_-less symbol was declared in proto.h. sv_2bool and sv_collxfrm also failed porting/args_assert.t so add those macros to mathoms.c
* Fix locale problems on mingwKarl Williamson2018-03-191-4/+30
| | | | | | | | | | | | | | | | Various symbols get exported (or not) by makedef.pl. The determination of some of the new ones is fairly complex in perl.h, and unfortunately in general the code logic to do so must be copied into makedef.pl (until a volunteer fixes this). I thought I could avoid a bunch of this by using the symbol ${^SAFE_LOCALES} which in fact was created so that programs wouldn't have to know about this complexity. The problem is that on Windows, miniperl is always compiled single-thread and so locales are always safe, and so makedef.pl (which is called by miniperl) got the wrong information. The solution, unfortunately, is to reproduce the complexity in makedef.pl Spotted by Daniel Dragan.
* Don't include interpreter variable unless usedKarl Williamson2018-03-161-0/+2
| | | | | | | This adds an #ifdef around this variable, so that it isn't defined unless used. Spotted by Daniel Dragan.
* Work around Microsoft threaded locale bug for localeconv()Karl Williamson2018-03-121-2/+4
| | | | | | | | | | | | Prior to Visual Studio 2015, the localeconv() function only looks at the global locale, not the per-thread one it should. This works around this by creating critical sections, switching to the global locale to call localeconv(), then switching back. For the most common usage, it avoids the switch by parsing a string it generates that should contain the desired substring. This leaves the switch required for retrieving the floating point grouping separator and the currency string, plus POSIX::localeconv(). The first two could be avoided by extra code as detailed in the pod for switch_to_global_locale(); patches welcome!
* Resync duplicated code in perl.h makedef.plKarl Williamson2018-03-121-1/+1
| | | | These had gotten out of sync
* Don't create locale object unless threadedKarl Williamson2018-03-121-0/+1
| | | | | | PL_C_locale_obj is now only created on threaded builds on systems with POSIX 2008. On unthreaded builds, we really should continue to use the old tried and true library calls.
* Don't create unneeded mutexesKarl Williamson2018-03-121-0/+5
| | | | These mutexes are needed only for unsafe threaded-locale operations.
* Add thread-safe locale handlingKarl Williamson2018-02-181-0/+1
| | | | | | This (large) commit allows locales to be used in threaded perls on platforms that support it. This includes recent Windows and Posix 2008 ones.
* Latch LC_NUMERIC during critical sectionsKarl Williamson2018-02-181-0/+1
| | | | | | | | | | | | | | It is possible for operations on threaded perls which don't 'use locale' to still change the locale. This happens when calling POSIX::localeconv() and I18N::Langinfo(), and in earlier perls, it can happen for other operations when perl has been initialized with the environment causing the various locale categories to not have a uniform locale. This commit causes the areas where the locale for this category should predictably be in one or the other state to be a critical section where another thread can't interrupt and change it. This is a separate mutex, so that only these particular operations will be held up.
* makedef.pl: Use all #ifdefs to decideKarl Williamson2018-02-181-1/+4
| | | | | | | | | | | | This uses all the conditions that go in to deciding to define this variable, instead of taking a shortcut. (It's unfortunate that the shortcut defined in perl.h now used elsewhere via commit 7e5377f714ebe84e0fe2599b3bfec50036f0d18f is not available to makedef.pl. It would make sense to have this file look at perl.h and avoid duplication). This fixes some freebsd builds, which failed because their hints file undef'd a different variable than this shortuct looked at.
* Don't export PL_underlying_numeric_obj if it doesn't exist.Craig A. Berry2018-02-101-0/+1
| | | | | This broke the build on VMS and probably would on anything else with strict linking where HAS_NEW_LOCALE is not defined.
* teach makedef.pl about PL_keyword_plugin_mutexLukas Mai2017-11-111-0/+1
| | | | This fixes t/porting/globvar.t.
* Don't link in Perl_my_strnlen when we don't have it.Craig A. Berry2017-10-261-0/+5
|
* Rely on C89 sprintf() return value semanticsAaron Crane2017-10-211-5/+0
|
* Initialize locale object even in unthreaded perlsKarl Williamson2017-08-121-2/+1
| | | | | | | This commit will now initialize the thread-safe C locale object if the POSIX 2008 functions are available, regardless of whether the perl is threaded or not. This will allow for a future commit that uses them, and which is a win on unthreaded builds.
* Make immortal SVs contiguousDavid Mitchell2017-07-271-0/+4
| | | | | | | | | | | | | | | | | | | Ensure that PL_sv_yes, PL_sv_undef, PL_sv_no and PL_sv_zero are allocated adjacently in memory. This allows the SvIMMORTAL() test to be more efficient, and will (in the next commit) allow SvTRUE() to be more efficient. In MULTIPLICITY builds the constraint is already met by virtue of them being adjacent items in the interpreter struct. For non-MULTIPLICITY builds, they were just 4 global vars with no guarantees of where they would be allocated. For this case, PL_sv_undef are deleted as global vars and replaced with a new global var PL_sv_immortals[4], with #define PL_sv_yes (PL_sv_immortals[0]) etc in their place.
* Fix Windows build following commit 9d5e3f1aaaSteve Hay2017-06-071-0/+3
|
* Switch most open() calls to three-argument form.John Lightsey2016-12-231-1/+1
| | | | | | | | | | 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