perlsolaris.pod

来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· POD 代码 · 共 691 行 · 第 1/2 页

POD
691
字号
 $ isainfo -v   # Ultra 30 in 64 bit mode 64-bit sparcv9 applications 32-bit sparc applicationsBy default, perl will be compiled as a 32-bit application.  Unlessyou want to allocate more than ~ 4GB of memory inside perl, or unlessyou need more than 255 open file descriptors, you probably don't needperl to be a 64-bit app.=head3 Large File SupportFor Solaris 2.6 and onwards, there are two different ways for 32-bitapplications to manipulate large files (files whose size is > 2GByte).(A 64-bit application automatically has largefile support built inby default.)First is the "transitional compilation environment", described inlfcompile64(5).  According to the man page, The transitional compilation  environment  exports  all  the explicit 64-bit functions (xxx64()) and types in addition to all the regular functions (xxx()) and types. Both xxx()  and xxx64()  functions  are  available to the program source.  A 32-bit application must use the xxx64() functions in  order to  access  large  files.  See the lf64(5) manual page for a complete listing of the 64-bit transitional interfaces.The transitional compilation environment is obtained with thefollowing compiler and linker flags: getconf LFS64_CFLAGS        -D_LARGEFILE64_SOURCE getconf LFS64_LDFLAG        # nothing special needed getconf LFS64_LIBS          # nothing special neededSecond is the "large file compilation environment", described inlfcompile(5).  According to the man page, Each interface named xxx() that needs to access 64-bit entities to  access  large  files maps to a xxx64() call in the resulting binary. All relevant data types are defined to  be of correct size (for example, off_t has a typedef definition for a 64-bit entity). An application compiled in this environment is able  to  use the  xxx()  source interfaces to access both large and small files, rather than having to explicitly utilize the  transitional xxx64()  interface  calls to access large files.Two exceptions are fseek() and ftell().  32-bit applications shoulduse fseeko(3C) and ftello(3C).  These will get automatically mappedto fseeko64() and ftello64().The large file compilation environment is obtained with getconf LFS_CFLAGS      -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 getconf LFS_LDFLAGS     # nothing special needed getconf LFS_LIBS        # nothing special neededBy default, perl uses the large file compilation environment andrelies on Solaris to do the underlying mapping of interfaces.=head3 Building an LP64 perlTo compile a 64-bit application on an UltraSparc with a recent Sun Compiler,you need to use the flag "-xarch=v9".  getconf(1) will tell you this, e.g. $ getconf -a | grep v9 XBS5_LP64_OFF64_CFLAGS:         -xarch=v9 XBS5_LP64_OFF64_LDFLAGS:        -xarch=v9 XBS5_LP64_OFF64_LINTFLAGS:      -xarch=v9 XBS5_LPBIG_OFFBIG_CFLAGS:       -xarch=v9 XBS5_LPBIG_OFFBIG_LDFLAGS:      -xarch=v9 XBS5_LPBIG_OFFBIG_LINTFLAGS:    -xarch=v9 _XBS5_LP64_OFF64_CFLAGS:        -xarch=v9 _XBS5_LP64_OFF64_LDFLAGS:       -xarch=v9 _XBS5_LP64_OFF64_LINTFLAGS:     -xarch=v9 _XBS5_LPBIG_OFFBIG_CFLAGS:      -xarch=v9 _XBS5_LPBIG_OFFBIG_LDFLAGS:     -xarch=v9 _XBS5_LPBIG_OFFBIG_LINTFLAGS:   -xarch=v9This flag is supported in Sun WorkShop Compilers 5.0 and onwards(now marketed under the name Forte) when used on Solaris 7 or later onUltraSparc systems.If you are using gcc, you would need to use -mcpu=v9 -m64 instead.  Thisoption is not yet supported as of gcc 2.95.2; from install/SPECIFICin that release: GCC version 2.95 is not able to compile code correctly for sparc64 targets. Users of the Linux kernel, at least, can use the sparc32 program to start up a new shell invocation with an environment that causes configure to recognize (via uname -a) the system as sparc-*-* instead.All this should be handled automatically by the hints file, ifrequested.=head3 Long Doubles.As of 5.8.1, long doubles are working if you use the Sun compilers(needed for additional math routines not included in libm).=head2 Threads in perl on Solaris.It is possible to build a threaded version of perl on Solaris.  The entireperl thread implementation is still experimental, however, so beware.=head2 Malloc Issues with perl on Solaris.Starting from perl 5.7.1 perl uses the Solaris malloc, since the perlmalloc breaks when dealing with more than 2GB of memory, and the Solarismalloc also seems to be faster.If you for some reason (such as binary backward compatibility) reallyneed to use perl's malloc, you can rebuild perl from the sourcesand Configure the build with  $ sh Configure -DusemymallocYou should not use perl's malloc if you are building with gcc.  Thereare reports of core dumps, especially in the PDL module.  The problemappears to go away under -DDEBUGGING, so it has been difficult totrack down.  Sun's compiler appears to be okay with or without perl'smalloc. [XXX further investigation is needed here.]=head1 MAKE PROBLEMS.=over 4=item Dynamic Loading Problems With GNU as and GNU ldIf you have problems with dynamic loading using gcc on SunOS orSolaris, and you are using GNU as and GNU ld, see the sectionL<"GNU as and GNU ld"> above.=item ld.so.1: ./perl: fatal: relocation error:If you get this message on SunOS or Solaris, and you're using gcc,it's probably the GNU as or GNU ld problem in the previous itemL<"GNU as and GNU ld">.=item dlopen: stub interception failedThe primary cause of the 'dlopen: stub interception failed' message isthat the LD_LIBRARY_PATH environment variable includes a directorywhich is a symlink to /usr/lib (such as /lib).  SeeL<"LD_LIBRARY_PATH"> above.=item #error "No DATAMODEL_NATIVE specified"This is a common error when trying to build perl on Solaris 2.6 with agcc installation from Solaris 2.5 or 2.5.1.  The Solaris header fileschanged, so you need to update your gcc installation.  You can eitherrerun the fixincludes script from gcc or take the opportunity toupdate your gcc installation.=item sh: ar: not foundThis is a message from your shell telling you that the command 'ar'was not found.  You need to check your PATH environment variable tomake sure that it includes the directory with the 'ar' command.  Thisis a common problem on Solaris, where 'ar' is in the /usr/ccs/bin/directory.=back=head1 MAKE TEST=head2 op/stat.t test 4 in Solarisop/stat.t test 4 may fail if you are on a tmpfs of some sort.Building in /tmp sometimes shows this behavior.  Thetest suite detects if you are building in /tmp, but it may not be ableto catch all tmpfs situations.=head2 nss_delete core dump from op/pwent or op/grentSee L<perlhpux/"nss_delete core dump from op/pwent or op/grent">.=head1 PREBUILT BINARIES OF PERL FOR SOLARIS.You can pick up prebuilt binaries for Solaris fromL<http://www.sunfreeware.com/>, L<http://www.blastwave.org>,ActiveState L<http://www.activestate.com/>, andL<http://www.perl.com/> under the Binaries list at the top of thepage.  There are probably other sources as well.  Please note thatthese sites are under the control of their respective owners, not theperl developers.=head1 RUNTIME ISSUES FOR PERL ON SOLARIS.=head2 Limits on Numbers of Open Files on Solaris.The stdio(3C) manpage notes that for LP32 applications, only 255files may be opened using fopen(), and only file descriptors 0through 255 can be used in a stream.  Since perl calls open() andthen fdopen(3C) with the resulting file descriptor, perl is limitedto 255 simultaneous open files, even if sysopen() is used.  If thisproves to be an insurmountable problem, you can compile perl as aLP64 application, see L<Building an LP64 perl> for details.  Notealso that the default resource limit for open file descriptors onSolaris is 255, so you will have to modify your ulimit or rctl(Solaris 9 onwards) appropriately.=head1 SOLARIS-SPECIFIC MODULES.See the modules under the Solaris:: and Sun::Solaris namespaces on CPAN,see L<http://www.cpan.org/modules/by-module/Solaris/> andL<http://www.cpan.org/modules/by-module/Sun/>.=head1 SOLARIS-SPECIFIC PROBLEMS WITH MODULES.=head2 Proc::ProcessTable on SolarisProc::ProcessTable does not compile on Solaris with perl5.6.0 and higherif you have LARGEFILES defined.  Since largefile support is thedefault in 5.6.0 and later, you have to take special steps to use thismodule.The problem is that various structures visible via procfs use off_t,and if you compile with largefile support these change from 32 bits to64 bits.  Thus what you get back from procfs doesn't match up withthe structures in perl, resulting in garbage.  See proc(4) for furtherdiscussion.A fix for Proc::ProcessTable is to edit Makefile toexplicitly remove the largefile flags from the ones MakeMaker picks upfrom Config.pm.  This will result in Proc::ProcessTable being builtunder the correct environment.  Everything should then be OK as long asProc::ProcessTable doesn't try to share off_t's with the rest of perl,or if it does they should be explicitly specified as off64_t.=head2 BSD::Resource on SolarisBSD::Resource versions earlier than 1.09 do not compile on Solariswith perl 5.6.0 and higher, for the same reasons as Proc::ProcessTable.BSD::Resource versions starting from 1.09 have a workaround for the problem.=head2 Net::SSLeay on SolarisNet::SSLeay requires a /dev/urandom to be present. This device isavailable from Solaris 9 onwards.  For earlier Solaris versions youcan either get the package SUNWski (packaged with several Sunsoftware products, for example the Sun WebServer, which is part ofthe Solaris Server Intranet Extension, or the Sun Directory Services,part of Solaris for ISPs) or download the ANDIrand package fromL<http://www.cosy.sbg.ac.at/~andi/>. If you use SUNWski, make asymbolic link /dev/urandom pointing to /dev/random.  For more details,see Document ID27606 entitled "Differing /dev/random support requirementswithin Solaris[TM] Operating Environments", available athttp://sunsolve.sun.com .It may be possible to use the Entropy Gathering Daemon (written inPerl!), available from L<http://www.lothar.com/tech/crypto/>.=head1 SunOS 4.xIn SunOS 4.x you most probably want to use the SunOS ld, /usr/bin/ld,since the more recent versions of GNU ld (like 2.13) do not seem towork for building Perl anymore.  When linking the extensions, theGNU ld gets very unhappy and spews a lot of errors like this  ... relocation truncated to fit: BASE13 ...and dies.  Therefore the SunOS 4.1 hints file explicitly sets theld to be /usr/bin/ld.As of Perl 5.8.1 the dynamic loading of libraries (DynaLoader, XSLoader)also seems to have become broken in in SunOS 4.x.  Therefore the defaultis to build Perl statically.Running the test suite in SunOS 4.1 is a bit tricky since theF<lib/Tie/File/t/09_gen_rs> test hangs (subtest #51, FWIW) for someunknown reason.  Just stop the test and kill that particular Perlprocess.There are various other failures, that as of SunOS 4.1.4 and gcc 3.2.2look a lot like gcc bugs.  Many of the failures happen in the Encodetests, where for example when the test expects "0" you get "&#48;"which should after a little squinting look very odd indeed.Another example is earlier in F<t/run/fresh_perl> where chr(0xff) isexpected but the test fails because the result is chr(0xff).  Exactly.This is the "make test" result from the said combination:  Failed 27 test scripts out of 745, 96.38% okay.Running the C<harness> is painful because of the many failingUnicode-related tests will output megabytes of failure messages,but if one patiently waits, one gets these results: Failed Test                     Stat Wstat Total Fail  Failed  List of Failed ----------------------------------------------------------------------------- ... ../ext/Encode/t/at-cn.t            4  1024    29    4  13.79%  14-17 ../ext/Encode/t/at-tw.t           10  2560    17   10  58.82%  2 4 6 8 10 12                                                                14-17 ../ext/Encode/t/enc_data.t        29  7424    ??   ??       %  ?? ../ext/Encode/t/enc_eucjp.t       29  7424    ??   ??       %  ?? ../ext/Encode/t/enc_module.t      29  7424    ??   ??       %  ?? ../ext/Encode/t/encoding.t        29  7424    ??   ??       %  ?? ../ext/Encode/t/grow.t            12  3072    24   12  50.00%  2 4 6 8 10 12 14                                                                16 18 20 22 24  Failed Test                     Stat Wstat Total Fail  Failed  List of Failed ------------------------------------------------------------------------------ ../ext/Encode/t/guess.t          255 65280    29   40 137.93%  10-29 ../ext/Encode/t/jperl.t           29  7424    15   30 200.00%  1-15 ../ext/Encode/t/mime-header.t      2   512    10    2  20.00%  2-3 ../ext/Encode/t/perlio.t          22  5632    38   22  57.89%  1-4 9-16 19-20                                                                23-24 27-32 ../ext/List/Util/t/shuffle.t       0   139    ??   ??       %  ?? ../ext/PerlIO/t/encoding.t                    14    1   7.14%  11 ../ext/PerlIO/t/fallback.t                     9    2  22.22%  3 5 ../ext/Socket/t/socketpair.t       0     2    45   70 155.56%  11-45 ../lib/CPAN/t/vcmp.t                          30    1   3.33%  25 ../lib/Tie/File/t/09_gen_rs.t      0    15    ??   ??       %  ?? ../lib/Unicode/Collate/t/test.t              199   30  15.08%  7 26-27 71-75                                                                81-88 95 101                                                                103-104 106 108-                                                                109 122 124 161                                                                169-172 ../lib/sort.t                      0   139   119   26  21.85%  107-119 op/alarm.t                                     4    1  25.00%  4 op/utfhash.t                                  97    1   1.03%  31 run/fresh_perl.t                              91    1   1.10%  32 uni/tr_7jis.t                                 ??   ??       %  ?? uni/tr_eucjp.t                    29  7424     6   12 200.00%  1-6 uni/tr_sjis.t                     29  7424     6   12 200.00%  1-6 56 tests and 467 subtests skipped. Failed 27/811 test scripts, 96.67% okay. 1383/75399 subtests failed, 98.17% okay.The alarm() test failure is caused by system() apparently blockingalarm().  That is probably a libc bug, and given that SunOS 4.xhas been end-of-lifed years ago, don't hold your breath for a fix.In addition to that, don't try anything too Unicode-y, especiallywith Encode, and you should be fine in SunOS 4.x.=head1 AUTHORThe original was written by Andy Dougherty F<doughera@lafayette.edu>drawing heavily on advice from Alan Burlison, Nick Ing-Simmons, Tim Bunce,and many other Solaris users over the years.Please report any errors, updates, or suggestions to F<perlbug@perl.org>.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?