X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=README.os2;h=8cc0ec7d406194945ea34c0d1350345aa69c500e;hb=47c8db80932508b6333745f2c283d5a98bf9cccb;hp=fbc2731a48befde02fd25d90322fc575d3e5f9f1;hpb=3998488b5c82faefba0d461b717a52c586e148b7;p=p5sagit%2Fp5-mst-13.2.git diff --git a/README.os2 b/README.os2 index fbc2731..8cc0ec7 100644 --- a/README.os2 +++ b/README.os2 @@ -262,7 +262,7 @@ same way as on any other platform, by perl foo.pl arg1 arg2 arg3 If you want to specify perl options C<-my_opts> to the perl itself (as -opposed to to your program), use +opposed to your program), use perl -my_opts foo.pl arg1 arg2 arg3 @@ -386,7 +386,7 @@ there is an executable file F I on C. Note also that executable files on OS/2 can have an arbitrary extension, but F<.exe> will be automatically appended if no dot is present in the name. -The workaround as as simple as that: since F and F denote the +The workaround is as simple as that: since F and F denote the same file, to start an executable residing in file F (no extension) give an argument C (dot appended) to system(). @@ -733,7 +733,7 @@ Users of Emacs would appreciate it very much, especially with C mode loaded. You need to get latest C from C, or, alternately, prebuilt info pages. -=head2 F<.PDF> files +=head2 F files for C are available on CPAN (for slightly old version of perl). @@ -829,8 +829,8 @@ link386 prompts, press C to exit. You need to fetch the latest perl source (including developers releases). With some probability it is located in - http://www.perl.com/CPAN/src/5.0 - http://www.perl.com/CPAN/src/5.0/unsupported + http://www.cpan.org/src/5.0 + http://www.cpan.org/src/5.0/unsupported If not, you may need to dig in the indices to find it in the directory of the current maintainer. @@ -838,7 +838,7 @@ of the current maintainer. Quick cycle of developers release may break the OS/2 build time to time, looking into - http://www.perl.com/CPAN/ports/os2/ilyaz/ + http://www.cpan.org/ports/os2/ilyaz/ may indicate the latest release which was publicly released by the maintainer. Note that the release may include some additional patches @@ -1053,8 +1053,11 @@ Note that these functions are compatible with *nix, not with the older ports of '94 - 95. The priorities are absolute, go from 32 to -95, lower is quicker. 0 is the default priority. -B. Calling C on a non-existing process can lock the -system before Warp3 fixpak22. +B. Calling C on a non-existing process could lock +the system before Warp3 fixpak22. Starting with Warp3, Perl will use +a workaround: it aborts getpriority() if the process is not present. +This is not possible on older versions C<2.*>, and has a race +condition anyway. =head2 C @@ -1063,7 +1066,8 @@ argument. The meaning of this argument is described in L. When finding a program to run, Perl first asks the OS to look for executables -on C. If not found, it looks for a script with possible extensions +on C (OS/2 adds extension F<.exe> if no extension is present). +If not found, it looks for a script with possible extensions added in this order: no extension, F<.cmd>, F<.btm>, F<.bat>, F<.pl>. If found, Perl checks the start of the file for magic strings C<"#!"> and C<"extproc ">. If found, Perl uses the rest of the @@ -1077,8 +1081,7 @@ F with the first line being extproc /bin/bash -x -c -If F is not found, and appending of executable extensions to -F does not help either, then Perl looks for an executable F on +If F is not found, then Perl looks for an executable F on C. If found in F, then the above system() is translated to @@ -1098,6 +1101,11 @@ If Perl finds that the found executable is of different type than the current session, it will start the new process in a separate session of necessary type. Call via C to disable this magic. +B. Due to the described logic, you need to explicitly +specify F<.com> extension if needed. Moreover, if the executable +F is requested, Perl will not look for F. +[This may change in the future.] + =head2 C on the first line If the first chars of a Perl script are C<"extproc ">, this line is treated @@ -1177,7 +1185,7 @@ C. Returns C if it was not called yet, otherwise bit 1 is set if on the previous call do_harderror was enabled, bit -2 is set if if on previous call do_exception was enabled. +2 is set if on previous call do_exception was enabled. This function enables/disables error popups associated with hardware errors (Disk not ready etc.) and software exceptions. @@ -1631,7 +1639,7 @@ of the F<.EXE> file are loaded is decided at compile-time, thus all the processes have these sections loaded at same addresses, and no fixup of internal links inside the F<.EXE> is needed. -Since DLLs may be loaded at run time, to have the same mechanism for for DLLs +Since DLLs may be loaded at run time, to have the same mechanism for DLLs one needs to have the address range of I DLLs in the system to be available I which did not load a particular DLL yet. This is why the DLLs are mapped to the shared memory region. @@ -1748,7 +1756,7 @@ Here we list major changes which could make you by surprise. C and C are not compatible with earlier ports by Andreas Kaiser. See C<"setpriority, getpriority">. -=head2 DLL name mangling +=head2 DLL name mangling: pre 5.6.2 With the release 5.003_01 the dynamically loadable libraries should be rebuilt when a different version of Perl is compiled. In particular, @@ -1782,6 +1790,136 @@ F to the "new" F. =back +=head2 DLL name mangling: 5.6.2 and beyond + +In fact mangling of I DLLs was done due to misunderstanding +of the OS/2 dynaloading model. OS/2 (effectively) maintains two +different tables of loaded DLL: + +=over + +=item Global DLLs + +those loaded by the base name from C; including those +associated at link time; + +=item specific DLLs + +loaded by the full name. + +=back + +When resolving a request for a global DLL, the table of already-loaded +specific DLLs is (effectively) ignored; moreover, specific DLLs are +I loaded from the prescribed path. + +There is/was a minor twist which makes this scheme fragile: what to do +with DLLs loaded from + +=over + +=item C and C + +(which depend on the process) + +=item F<.> from C + +which I depends on the process (although C is the +same for all the processes). + +=back + +Unless C is set to C (and the kernel is after +2000/09/01), such DLLs are considered to be global. When loading a +global DLL it is first looked in the table of already-loaded global +DLLs. Because of this the fact that one executable loaded a DLL from +C and C, or F<.> from C may affect +I DLL is loaded when I executable requests a DLL with +the same name. I is the reason for version-specific mangling of +the DLL name for perl DLL. + +Since the Perl extension DLLs are always loaded with the full path, +there is no need to mangle their names in a version-specific ways: +their directory already reflects the corresponding version of perl, +and @INC takes into account binary compatibility with older version. +Starting from C<5.6.2> the name mangling scheme is fixed to be the +same as for Perl 5.005_53 (same as in a popular binary release). Thus +new Perls will be able to I of old extension DLLs +if @INC allows finding their directories. + +However, this still does not guarantee that these DLL may be loaded. +The reason is the mangling of the name of the I. And since +the extension DLLs link with the Perl DLL, extension DLLs for older +versions would load an older Perl DLL, and would most probably +segfault (since the data in this DLL is not properly initialized). + +There is a partial workaround (which can be made complete with newer +OS/2 kernels): create a forwarder DLL with the same name as the DLL of +the older version of Perl, which forwards the entry points to the +newer Perl's DLL. Make this DLL accessible on (say) the C of +the new Perl executable. When the new executable accesses old Perl's +extension DLLs, they would request the old Perl's DLL by name, get the +forwarder instead, so effectively will link with the currently running +(new) Perl DLL. + +This may break in two ways: + +=over + +=item * + +Old perl executable is started when a new executable is running has +loaded an extension compiled for the old executable (ouph!). In this +case the old executable will get a forwarder DLL instead of the old +perl DLL, so would link with the new perl DLL. While not directly +fatal, it will behave the same as new executable. This beats the whole +purpose of explicitly starting an old executable. + +=item * + +A new executable loads an extension compiled for the old executable +when an old perl executable is running. In this case the extension +will not pick up the forwarder - with fatal results. + +=back + +With support for C this may be circumvented - unless +one of DLLs is started from F<.> from C (I do not know +whether C affects this case). + +B. Unless newer kernels allow F<.> in C (older +do not), this mess cannot be completely cleaned. + + +B. C, C and C are +not environment variables, although F emulates them on C lines. From Perl they may be accessed by L and +L. + +=head2 DLL forwarder generation + +Assume that the old DLL is named F (as is one for +5.005_53), and the new version is 5.6.1. Create a file +F with + + LIBRARY 'perlE0AC' INITINSTANCE TERMINSTANCE + DESCRIPTION '@#perl5-porters@perl.org:5.006001#@ Perl module for 5.00553 -> Perl 5.6.1 forwarder' + CODE LOADONCALL + DATA LOADONCALL NONSHARED MULTIPLE + EXPORTS + +modifying the versions/names as needed. Run + + perl -wnle "next if 0../EXPORTS/; print qq( \"$1\") if /\"(\w+)\"/" perl5.def >lst + +in the Perl build directory (to make the DLL smaller replace perl5.def +with the definition file for the older version of Perl if present). + + cat perl5shim.def-leader lst >perl5shim.def + gcc -Zomf -Zdll -o perlE0AC.dll perl5shim.def -s -llibperl + +(ignore multiple C). + =head2 Threading As of release 5.003_01 perl is linked to multithreaded C RTL @@ -1902,6 +2040,11 @@ moved to per-thread structure, or serialized?) Note that these problems should not discourage experimenting, since they have a low probability of affecting small programs. +=head1 BUGS + +This description was not updated since 5.6.1, see F for +more info. + =cut OS/2 extensions