| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
The build has been broken since 2009.
|
|
|
|
|
|
|
|
|
| |
`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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
| |
Co-authored-by: Karl Williamson <khw@cpan.org>
|
|
|
|
| |
These were only ever needed by Symbian.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Only THREAD_RET_TYPE is still used.
|
|
|
|
|
| |
Mostly in comments and docs, but some in diagnostic messages and one
case of 'or die die'.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Remove WinCE support as agreed in the thread starting here:
https://www.nntp.perl.org/group/perl.perl5.porters/2018/07/msg251683.html
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
This will be used in future commits
|
|
|
|
| |
We shouldn't export non-existent variables
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]
|
|
|
|
|
| |
Several problems with this compile option were not caught before 5.28
was frozen.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
This adds an #ifdef around this variable, so that it isn't defined
unless used.
Spotted by Daniel Dragan.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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!
|
|
|
|
| |
These had gotten out of sync
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
These mutexes are needed only for unsafe threaded-locale operations.
|
|
|
|
|
|
| |
This (large) commit allows locales to be used in threaded perls on
platforms that support it. This includes recent Windows and Posix 2008
ones.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
This broke the build on VMS and probably would on anything else
with strict linking where HAS_NEW_LOCALE is not defined.
|
|
|
|
| |
This fixes t/porting/globvar.t.
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|