summaryrefslogtreecommitdiff
path: root/makedef.pl
Commit message (Collapse)AuthorAgeFilesLines
* Further eliminate POSIX-emulation under LinuxThreadsÆvar Arnfjörð Bjarmason2012-02-151-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* handle conditional definition of PL_check_mutexZefram2012-02-111-0/+1
| | | | | PL_check_mutex only exists on threading builds, so makedef.pl needs to know about that conditionality to produce correct export lists.
* Export PerlIOBase_openLeon Timmermans2011-12-291-0/+1
|
* On AIX, avoid a shell pipepline by making makedef.pl sort case insenitively.Nicholas Clark2011-12-041-1/+6
| | | | | | | | 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
* skip Perl_my_symlink symbol on older VMS systems.Craig A. Berry2011-12-021-0/+3
| | | | | | 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.
* The Borland Chainsaw MassacreSteve Hay2011-09-101-5/+1
| | | | | 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
* Eliminate global.sym, as makedef.pl can generate it internally.Nicholas Clark2011-08-251-2/+26
| | | | | | | | 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.
* In makedef.pl, move handling of $ARGS{TARG_DIR} to the open statements.Nicholas Clark2011-08-251-18/+12
| | | | | This simplifies the code, and eliminates 5 lexicals used solely to hold filename constants.
* In makedef.pl, defaulting $ARGS{TARG_DIR} to '' simplifies the code.Nicholas Clark2011-08-251-5/+3
|
* In makedef.pl, no need to store 'config.h' in a variable.Nicholas Clark2011-08-251-2/+1
| | | | | 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.
* Add t/porting/globvar.t, to sanity test globvar.sym on a *nix platform.Nicholas Clark2011-08-231-3/+4
| | | | | | | 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.
* Handle PL_sh_path better in globvar.sym and makedef.plNicholas Clark2011-08-231-0/+3
| | | | | | | 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.
* In makedef.pl, use %Config to avoid hardcoding the DLL version number.Nicholas Clark2011-08-131-2/+3
|
* Simplify embedvar.h, removing a level of macro indirection for PL_* variables.Nicholas Clark2011-08-111-1/+1
| | | | | | | 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.
* Add the correct PL_sig_ignoring skip for VMS in makedef.pl.Craig A. Berry2011-08-021-0/+5
| | | | | | | | | | | | | | | | | | 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).
* In makedef.pl, refactor the code that reads *.sym files.Nicholas Clark2011-08-011-9/+7
| | | | | | 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.
* In makedef.pl, correct a typo in a comment.Nicholas Clark2011-08-011-1/+1
|
* In makedef.pl, avoid creating %PLATFORMS just for one existence check.Nicholas Clark2011-08-011-8/+10
| | | | | | | | 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.
* In makedef.pl, use %ARGS instead of 4 variables for command line arguments.Nicholas Clark2011-08-011-44/+43
| | | | This simplifies processing @ARGV.
* In makedef.pl, consolidate all the C compiler flags parsing code.Nicholas Clark2011-08-011-12/+10
| | | | | | | | | 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
* In makedef.pl, read ccflags and optimize from %Config.Nicholas Clark2011-08-011-18/+10
| | | | | Previously they were read by opening and parsing config.sh. Remove all code related to reading config.sh, as it is no longer needed.
* In makedef.pl, read 4 configuration values direct from %Config.Nicholas Clark2011-08-011-6/+4
| | | | | | 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.
* In makedef.pl, merge the code that reads config.shNicholas Clark2011-08-011-11/+8
| | | | | For now, retain compatibility (bug compatibility?) by not processing ccflags and optimize on Win32, WinCE and NetWare.
* In makedef.pl, export boot_* for static modules only on Win32 and WinCE.Nicholas Clark2011-08-011-5/+17
| | | | | | | | | 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.
* In makedef.pl, tidy up the MYMALLOC logic.Nicholas Clark2011-08-011-7/+2
| | | | | | 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.
* In makedef.pl, tidy up the USE_PERLIO logic.Nicholas Clark2011-08-011-9/+3
| | | | | | | | | | | | | | | | 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.
* In makedef.pl, consolidate all the code that tries platform-specific symbols.Nicholas Clark2011-08-011-164/+169
| | | | | | | | | 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.
* In makedef.pl, remove duplicate symbols passed to try_symbols() for OS/2.Nicholas Clark2011-08-011-7/+0
| | | | | | | | | | | 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.)
* In makedef.pl, replace calls to try_symbol() with try_symbols().Nicholas Clark2011-08-011-25/+9
| | | | | Following the simplification of the previous commit, the two are now equivalent.
* In makedef.pl, change readvar() to add items to a passed-in hash reference.Nicholas Clark2011-08-011-25/+30
| | | | | | | | | | | 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().
* In makedef.pl, no need to loop over a 1 item list.Nicholas Clark2011-08-011-3/+1
|
* In makedef.pl, inline output_symbol() into its only caller.Nicholas Clark2011-08-011-43/+16
| | | | | Remove code commented out by commit 51371543ca1a75ed in 1999 with the note "binary compatibility between compilers is an exercise in frustration".
* In makedef.pl, consolidate the actual output code in one place.Nicholas Clark2011-08-011-48/+59
| | | | | | 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.
* In makedef.pl, rename emit_symbols() to try_symbols(), and pass it a list.Nicholas Clark2011-08-011-24/+23
| | | | | try_symbols() better describes what it does - add symbols to the list to export, unless they are in the skip list.
* In makedef.pl, inline emit_symbol.Nicholas Clark2011-08-011-10/+4
| | | | | All emit_symbol() did was add to the hash of symbols to emit the list it was passed.
* In makedef.pl, eliminate now-superfluous chomp and file-content processing.Nicholas Clark2011-08-011-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* In makedef.pl, inline skip_symbols.Nicholas Clark2011-08-011-118/+72
| | | | | All skip_symbols() did was add to the hash of symbols to skip the list it was passed.
* In makedef.pl, readvar now returns a list, not an array reference.Nicholas Clark2011-08-011-20/+10
| | | | | 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.
* In makedef.pl, move the "oddities from PerlIO" from <DATA> to a data structure.Nicholas Clark2011-08-011-17/+13
| | | | | | | 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>.
* In makedef.pl, consolidate all the code conditional on PERL_IMPLICIT_SYS.Nicholas Clark2011-08-011-19/+4
| | | | | | | | | 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.
* In makedef.pl, NetWare can't export perl_clone_host without USE_ITHREADS.Nicholas Clark2011-08-011-2/+4
| | | | | | 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'
* In makedef.pl, read Config::{,non_}bincompat_options() on all platforms.Nicholas Clark2011-08-011-19/+12
| | | | | | | | | | 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
* In makedef.pl, remove the skip for Perl_pidgone for not-PERL_USES_PL_PIDSTATUS.Nicholas Clark2011-08-011-1/+0
| | | | | | 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).
* In makedef.pl, remove the skip for Perl_mro_meta_dup for non-ITHREADS.Nicholas Clark2011-08-011-1/+0
| | | | | | 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.
* In makedef.pl, remove Perl_malloc{ed,_good}_size from the !MYMALLOC skip list.Nicholas Clark2011-08-011-2/+0
| | | | | | | 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
* In makedef.pl, remove 15 non-API functions from the not-PERLMAD skip list.Nicholas Clark2011-08-011-15/+0
| | | | | | 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.
* In makedef.pl, remove the skip for Perl_deb_growlevel for not-DEBUGGING.Nicholas Clark2011-08-011-1/+0
| | | | Perl_deb_growlevel was removed in 199 by commit f4c556ac9d141bf8.
* In makedef.pl, remove the skip for PL_sig_sv for PERL_IMPLICIT_CONTEXT.Nicholas Clark2011-08-011-6/+0
| | | | PL_sig_sv was removed in 2010 by commit 0c4d3b5ea916cf64.
* In makedef.pl, remove the skip for 9 symbols for not-USE_ITHREADSNicholas Clark2011-08-011-9/+0
| | | | | They were moved into the XS for threads::shared in 2002 by commit 68795e9367de9848.
* In makedef.pl, remove the skip for PL_regdupe for not-USE_ITHREADS.Nicholas Clark2011-08-011-1/+0
| | | | PL_regdupe was removed in 2006 by commit f9f4320a413e57e4.