perlsolaris.html

来自「perl教程」· HTML 代码 · 共 769 行 · 第 1/3 页

HTML
769 行
字号
<p>
</p>
<h2><a name="threads_in_perl_on_solaris_">Threads in perl on Solaris.</a></h2>
<p>It is possible to build a threaded version of perl on Solaris.  The entire
perl thread implementation is still experimental, however, so beware.</p>
<p>
</p>
<h2><a name="malloc_issues_with_perl_on_solaris_">Malloc Issues with perl on Solaris.</a></h2>
<p>Starting from perl 5.7.1 perl uses the Solaris malloc, since the perl
malloc breaks when dealing with more than 2GB of memory, and the Solaris
malloc also seems to be faster.</p>
<p>If you for some reason (such as binary backward compatibility) really
need to use perl's malloc, you can rebuild perl from the sources
and Configure the build with</p>
<pre>
 $ sh Configure -Dusemymalloc</pre>
<p>You should not use perl's malloc if you are building with gcc.  There
are reports of core dumps, especially in the PDL module.  The problem
appears to go away under -DDEBUGGING, so it has been difficult to
track down.  Sun's compiler appears to be okay with or without perl's
malloc. [XXX further investigation is needed here.]</p>
<p>
</p>
<hr />
<h1><a name="make_problems_">MAKE PROBLEMS.</a></h1>
<dl>
<dt><strong><a name="item_dynamic_loading_problems_with_gnu_as_and_gnu_ld">Dynamic Loading Problems With GNU as and GNU ld</a></strong>

<dd>
<p>If you have problems with dynamic loading using gcc on SunOS or
Solaris, and you are using GNU as and GNU ld, see the section
<a href="#gnu_as_and_gnu_ld">GNU as and GNU ld</a> above.</p>
</dd>
</li>
<dt><strong><a name="item_ld_2eso_2e1_3a__2e_2fperl_3a_fatal_3a_relocation_e">ld.so.1: ./perl: fatal: relocation error:</a></strong>

<dd>
<p>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 item
<a href="#gnu_as_and_gnu_ld">GNU as and GNU ld</a>.</p>
</dd>
</li>
<dt><strong><a name="item_dlopen_3a_stub_interception_failed">dlopen: stub interception failed</a></strong>

<dd>
<p>The primary cause of the 'dlopen: stub interception failed' message is
that the LD_LIBRARY_PATH environment variable includes a directory
which is a symlink to /usr/lib (such as /lib).  See
<a href="#ld_library_path">LD_LIBRARY_PATH</a> above.</p>
</dd>
</li>
<dt><strong><a name="item__23error__22no_datamodel_native_specified_22">#error &quot;No DATAMODEL_NATIVE specified&quot;</a></strong>

<dd>
<p>This is a common error when trying to build perl on Solaris 2.6 with a
gcc installation from Solaris 2.5 or 2.5.1.  The Solaris header files
changed, so you need to update your gcc installation.  You can either
rerun the fixincludes script from gcc or take the opportunity to
update your gcc installation.</p>
</dd>
</li>
<dt><strong><a name="item_sh_3a_ar_3a_not_found">sh: ar: not found</a></strong>

<dd>
<p>This is a message from your shell telling you that the command 'ar'
was not found.  You need to check your PATH environment variable to
make sure that it includes the directory with the 'ar' command.  This
is a common problem on Solaris, where 'ar' is in the /usr/ccs/bin/
directory.</p>
</dd>
</li>
</dl>
<p>
</p>
<hr />
<h1><a name="make_test">MAKE TEST</a></h1>
<p>
</p>
<h2><a name="op_stat_t_test_4_in_solaris">op/stat.t test 4 in Solaris</a></h2>
<p>op/stat.t test 4 may fail if you are on a tmpfs of some sort.
Building in /tmp sometimes shows this behavior.  The
test suite detects if you are building in /tmp, but it may not be able
to catch all tmpfs situations.</p>
<p>
</p>
<h2><a name="nss_delete_core_dump_from_op_pwent_or_op_grent">nss_delete core dump from op/pwent or op/grent</a></h2>
<p>See <a href="../../lib/Pod/perlhpux.html#nss_delete_core_dump_from_op_pwent_or_op_grent">nss_delete core dump from op/pwent or op/grent in the perlhpux manpage</a>.</p>
<p>
</p>
<hr />
<h1><a name="prebuilt_binaries_of_perl_for_solaris_">PREBUILT BINARIES OF PERL FOR SOLARIS.</a></h1>
<p>You can pick up prebuilt binaries for Solaris from
<a href="http://www.sunfreeware.com/">http://www.sunfreeware.com/</a>, <a href="http://www.blastwave.org">http://www.blastwave.org</a>,
ActiveState <a href="http://www.activestate.com/">http://www.activestate.com/</a>, and
<a href="http://www.perl.com/">http://www.perl.com/</a> under the Binaries list at the top of the
page.  There are probably other sources as well.  Please note that
these sites are under the control of their respective owners, not the
perl developers.</p>
<p>
</p>
<hr />
<h1><a name="runtime_issues_for_perl_on_solaris_">RUNTIME ISSUES FOR PERL ON SOLARIS.</a></h1>
<p>
</p>
<h2><a name="limits_on_numbers_of_open_files_on_solaris_">Limits on Numbers of Open Files on Solaris.</a></h2>
<p>The <code>stdio(3C)</code> manpage notes that for LP32 applications, only 255
files may be opened using fopen(), and only file descriptors 0
through 255 can be used in a stream.  Since perl calls <a href="../../lib/Pod/perlfunc.html#item_open"><code>open()</code></a> and
then <code>fdopen(3C)</code> with the resulting file descriptor, perl is limited
to 255 simultaneous open files, even if <a href="../../lib/Pod/perlfunc.html#item_sysopen"><code>sysopen()</code></a> is used.  If this
proves to be an insurmountable problem, you can compile perl as a
LP64 application, see <a href="#building_an_lp64_perl">Building an LP64 perl</a> for details.  Note
also that the default resource limit for open file descriptors on
Solaris is 255, so you will have to modify your ulimit or rctl
(Solaris 9 onwards) appropriately.</p>
<p>
</p>
<hr />
<h1><a name="solarisspecific_modules_">SOLARIS-SPECIFIC MODULES.</a></h1>
<p>See the modules under the Solaris:: and Sun::Solaris namespaces on CPAN,
see <a href="http://www.cpan.org/modules/by-module/Solaris/">http://www.cpan.org/modules/by-module/Solaris/</a> and
<a href="http://www.cpan.org/modules/by-module/Sun/">http://www.cpan.org/modules/by-module/Sun/</a>.</p>
<p>
</p>
<hr />
<h1><a name="solarisspecific_problems_with_modules_">SOLARIS-SPECIFIC PROBLEMS WITH MODULES.</a></h1>
<p>
</p>
<h2><a name="proc__processtable_on_solaris">Proc::ProcessTable on Solaris</a></h2>
<p>Proc::ProcessTable does not compile on Solaris with perl5.6.0 and higher
if you have LARGEFILES defined.  Since largefile support is the
default in 5.6.0 and later, you have to take special steps to use this
module.</p>
<p>The problem is that various structures visible via procfs use off_t,
and if you compile with largefile support these change from 32 bits to
64 bits.  Thus what you get back from procfs doesn't match up with
the structures in perl, resulting in garbage.  See <code>proc(4)</code> for further
discussion.</p>
<p>A fix for Proc::ProcessTable is to edit Makefile to
explicitly remove the largefile flags from the ones MakeMaker picks up
from Config.pm.  This will result in Proc::ProcessTable being built
under the correct environment.  Everything should then be OK as long as
Proc::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.</p>
<p>
</p>
<h2><a name="bsd__resource_on_solaris">BSD::Resource on Solaris</a></h2>
<p>BSD::Resource versions earlier than 1.09 do not compile on Solaris
with 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.</p>
<p>
</p>
<h2><a name="net__ssleay_on_solaris">Net::SSLeay on Solaris</a></h2>
<p>Net::SSLeay requires a /dev/urandom to be present. This device is
available from Solaris 9 onwards.  For earlier Solaris versions you
can either get the package SUNWski (packaged with several Sun
software products, for example the Sun WebServer, which is part of
the Solaris Server Intranet Extension, or the Sun Directory Services,
part of Solaris for ISPs) or download the ANDIrand package from
<a href="http://www.cosy.sbg.ac.at/~andi/">http://www.cosy.sbg.ac.at/~andi/</a>. If you use SUNWski, make a
symbolic link /dev/urandom pointing to /dev/random.  For more details,
see Document ID27606 entitled &quot;Differing /dev/random support requirements
within Solaris[TM] Operating Environments&quot;, available at
<a href="http://sunsolve.sun.com">http://sunsolve.sun.com</a> .</p>
<p>It may be possible to use the Entropy Gathering Daemon (written in
Perl!), available from <a href="http://www.lothar.com/tech/crypto/">http://www.lothar.com/tech/crypto/</a>.</p>
<p>
</p>
<hr />
<h1><a name="sunos_4_x">SunOS 4.x</a></h1>
<p>In 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 to
work for building Perl anymore.  When linking the extensions, the
GNU ld gets very unhappy and spews a lot of errors like this</p>
<pre>
  ... relocation truncated to fit: BASE13 ...</pre>
<p>and dies.  Therefore the SunOS 4.1 hints file explicitly sets the
ld to be /usr/bin/ld.</p>
<p>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 default
is to build Perl statically.</p>
<p>Running the test suite in SunOS 4.1 is a bit tricky since the
<em>lib/Tie/File/t/09_gen_rs</em> test hangs (subtest #51, FWIW) for some
unknown reason.  Just stop the test and kill that particular Perl
process.</p>
<p>There are various other failures, that as of SunOS 4.1.4 and gcc 3.2.2
look a lot like gcc bugs.  Many of the failures happen in the Encode
tests, where for example when the test expects &quot;0&quot; you get &quot;&amp;#48;&quot;
which should after a little squinting look very odd indeed.
Another example is earlier in <em>t/run/fresh_perl</em> where <a href="../../lib/Pod/perlfunc.html#item_chr"><code>chr(0xff)</code></a> is
expected but the test fails because the result is chr(0xff).  Exactly.</p>
<p>This is the &quot;make test&quot; result from the said combination:</p>
<pre>
  Failed 27 test scripts out of 745, 96.38% okay.</pre>
<p>Running the <code>harness</code> is painful because of the many failing
Unicode-related tests will output megabytes of failure messages,
but if one patiently waits, one gets these results:</p>
<pre>
 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.</pre>
<p>The <a href="../../lib/Pod/perlfunc.html#item_alarm"><code>alarm()</code></a> test failure is caused by <a href="../../lib/Pod/perlfunc.html#item_system"><code>system()</code></a> apparently blocking
alarm().  That is probably a libc bug, and given that SunOS 4.x
has 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, especially
with Encode, and you should be fine in SunOS 4.x.</p>
<p>
</p>
<hr />
<h1><a name="author">AUTHOR</a></h1>
<p>The original was written by Andy Dougherty <em><a href="mailto:doughera@lafayette.edu">doughera@lafayette.edu</a></em>
drawing heavily on advice from Alan Burlison, Nick Ing-Simmons, Tim Bunce,
and many other Solaris users over the years.</p>
<p>Please report any errors, updates, or suggestions to <em><a href="mailto:perlbug@perl.org">perlbug@perl.org</a></em>.</p>

</body>

</html>

⌨️ 快捷键说明

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