| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Under POSIX threads the getpid() and getppid() functions return the
same values across multiple threads, i.e. threads don't have their own
PID's. This is not the case under the obsolete LinuxThreads where each
thread has a different PID, so getpid() and getppid() will return
different values across threads.
Ever since the first perl 5.0 we've returned POSIX-consistent
semantics for $$, until v5.14.0-251-g0e21945 when the getpid() cache
was removed. In 5.8.1 Rafael added further explicit POSIX emulation in
perl-5.8.0-133-g4d76a34 [1] by explicitly caching getppid(), so that
multiple threads would always return the same value.
I don't think all this effort to emulate POSIX sematics is worth it. I
think $$ and getppid() are OS-level functions that should always
return the same as their C equivalents. I shouldn't have to use a
module like Linux::Pid to get the OS version of the return values.
This is pretty much a complete non-issue in practice these days,
LinuxThreads was a Linux 2.4 thread implementation that nobody
maintains anymore[2], all modern Linux distros use NPTL threads which
don't suffer from this discrepancy. Debian GNU/kFreeBSD does use
LinuxThreads in the 6.0 release, but they too will be moving away from
it in future releases, and really, nobody uses Debian GNU/kFreeBSD
anyway.
This caching makes it unnecessarily tedious to fork an embedded Perl
interpreter. When someone that constructs an embedded perl interpreter
and forks their application, the fork(2) system call isn't going to
run Perl_pp_fork(), and thus the return value of $$ and getppid()
doesn't reflect the current process. See [3] for a bug in uWSGI
related to this, and Perl::AfterFork on the CPAN for XS code that you
need to run after forking a PerlInterpreter unbeknownst to perl.
We've already been failing the tests in t/op/getpid.t on these Linux
systems that nobody apparently uses, the Debian GNU/kFreeBSD users did
notice and filed #96270, this patch fixes that failure by changing the
tests to test for different behavior under LinuxThreads, I've tested
that this works on my Debian GNU/kFreeBSD 6.0.4 virtual machine.
If this change is found to be unacceptable (i.e. we want to continue
to emulate POSIX thread semantics for the sake of LinuxThreads) we
also need to revert v5.14.0-251-g0e21945, because currently we're only
emulating POSIX semantics for getppid(), not getpid(). But I don't
think we should do that, both v5.14.0-251-g0e21945 and this commit are
awesome.
This commit includes a change to embedvar.h made by "make
regen_headers".
1. http://www.nntp.perl.org/group/perl.perl5.porters/2002/08/msg64603.html
2. http://pauillac.inria.fr/~xleroy/linuxthreads/
3. http://projects.unbit.it/uwsgi/ticket/85
|
|
|
|
|
| |
PL_check_mutex only exists on threading builds, so makedef.pl needs to
know about that conditionality to produce correct export lists.
|
| |
|
|
|
|
|
|
|
|
| |
Previously the Makefile piped the output of makedef.pl to sort. This had the
side effect of ignoring the exit code from makedef.pl, as make could only
see the exit code of the last command in the pipeline. This concealed the
causes of the parallel make failure when makedef.pl was missing a dependency
on Config.pm
|
|
|
|
|
|
| |
It's a wrapper for cases where we have symlink, not a replacement
for cases where we don't (pre-v8.3). Trying to include it on
older systems causes a link error.
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
global.sym was a file listing the exported symbols, generated by regen/embed.pl
from embed.fnc and regen/opcodes, which was only used by makedef.pl
Move the code that generates global.sym from regen/embed.pl to makedef.pl,
and thereby eliminate the need to ship a 907 line generated file.
|
|
|
|
|
| |
This simplifies the code, and eliminates 5 lexicals used solely to hold
filename constants.
|
| |
|
|
|
|
|
| |
Unlike the other files opened by makedef.pl, config.h is always opened in the
current directory, so the filename doesn't modifying if $ARGS{TARG_DIR} is set.
|
|
|
|
|
|
|
| |
This adds to makedef.pl a new platform, "test".
Hopefully this change will catch most problems that previously had resulted
in build failures on Win32.
|
|
|
|
|
|
|
| |
PL_sh_path needs some form of special case because it is conditionally
defined either in perlvar.h or perl.h, but globvar.sym mentions all symbols
unconditionally, and undef -DPERL_GLOBAL_STRUCT perlvar.h is parsed as an
unconditional skip list.
|
| |
|
|
|
|
|
|
|
| |
For the default (non-multiplicity) configuration, PERLVAR*() macros now
directly expand their arguments to tokens such as C<PL_defgv>, instead of
expanding to C<PL_Idefgv>. This removes over 350 lines from F<embedvar.h>,
which defined macros to map from C<PL_Idefgv> to C<PL_defgv> and so forth.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This only exists when FAKE_PERSISTENT_SIGNAL_HANDLERS is defined,
and that's only defined when HAS_SIGACTION is false.
The problem was exposed by ed76ea85d1, which fixed a typo introduced
in aadb217dbe, but that typo introduced code that was a noop on all
platforms, including VMS, where $^O is 'VMS', not 'vms'.
TODO: The existence of PL_sig_defaulting and PL_sig_handlers_initted
depends on the definedness of FAKE_DEFAULT_SIGNAL_HANDLERS, which
depends on KILL_BY_SIGPRC, which is written directly to config.h
without being recorded in config.sh and is thus not visible in Config.
So there's no good way to know when these symbols should be skipped.
KILL_BY_SIGPRC currently gets defined on all VMS versions and platforms,
so it's a breakage-in-waiting but does not actually fall down (yet).
|
|
|
|
|
|
| |
Hoist the test that chooses the prefix out of the loop. Tweak the regex to
avoid needing an explicit chomp/ Use 3-arg open and a lexical for the file
handle.
|
| |
|
|
|
|
|
|
|
|
| |
A single linear search of @PLATFORMS is simpler and possibly even faster
than building a hash from @PLATFORMS, making one lookup, then discarding the
hash.
Add a block to limit the scope of @PLATFORMS to the code that uses it.
|
|
|
|
| |
This simplifies processing @ARGV.
|
|
|
|
|
|
|
|
|
| |
This isn't quite a "pure" refactoring, as -Dfoo=bar read from %Config will
now be processed as $Config{foo} = 'bar'; instead of $Config{foo} = 1;
However, it won't change any behaviour, as the only time makedef.pl uses a
value of %define for anything other than a truth test is $define{PERL_DLL},
and that is passed in on the command-line by the Makefile invoking
makedef.pl
|
|
|
|
|
| |
Previously they were read by opening and parsing config.sh. Remove all code
related to reading config.sh, as it is no longer needed.
|
|
|
|
|
|
| |
makedef.pl has been using Config since commit 9d6c7f2eccef26a6 in 2009.
Hence we can read them direct from %Config, instead of parsing config.sh
and storing the values in %define.
|
|
|
|
|
| |
For now, retain compatibility (bug compatibility?) by not processing ccflags
and optimize on Win32, WinCE and NetWare.
|
|
|
|
|
|
|
|
|
| |
The code as-is will only be run on Win32 and WinCE, because currently the
code to populate $static_ext is only run on Win32 and WinCE. As-is this code
can't be run on all platforms, because currently *nix (ie AIX) links static
extensions into the perl executable, rather than into the shared perl
library. Hence boot_* functions for static extensions aren't in the shared
perl library, so it would be an error to attempt to export them from it.
|
|
|
|
|
|
| |
No need to call try_symbols() for PL_malloc_mutex, as it is found in
perlvars.h. Unlike PL_perlio_mutex, PL_malloc_mutex isn't listed in the
main !USE_ITHREADS skip list - perhaps it should be for consistency.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
No need to call try_symbols() for PL_perlio_mutex, as it is found in
perlvars.h, and no need to duplicate the skip for it if USE_ITHREADS is not
defined.
We do need to skip PL_perlio_mutex if if USE_PERLIO is not defined but
USE_ITHREADS is [not that this is a configuration that Configure will let
you select, until you edit it :-)]
Add a comment describing what the "Oddities from PerlIO" are.
Remove PerlIO_sv_dup from the list, as it's also in @layer_syms, and
inclusion in @layer_syms makes the former redundant. It was added to both in
commit 8437356be6fd345c in 2001.
|
|
|
|
|
|
|
|
|
| |
Previously the code for OS/2 and VMS was run much earlier. Fortunately none
of the symbols tried were conditionally added to the skip list, else much
confusion would have ensued.
Move the OS/2 code that reads miniperl.map after the code that tries
platform-specific symbols.
|
|
|
|
|
|
|
|
|
|
|
| |
Code to try the 4 thread-specific symbols was added in 2003 by commit
5c728af092d5feba. However, all 4 symbols were already listed in makedef.pl,
added in 1999 by commit 3cfae81b38bc8edd.
(Unlike other platforms, on OS/2 adding symbols to %export that aren't
actually compiled in does not cause errors, as there is code later in
makedef.pl to read in miniperl.map, and strip from %export all symbols not
listed there.)
|
|
|
|
|
| |
Following the simplification of the previous commit, the two are now
equivalent.
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, readvar() returned a list of symbols, extracting the names of
the variables declared there, then transforming them either via a passed in
function, or prepending 'PL_'. The list was then either added to %skip, or
added to %export by try_symbols(), which had a kludge to normalise the
previous transformation to 'PL_'.
Instead, passing a reference to the target hash into readvar() allows that
kludge to be removed, considerably simplifying try_symbols().
|
| |
|
|
|
|
|
| |
Remove code commented out by commit 51371543ca1a75ed in 1999 with the note
"binary compatibility between compilers is an exercise in frustration".
|
|
|
|
|
|
| |
Previously, the platform specific header output code was near the top of
makedef.pl, before some of the emit/skip logic and some of the file reading
code, and far from the rest of the output logic.
|
|
|
|
|
| |
try_symbols() better describes what it does - add symbols to the list to
export, unless they are in the skip list.
|
|
|
|
|
| |
All emit_symbol() did was add to the hash of symbols to emit the list it was
passed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
emit_symbol() would chomp every symbol passed to it. The chomp was added in
3e3baf6d63945cb6, in the refactoring which replaced print statements with
emit_symbol(), because its callers (still) passed it the values previously
printed, values generated from the lines of files. The chomp in emit_symbol()
probably should have been removed as part of 22239a37ce131e4f, which unified
the code that parsed external files, adding chomp there, and added chomp to
the code which read from <DATA>.
The chomp of <DATA> added in 22239a37ce131e4f was moved wholesale with all
the file-content specific processing into a new routine try_symbol() in
commit 549a6b102c2ac8c4 on the cfgperl branch. That commit and subsequent
commits used try_symbol() as the general-purpose routine to add symbols to
the export list, even though it also had all the specific file processing
code to ignore comments and other text that did not look like symbols.
An analogous alternative routine to add symbols to the export list,
emit_symbols(), was added to blead 6 days earlier in commit 51371543ca1a75ed.
As makedef.pl no longer uses <DATA>, and reading from external files is
nicely encapsulated, all this vestigial code can be removed.
Technical debt from 1997 and 1999 finally being eliminated.
|
|
|
|
|
| |
All skip_symbols() did was add to the hash of symbols to skip the list it was
passed.
|
|
|
|
|
| |
Convert it from a loop to a map. Refactor its callers to use its results
directly, instead of assigning to a lexical variable which is used only once.
|
|
|
|
|
|
|
| |
At one time various categories of symbols were listed after __DATA__.
All others are now dealt with elsewhere, leaving only some PerlIO symbols, at
which point it becomes clearer and terser to move the list to the point in the
code that previously looped over <DATA>.
|
|
|
|
|
|
|
|
|
| |
Previously the conditional skips were for all platforms (in two places, both
added in commit 7766f1371a6d2b58, whereas the conditional additions to the
export lists were in platform specific blocks for Win32, WinCE and NetWare.
Given that only those 3 platforms can (currently) build with
-DPERL_IMPLICIT_SYS, it's safe to implicitly remove the platform check for
those export additions by moving the code.
|
|
|
|
|
|
| |
NetWare/nw5.c conditionally compiles perl_clone_host only if USE_ITHREADS is
defined. It can't be added to the export list if it isn't compiled.
NetWare/config.wc has useithreads='define'
|
|
|
|
|
|
|
|
|
|
| |
Previously makedef.pl was only taking them into account on AIX, Win32 and
WinCE. This might cause more API symbols to be exported on NetWare, OS/2
and VMS.
On VMS, $define{DEBUGGING} and $define{UNLINK_ALL_VERSIONS} will now be read
from Config::non_bincompat_options(), so no need for special case code to
read them config.sh
|
|
|
|
|
|
| |
The skip for Perl_pidgone was added by 0c25f67f45e5dccb in 2005, However,
Perl_pidgone was never in the public API, and has not been available for
export since commit 954c1994944eafa7 (in January 2000).
|
|
|
|
|
|
| |
Perl_mro_meta_dup was removed from the public API with commit
47c9dd1447a52d20 in April 2007, and hence was never in the API for any stable
release.
|
|
|
|
|
|
|
| |
Perl_malloced_size was never in the public API, has not been available for
export since commit 954c1994944eafa7 (in January 2000) restricted exports to
just API functions. Perl_malloc_good_size was added to the skip list with
commit 641071807211a396, which added the (non-API) function to malloc.c
|
|
|
|
|
|
| |
These functions have never been exported, so never needed to be added to the
skip list in makedef.pl. Perl_pad_peg was added in 1dba731d9f7b0a03, the
remainder in 3b721df9bf246129.
|
|
|
|
| |
Perl_deb_growlevel was removed in 199 by commit f4c556ac9d141bf8.
|
|
|
|
| |
PL_sig_sv was removed in 2010 by commit 0c4d3b5ea916cf64.
|
|
|
|
|
| |
They were moved into the XS for threads::shared in 2002 by commit
68795e9367de9848.
|
|
|
|
| |
PL_regdupe was removed in 2006 by commit f9f4320a413e57e4.
|