Install Perl 5.8.8
[msysgit.git] / mingw / html / pod / perlsolaris.html
bloba9df2de5d2f8a9b160e4cdc592787e37dbfab0e9
1 <?xml version="1.0" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <title>README.solaris - Perl version 5 on Solaris systems</title>
6 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7 <link rev="made" href="mailto:" />
8 </head>
10 <body style="background-color: white">
11 <table border="0" width="100%" cellspacing="0" cellpadding="3">
12 <tr><td class="block" style="background-color: #cccccc" valign="middle">
13 <big><strong><span class="block">&nbsp;README.solaris - Perl version 5 on Solaris systems</span></strong></big>
14 </td></tr>
15 </table>
17 <p><a name="__index__"></a></p>
18 <!-- INDEX BEGIN -->
20 <ul>
22 <li><a href="#name">NAME</a></li>
23 <li><a href="#description">DESCRIPTION</a></li>
24 <ul>
26 <li><a href="#solaris_version_numbers_">Solaris Version Numbers.</a></li>
27 </ul>
29 <li><a href="#resources">RESOURCES</a></li>
30 <li><a href="#setting_up">SETTING UP</a></li>
31 <ul>
33 <li><a href="#file_extraction_problems_on_solaris_">File Extraction Problems on Solaris.</a></li>
34 <li><a href="#compiler_and_related_tools_on_solaris_">Compiler and Related Tools on Solaris.</a></li>
35 <ul>
37 <li><a href="#include__usr_ccs_bin__in_your_path_">Include /usr/ccs/bin/ in your PATH.</a></li>
38 <li><a href="#avoid__usr_ucb_cc_">Avoid /usr/ucb/cc.</a></li>
39 <li><a href="#sun_s_c_compiler">Sun's C Compiler</a></li>
40 <li><a href="#gcc">GCC</a></li>
41 <li><a href="#gnu_as_and_gnu_ld">GNU as and GNU ld</a></li>
42 <li><a href="#sun_and_gnu_make">Sun and GNU make</a></li>
43 <li><a href="#avoid_libucb_">Avoid libucb.</a></li>
44 </ul>
46 <li><a href="#environment_for_compiling_perl_on_solaris">Environment for Compiling perl on Solaris</a></li>
47 <ul>
49 <li><a href="#path">PATH</a></li>
50 <li><a href="#ld_library_path">LD_LIBRARY_PATH</a></li>
51 </ul>
53 </ul>
55 <li><a href="#run_configure_">RUN CONFIGURE.</a></li>
56 <ul>
58 <li><a href="#64bit_perl_on_solaris_">64-bit perl on Solaris.</a></li>
59 <ul>
61 <li><a href="#general_32bit_vs__64bit_issues_">General 32-bit vs. 64-bit issues.</a></li>
62 <li><a href="#large_file_support">Large File Support</a></li>
63 <li><a href="#building_an_lp64_perl">Building an LP64 perl</a></li>
64 <li><a href="#long_doubles_">Long Doubles.</a></li>
65 </ul>
67 <li><a href="#threads_in_perl_on_solaris_">Threads in perl on Solaris.</a></li>
68 <li><a href="#malloc_issues_with_perl_on_solaris_">Malloc Issues with perl on Solaris.</a></li>
69 </ul>
71 <li><a href="#make_problems_">MAKE PROBLEMS.</a></li>
72 <li><a href="#make_test">MAKE TEST</a></li>
73 <ul>
75 <li><a href="#op_stat_t_test_4_in_solaris">op/stat.t test 4 in Solaris</a></li>
76 <li><a href="#nss_delete_core_dump_from_op_pwent_or_op_grent">nss_delete core dump from op/pwent or op/grent</a></li>
77 </ul>
79 <li><a href="#prebuilt_binaries_of_perl_for_solaris_">PREBUILT BINARIES OF PERL FOR SOLARIS.</a></li>
80 <li><a href="#runtime_issues_for_perl_on_solaris_">RUNTIME ISSUES FOR PERL ON SOLARIS.</a></li>
81 <ul>
83 <li><a href="#limits_on_numbers_of_open_files_on_solaris_">Limits on Numbers of Open Files on Solaris.</a></li>
84 </ul>
86 <li><a href="#solarisspecific_modules_">SOLARIS-SPECIFIC MODULES.</a></li>
87 <li><a href="#solarisspecific_problems_with_modules_">SOLARIS-SPECIFIC PROBLEMS WITH MODULES.</a></li>
88 <ul>
90 <li><a href="#proc__processtable_on_solaris">Proc::ProcessTable on Solaris</a></li>
91 <li><a href="#bsd__resource_on_solaris">BSD::Resource on Solaris</a></li>
92 <li><a href="#net__ssleay_on_solaris">Net::SSLeay on Solaris</a></li>
93 </ul>
95 <li><a href="#sunos_4_x">SunOS 4.x</a></li>
96 <li><a href="#author">AUTHOR</a></li>
97 </ul>
98 <!-- INDEX END -->
100 <hr />
102 </p>
103 <h1><a name="name">NAME</a></h1>
104 <p>README.solaris - Perl version 5 on Solaris systems</p>
106 </p>
107 <hr />
108 <h1><a name="description">DESCRIPTION</a></h1>
109 <p>This document describes various features of Sun's Solaris operating system
110 that will affect how Perl version 5 (hereafter just perl) is
111 compiled and/or runs. Some issues relating to the older SunOS 4.x are
112 also discussed, though they may be out of date.</p>
113 <p>For the most part, everything should just work.</p>
114 <p>Starting with Solaris 8, perl5.00503 (or higher) is supplied with the
115 operating system, so you might not even need to build a newer version
116 of perl at all. The Sun-supplied version is installed in /usr/perl5
117 with /usr/bin/perl pointing to /usr/perl5/bin/perl. Do not disturb
118 that installation unless you really know what you are doing. If you
119 remove the perl supplied with the OS, you will render some bits of
120 your system inoperable. If you wish to install a newer version of perl,
121 install it under a different prefix from /usr/perl5. Common prefixes
122 to use are /usr/local and /opt/perl.</p>
123 <p>You may wish to put your version of perl in the PATH of all users by
124 changing the link /usr/bin/perl. This is probably OK, as most perl
125 scripts shipped with Solaris use an explicit path. (There are a few
126 exceptions, such as /usr/bin/rpm2cpio and /etc/rcm/scripts/README, but
127 these are also sufficiently generic that the actual version of perl
128 probably doesn't matter too much.)</p>
129 <p>Solaris ships with a range of Solaris-specific modules. If you choose
130 to install your own version of perl you will find the source of many of
131 these modules is available on CPAN under the Sun::Solaris:: namespace.</p>
132 <p>Solaris may include two versions of perl, e.g. Solaris 9 includes
133 both 5.005_03 and 5.6.1. This is to provide stability across Solaris
134 releases, in cases where a later perl version has incompatibilities
135 with the version included in the preceeding Solaris release. The
136 default perl version will always be the most recent, and in general
137 the old version will only be retained for one Solaris release. Note
138 also that the default perl will NOT be configured to search for modules
139 in the older version, again due to compatibility/stability concerns.
140 As a consequence if you upgrade Solaris, you will have to
141 rebuild/reinstall any additional CPAN modules that you installed for
142 the previous Solaris version. See the CPAN manpage under 'autobundle'
143 for a quick way of doing this.</p>
144 <p>As an interim measure, you may either change the #! line of your
145 scripts to specifically refer to the old perl version, e.g. on
146 Solaris 9 use #!/usr/perl5/5.00503/bin/perl to use the perl version
147 that was the default for Solaris 8, or if you have a large number of
148 scripts it may be more convenient to make the old version of perl the
149 default on your system. You can do this by changing the appropriate
150 symlinks under /usr/perl5 as follows (example for Solaris 9):</p>
151 <pre>
152 # cd /usr/perl5
153 # rm bin man pod
154 # ln -s ./5.00503/bin
155 # ln -s ./5.00503/man
156 # ln -s ./5.00503/lib/pod
157 # rm /usr/bin/perl
158 # ln -s ../perl5/5.00503/bin/perl /usr/bin/perl</pre>
159 <p>In both cases this should only be considered to be a temporary
160 measure - you should upgrade to the later version of perl as soon as
161 is practicable.</p>
162 <p>Note also that the perl command-line utilities (e.g. perldoc) and any
163 that are added by modules that you install will be under
164 /usr/perl5/bin, so that directory should be added to your PATH.</p>
166 </p>
167 <h2><a name="solaris_version_numbers_">Solaris Version Numbers.</a></h2>
168 <p>For consistency with common usage, perl's Configure script performs
169 some minor manipulations on the operating system name and version
170 number as reported by uname. Here's a partial translation table:</p>
171 <pre>
172 Sun: perl's Configure:
173 uname uname -r Name osname osvers
174 SunOS 4.1.3 Solaris 1.1 sunos 4.1.3
175 SunOS 5.6 Solaris 2.6 solaris 2.6
176 SunOS 5.8 Solaris 8 solaris 2.8
177 SunOS 5.9 Solaris 9 solaris 2.9
178 SunOS 5.10 Solaris 10 solaris 2.10</pre>
179 <p>The complete table can be found in the Sun Managers' FAQ
180 <a href="ftp://ftp.cs.toronto.edu/pub/jdd/sunmanagers/faq">ftp://ftp.cs.toronto.edu/pub/jdd/sunmanagers/faq</a> under
181 ``9.1) Which Sun models run which versions of SunOS?''.</p>
183 </p>
184 <hr />
185 <h1><a name="resources">RESOURCES</a></h1>
186 <p>There are many, many sources for Solaris information. A few of the
187 important ones for perl:</p>
188 <dl>
189 <dt><strong><a name="item_solaris_faq">Solaris FAQ</a></strong>
191 <dd>
192 <p>The Solaris FAQ is available at
193 <a href="http://www.science.uva.nl/pub/solaris/solaris2.html">http://www.science.uva.nl/pub/solaris/solaris2.html</a>.</p>
194 </dd>
195 <dd>
196 <p>The Sun Managers' FAQ is available at
197 <a href="ftp://ftp.cs.toronto.edu/pub/jdd/sunmanagers/faq">ftp://ftp.cs.toronto.edu/pub/jdd/sunmanagers/faq</a></p>
198 </dd>
199 </li>
200 <dt><strong><a name="item_precompiled_binaries">Precompiled Binaries</a></strong>
202 <dd>
203 <p>Precompiled binaries, links to many sites, and much, much more are
204 available at <a href="http://www.sunfreeware.com/">http://www.sunfreeware.com/</a> and
205 <a href="http://www.blastwave.org/">http://www.blastwave.org/</a>.</p>
206 </dd>
207 </li>
208 <dt><strong><a name="item_solaris_documentation">Solaris Documentation</a></strong>
210 <dd>
211 <p>All Solaris documentation is available on-line at <a href="http://docs.sun.com/">http://docs.sun.com/</a>.</p>
212 </dd>
213 </li>
214 </dl>
216 </p>
217 <hr />
218 <h1><a name="setting_up">SETTING UP</a></h1>
220 </p>
221 <h2><a name="file_extraction_problems_on_solaris_">File Extraction Problems on Solaris.</a></h2>
222 <p>Be sure to use a tar program compiled under Solaris (not SunOS 4.x)
223 to extract the perl-5.x.x.tar.gz file. Do not use GNU tar compiled
224 for SunOS4 on Solaris. (GNU tar compiled for Solaris should be fine.)
225 When you run SunOS4 binaries on Solaris, the run-time system magically
226 alters pathnames matching m#lib/locale# so that when tar tries to create
227 lib/locale.pm, a file named lib/oldlocale.pm gets created instead.
228 If you found this advice too late and used a SunOS4-compiled tar
229 anyway, you must find the incorrectly renamed file and move it back
230 to lib/locale.pm.</p>
232 </p>
233 <h2><a name="compiler_and_related_tools_on_solaris_">Compiler and Related Tools on Solaris.</a></h2>
234 <p>You must use an ANSI C compiler to build perl. Perl can be compiled
235 with either Sun's add-on C compiler or with gcc. The C compiler that
236 shipped with SunOS4 will not do.</p>
238 </p>
239 <h3><a name="include__usr_ccs_bin__in_your_path_">Include /usr/ccs/bin/ in your PATH.</a></h3>
240 <p>Several tools needed to build perl are located in /usr/ccs/bin/: ar,
241 as, ld, and make. Make sure that /usr/ccs/bin/ is in your PATH.</p>
242 <p>You need to make sure the following packages are installed
243 (this info is extracted from the Solaris FAQ):</p>
244 <p>for tools (sccs, lex, yacc, make, nm, truss, ld, as): SUNWbtool,
245 SUNWsprot, SUNWtoo</p>
246 <p>for libraries &amp; headers: SUNWhea, SUNWarc, SUNWlibm, SUNWlibms, SUNWdfbh,
247 SUNWcg6h, SUNWxwinc, SUNWolinc</p>
248 <p>for 64 bit development: SUNWarcx, SUNWbtoox, SUNWdplx, SUNWscpux,
249 SUNWsprox, SUNWtoox, SUNWlmsx, SUNWlmx, SUNWlibCx</p>
250 <p>If you are in doubt which package contains a file you are missing,
251 try to find an installation that has that file. Then do a</p>
252 <pre>
253 $ grep /my/missing/file /var/sadm/install/contents</pre>
254 <p>This will display a line like this:</p>
255 <p>/usr/include/sys/errno.h f none 0644 root bin 7471 37605 956241356 SUNWhea</p>
256 <p>The last item listed (SUNWhea in this example) is the package you need.</p>
258 </p>
259 <h3><a name="avoid__usr_ucb_cc_">Avoid /usr/ucb/cc.</a></h3>
260 <p>You don't need to have /usr/ucb/ in your PATH to build perl. If you
261 want /usr/ucb/ in your PATH anyway, make sure that /usr/ucb/ is NOT
262 in your PATH before the directory containing the right C compiler.</p>
264 </p>
265 <h3><a name="sun_s_c_compiler">Sun's C Compiler</a></h3>
266 <p>If you use Sun's C compiler, make sure the correct directory
267 (usually /opt/SUNWspro/bin/) is in your PATH (before /usr/ucb/).</p>
269 </p>
270 <h3><a name="gcc">GCC</a></h3>
271 <p>If you use gcc, make sure your installation is recent and complete.
272 perl versions since 5.6.0 build fine with gcc &gt; 2.8.1 on Solaris &gt;=
273 2.6.</p>
274 <p>You must Configure perl with</p>
275 <pre>
276 $ sh Configure -Dcc=gcc</pre>
277 <p>If you don't, you may experience strange build errors.</p>
278 <p>If you have updated your Solaris version, you may also have to update
279 your gcc. For example, if you are running Solaris 2.6 and your gcc is
280 installed under /usr/local, check in /usr/local/lib/gcc-lib and make
281 sure you have the appropriate directory, sparc-sun-solaris2.6/ or
282 i386-pc-solaris2.6/. If gcc's directory is for a different version of
283 Solaris than you are running, then you will need to rebuild gcc for
284 your new version of Solaris.</p>
285 <p>You can get a precompiled version of gcc from
286 <a href="http://www.sunfreeware.com/">http://www.sunfreeware.com/</a> or <a href="http://www.blastwave.org/">http://www.blastwave.org/</a>. Make
287 sure you pick up the package for your Solaris release.</p>
288 <p>If you wish to use gcc to build add-on modules for use with the perl
289 shipped with Solaris, you should use the Solaris::PerlGcc module
290 which is available from CPAN. The perl shipped with Solaris
291 is configured and built with the Sun compilers, and the compiler
292 configuration information stored in Config.pm is therefore only
293 relevant to the Sun compilers. The Solaris:PerlGcc module contains a
294 replacement Config.pm that is correct for gcc - see the module for
295 details.</p>
297 </p>
298 <h3><a name="gnu_as_and_gnu_ld">GNU as and GNU ld</a></h3>
299 <p>The following information applies to gcc version 2. Volunteers to
300 update it as appropropriate for gcc version 3 would be appreciated.</p>
301 <p>The versions of as and ld supplied with Solaris work fine for building
302 perl. There is normally no need to install the GNU versions to
303 compile perl.</p>
304 <p>If you decide to ignore this advice and use the GNU versions anyway,
305 then be sure that they are relatively recent. Versions newer than 2.7
306 are apparently new enough. Older versions may have trouble with
307 dynamic loading.</p>
308 <p>If you wish to use GNU ld, then you need to pass it the -Wl,-E flag.
309 The hints/solaris_2.sh file tries to do this automatically by setting
310 the following Configure variables:</p>
311 <pre>
312 ccdlflags=&quot;$ccdlflags -Wl,-E&quot;
313 lddlflags=&quot;$lddlflags -Wl,-E -G&quot;</pre>
314 <p>However, over the years, changes in gcc, GNU ld, and Solaris ld have made
315 it difficult to automatically detect which ld ultimately gets called.
316 You may have to manually edit config.sh and add the -Wl,-E flags
317 yourself, or else run Configure interactively and add the flags at the
318 appropriate prompts.</p>
319 <p>If your gcc is configured to use GNU as and ld but you want to use the
320 Solaris ones instead to build perl, then you'll need to add
321 -B/usr/ccs/bin/ to the gcc command line. One convenient way to do
322 that is with</p>
323 <pre>
324 $ sh Configure -Dcc='gcc -B/usr/ccs/bin/'</pre>
325 <p>Note that the trailing slash is required. This will result in some
326 harmless warnings as Configure is run:</p>
327 <pre>
328 gcc: file path prefix `/usr/ccs/bin/' never used</pre>
329 <p>These messages may safely be ignored.
330 (Note that for a SunOS4 system, you must use -B/bin/ instead.)</p>
331 <p>Alternatively, you can use the GCC_EXEC_PREFIX environment variable to
332 ensure that Sun's as and ld are used. Consult your gcc documentation
333 for further information on the -B option and the GCC_EXEC_PREFIX variable.</p>
335 </p>
336 <h3><a name="sun_and_gnu_make">Sun and GNU make</a></h3>
337 <p>The make under /usr/ccs/bin works fine for building perl. If you
338 have the Sun C compilers, you will also have a parallel version of
339 make (dmake). This works fine to build perl, but can sometimes cause
340 problems when running 'make test' due to underspecified dependencies
341 between the different test harness files. The same problem can also
342 affect the building of some add-on modules, so in those cases either
343 specify '-m serial' on the dmake command line, or use
344 /usr/ccs/bin/make instead. If you wish to use GNU make, be sure that
345 the set-group-id bit is not set. If it is, then arrange your PATH so
346 that /usr/ccs/bin/make is before GNU make or else have the system
347 administrator disable the set-group-id bit on GNU make.</p>
349 </p>
350 <h3><a name="avoid_libucb_">Avoid libucb.</a></h3>
351 <p>Solaris provides some BSD-compatibility functions in /usr/ucblib/libucb.a.
352 Perl will not build and run correctly if linked against -lucb since it
353 contains routines that are incompatible with the standard Solaris libc.
354 Normally this is not a problem since the solaris hints file prevents
355 Configure from even looking in /usr/ucblib for libraries, and also
356 explicitly omits -lucb.</p>
358 </p>
359 <h2><a name="environment_for_compiling_perl_on_solaris">Environment for Compiling perl on Solaris</a></h2>
361 </p>
362 <h3><a name="path">PATH</a></h3>
363 <p>Make sure your PATH includes the compiler (/opt/SUNWspro/bin/ if you're
364 using Sun's compiler) as well as /usr/ccs/bin/ to pick up the other
365 development tools (such as make, ar, as, and ld). Make sure your path
366 either doesn't include /usr/ucb or that it includes it after the
367 compiler and compiler tools and other standard Solaris directories.
368 You definitely don't want /usr/ucb/cc.</p>
370 </p>
371 <h3><a name="ld_library_path">LD_LIBRARY_PATH</a></h3>
372 <p>If you have the LD_LIBRARY_PATH environment variable set, be sure that
373 it does NOT include /lib or /usr/lib. If you will be building
374 extensions that call third-party shared libraries (e.g. Berkeley DB)
375 then make sure that your LD_LIBRARY_PATH environment variable includes
376 the directory with that library (e.g. /usr/local/lib).</p>
377 <p>If you get an error message</p>
378 <pre>
379 dlopen: stub interception failed</pre>
380 <p>it is probably because your LD_LIBRARY_PATH environment variable
381 includes a directory which is a symlink to /usr/lib (such as /lib).
382 The reason this causes a problem is quite subtle. The file
383 libdl.so.1.0 actually *only* contains functions which generate 'stub
384 interception failed' errors! The runtime linker intercepts links to
385 ``/usr/lib/libdl.so.1.0'' and links in internal implementations of those
386 functions instead. [Thanks to Tim Bunce for this explanation.]</p>
388 </p>
389 <hr />
390 <h1><a name="run_configure_">RUN CONFIGURE.</a></h1>
391 <p>See the INSTALL file for general information regarding Configure.
392 Only Solaris-specific issues are discussed here. Usually, the
393 defaults should be fine.</p>
395 </p>
396 <h2><a name="64bit_perl_on_solaris_">64-bit perl on Solaris.</a></h2>
397 <p>See the INSTALL file for general information regarding 64-bit compiles.
398 In general, the defaults should be fine for most people.</p>
399 <p>By default, perl-5.6.0 (or later) is compiled as a 32-bit application
400 with largefile and long-long support.</p>
402 </p>
403 <h3><a name="general_32bit_vs__64bit_issues_">General 32-bit vs. 64-bit issues.</a></h3>
404 <p>Solaris 7 and above will run in either 32 bit or 64 bit mode on SPARC
405 CPUs, via a reboot. You can build 64 bit apps whilst running 32 bit
406 mode and vice-versa. 32 bit apps will run under Solaris running in
407 either 32 or 64 bit mode. 64 bit apps require Solaris to be running
408 64 bit mode.</p>
409 <p>Existing 32 bit apps are properly known as LP32, i.e. Longs and
410 Pointers are 32 bit. 64-bit apps are more properly known as LP64.
411 The discriminating feature of a LP64 bit app is its ability to utilise a
412 64-bit address space. It is perfectly possible to have a LP32 bit app
413 that supports both 64-bit integers (long long) and largefiles (&gt; 2GB),
414 and this is the default for perl-5.6.0.</p>
415 <p>For a more complete explanation of 64-bit issues, see the
416 ``Solaris 64-bit Developer's Guide'' at <a href="http://docs.sun.com/">http://docs.sun.com/</a></p>
417 <p>You can detect the OS mode using ``isainfo -v'', e.g.</p>
418 <pre>
419 $ isainfo -v # Ultra 30 in 64 bit mode
420 64-bit sparcv9 applications
421 32-bit sparc applications</pre>
422 <p>By default, perl will be compiled as a 32-bit application. Unless
423 you want to allocate more than ~ 4GB of memory inside perl, or unless
424 you need more than 255 open file descriptors, you probably don't need
425 perl to be a 64-bit app.</p>
427 </p>
428 <h3><a name="large_file_support">Large File Support</a></h3>
429 <p>For Solaris 2.6 and onwards, there are two different ways for 32-bit
430 applications to manipulate large files (files whose size is &gt; 2GByte).
431 (A 64-bit application automatically has largefile support built in
432 by default.)</p>
433 <p>First is the ``transitional compilation environment'', described in
434 lfcompile64(5). According to the man page,</p>
435 <pre>
436 The transitional compilation environment exports all the
437 explicit 64-bit functions (xxx64()) and types in addition to
438 all the regular functions (xxx()) and types. Both xxx() and
439 xxx64() functions are available to the program source. A
440 32-bit application must use the xxx64() functions in order
441 to access large files. See the lf64(5) manual page for a
442 complete listing of the 64-bit transitional interfaces.</pre>
443 <p>The transitional compilation environment is obtained with the
444 following compiler and linker flags:</p>
445 <pre>
446 getconf LFS64_CFLAGS -D_LARGEFILE64_SOURCE
447 getconf LFS64_LDFLAG # nothing special needed
448 getconf LFS64_LIBS # nothing special needed</pre>
449 <p>Second is the ``large file compilation environment'', described in
450 lfcompile(5). According to the man page,</p>
451 <pre>
452 Each interface named xxx() that needs to access 64-bit entities
453 to access large files maps to a xxx64() call in the
454 resulting binary. All relevant data types are defined to be
455 of correct size (for example, off_t has a typedef definition
456 for a 64-bit entity).</pre>
457 <pre>
458 An application compiled in this environment is able to use
459 the xxx() source interfaces to access both large and small
460 files, rather than having to explicitly utilize the transitional
461 xxx64() interface calls to access large files.</pre>
462 <p>Two exceptions are <code>fseek()</code> and ftell(). 32-bit applications should
463 use <code>fseeko(3C)</code> and ftello(3C). These will get automatically mapped
464 to <code>fseeko64()</code> and ftello64().</p>
465 <p>The large file compilation environment is obtained with</p>
466 <pre>
467 getconf LFS_CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
468 getconf LFS_LDFLAGS # nothing special needed
469 getconf LFS_LIBS # nothing special needed</pre>
470 <p>By default, perl uses the large file compilation environment and
471 relies on Solaris to do the underlying mapping of interfaces.</p>
473 </p>
474 <h3><a name="building_an_lp64_perl">Building an LP64 perl</a></h3>
475 <p>To compile a 64-bit application on an UltraSparc with a recent Sun Compiler,
476 you need to use the flag ``-xarch=v9''. <code>getconf(1)</code> will tell you this, e.g.</p>
477 <pre>
478 $ getconf -a | grep v9
479 XBS5_LP64_OFF64_CFLAGS: -xarch=v9
480 XBS5_LP64_OFF64_LDFLAGS: -xarch=v9
481 XBS5_LP64_OFF64_LINTFLAGS: -xarch=v9
482 XBS5_LPBIG_OFFBIG_CFLAGS: -xarch=v9
483 XBS5_LPBIG_OFFBIG_LDFLAGS: -xarch=v9
484 XBS5_LPBIG_OFFBIG_LINTFLAGS: -xarch=v9
485 _XBS5_LP64_OFF64_CFLAGS: -xarch=v9
486 _XBS5_LP64_OFF64_LDFLAGS: -xarch=v9
487 _XBS5_LP64_OFF64_LINTFLAGS: -xarch=v9
488 _XBS5_LPBIG_OFFBIG_CFLAGS: -xarch=v9
489 _XBS5_LPBIG_OFFBIG_LDFLAGS: -xarch=v9
490 _XBS5_LPBIG_OFFBIG_LINTFLAGS: -xarch=v9</pre>
491 <p>This flag is supported in Sun WorkShop Compilers 5.0 and onwards
492 (now marketed under the name Forte) when used on Solaris 7 or later on
493 UltraSparc systems.</p>
494 <p>If you are using gcc, you would need to use -mcpu=v9 -m64 instead. This
495 option is not yet supported as of gcc 2.95.2; from install/SPECIFIC
496 in that release:</p>
497 <pre>
498 GCC version 2.95 is not able to compile code correctly for sparc64
499 targets. Users of the Linux kernel, at least, can use the sparc32
500 program to start up a new shell invocation with an environment that
501 causes configure to recognize (via uname -a) the system as sparc-*-*
502 instead.</pre>
503 <p>All this should be handled automatically by the hints file, if
504 requested.</p>
506 </p>
507 <h3><a name="long_doubles_">Long Doubles.</a></h3>
508 <p>As of 5.8.1, long doubles are working if you use the Sun compilers
509 (needed for additional math routines not included in libm).</p>
511 </p>
512 <h2><a name="threads_in_perl_on_solaris_">Threads in perl on Solaris.</a></h2>
513 <p>It is possible to build a threaded version of perl on Solaris. The entire
514 perl thread implementation is still experimental, however, so beware.</p>
516 </p>
517 <h2><a name="malloc_issues_with_perl_on_solaris_">Malloc Issues with perl on Solaris.</a></h2>
518 <p>Starting from perl 5.7.1 perl uses the Solaris malloc, since the perl
519 malloc breaks when dealing with more than 2GB of memory, and the Solaris
520 malloc also seems to be faster.</p>
521 <p>If you for some reason (such as binary backward compatibility) really
522 need to use perl's malloc, you can rebuild perl from the sources
523 and Configure the build with</p>
524 <pre>
525 $ sh Configure -Dusemymalloc</pre>
526 <p>You should not use perl's malloc if you are building with gcc. There
527 are reports of core dumps, especially in the PDL module. The problem
528 appears to go away under -DDEBUGGING, so it has been difficult to
529 track down. Sun's compiler appears to be okay with or without perl's
530 malloc. [XXX further investigation is needed here.]</p>
532 </p>
533 <hr />
534 <h1><a name="make_problems_">MAKE PROBLEMS.</a></h1>
535 <dl>
536 <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>
538 <dd>
539 <p>If you have problems with dynamic loading using gcc on SunOS or
540 Solaris, and you are using GNU as and GNU ld, see the section
541 <a href="#gnu_as_and_gnu_ld">GNU as and GNU ld</a> above.</p>
542 </dd>
543 </li>
544 <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>
546 <dd>
547 <p>If you get this message on SunOS or Solaris, and you're using gcc,
548 it's probably the GNU as or GNU ld problem in the previous item
549 <a href="#gnu_as_and_gnu_ld">GNU as and GNU ld</a>.</p>
550 </dd>
551 </li>
552 <dt><strong><a name="item_dlopen_3a_stub_interception_failed">dlopen: stub interception failed</a></strong>
554 <dd>
555 <p>The primary cause of the 'dlopen: stub interception failed' message is
556 that the LD_LIBRARY_PATH environment variable includes a directory
557 which is a symlink to /usr/lib (such as /lib). See
558 <a href="#ld_library_path">LD_LIBRARY_PATH</a> above.</p>
559 </dd>
560 </li>
561 <dt><strong><a name="item__23error__22no_datamodel_native_specified_22">#error ``No DATAMODEL_NATIVE specified''</a></strong>
563 <dd>
564 <p>This is a common error when trying to build perl on Solaris 2.6 with a
565 gcc installation from Solaris 2.5 or 2.5.1. The Solaris header files
566 changed, so you need to update your gcc installation. You can either
567 rerun the fixincludes script from gcc or take the opportunity to
568 update your gcc installation.</p>
569 </dd>
570 </li>
571 <dt><strong><a name="item_sh_3a_ar_3a_not_found">sh: ar: not found</a></strong>
573 <dd>
574 <p>This is a message from your shell telling you that the command 'ar'
575 was not found. You need to check your PATH environment variable to
576 make sure that it includes the directory with the 'ar' command. This
577 is a common problem on Solaris, where 'ar' is in the /usr/ccs/bin/
578 directory.</p>
579 </dd>
580 </li>
581 </dl>
583 </p>
584 <hr />
585 <h1><a name="make_test">MAKE TEST</a></h1>
587 </p>
588 <h2><a name="op_stat_t_test_4_in_solaris">op/stat.t test 4 in Solaris</a></h2>
589 <p>op/stat.t test 4 may fail if you are on a tmpfs of some sort.
590 Building in /tmp sometimes shows this behavior. The
591 test suite detects if you are building in /tmp, but it may not be able
592 to catch all tmpfs situations.</p>
594 </p>
595 <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>
596 <p>See <a href="file://C|\msysgit\mingw\html/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>
598 </p>
599 <hr />
600 <h1><a name="prebuilt_binaries_of_perl_for_solaris_">PREBUILT BINARIES OF PERL FOR SOLARIS.</a></h1>
601 <p>You can pick up prebuilt binaries for Solaris from
602 <a href="http://www.sunfreeware.com/">http://www.sunfreeware.com/</a>, <a href="http://www.blastwave.org">http://www.blastwave.org</a>,
603 ActiveState <a href="http://www.activestate.com/">http://www.activestate.com/</a>, and
604 <a href="http://www.perl.com/">http://www.perl.com/</a> under the Binaries list at the top of the
605 page. There are probably other sources as well. Please note that
606 these sites are under the control of their respective owners, not the
607 perl developers.</p>
609 </p>
610 <hr />
611 <h1><a name="runtime_issues_for_perl_on_solaris_">RUNTIME ISSUES FOR PERL ON SOLARIS.</a></h1>
613 </p>
614 <h2><a name="limits_on_numbers_of_open_files_on_solaris_">Limits on Numbers of Open Files on Solaris.</a></h2>
615 <p>The <code>stdio(3C)</code> manpage notes that for LP32 applications, only 255
616 files may be opened using fopen(), and only file descriptors 0
617 through 255 can be used in a stream. Since perl calls <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_open"><code>open()</code></a> and
618 then <code>fdopen(3C)</code> with the resulting file descriptor, perl is limited
619 to 255 simultaneous open files, even if <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_sysopen"><code>sysopen()</code></a> is used. If this
620 proves to be an insurmountable problem, you can compile perl as a
621 LP64 application, see <a href="#building_an_lp64_perl">Building an LP64 perl</a> for details. Note
622 also that the default resource limit for open file descriptors on
623 Solaris is 255, so you will have to modify your ulimit or rctl
624 (Solaris 9 onwards) appropriately.</p>
626 </p>
627 <hr />
628 <h1><a name="solarisspecific_modules_">SOLARIS-SPECIFIC MODULES.</a></h1>
629 <p>See the modules under the Solaris:: and Sun::Solaris namespaces on CPAN,
630 see <a href="http://www.cpan.org/modules/by-module/Solaris/">http://www.cpan.org/modules/by-module/Solaris/</a> and
631 <a href="http://www.cpan.org/modules/by-module/Sun/">http://www.cpan.org/modules/by-module/Sun/</a>.</p>
633 </p>
634 <hr />
635 <h1><a name="solarisspecific_problems_with_modules_">SOLARIS-SPECIFIC PROBLEMS WITH MODULES.</a></h1>
637 </p>
638 <h2><a name="proc__processtable_on_solaris">Proc::ProcessTable on Solaris</a></h2>
639 <p>Proc::ProcessTable does not compile on Solaris with perl5.6.0 and higher
640 if you have LARGEFILES defined. Since largefile support is the
641 default in 5.6.0 and later, you have to take special steps to use this
642 module.</p>
643 <p>The problem is that various structures visible via procfs use off_t,
644 and if you compile with largefile support these change from 32 bits to
645 64 bits. Thus what you get back from procfs doesn't match up with
646 the structures in perl, resulting in garbage. See <code>proc(4)</code> for further
647 discussion.</p>
648 <p>A fix for Proc::ProcessTable is to edit Makefile to
649 explicitly remove the largefile flags from the ones MakeMaker picks up
650 from Config.pm. This will result in Proc::ProcessTable being built
651 under the correct environment. Everything should then be OK as long as
652 Proc::ProcessTable doesn't try to share off_t's with the rest of perl,
653 or if it does they should be explicitly specified as off64_t.</p>
655 </p>
656 <h2><a name="bsd__resource_on_solaris">BSD::Resource on Solaris</a></h2>
657 <p>BSD::Resource versions earlier than 1.09 do not compile on Solaris
658 with perl 5.6.0 and higher, for the same reasons as Proc::ProcessTable.
659 BSD::Resource versions starting from 1.09 have a workaround for the problem.</p>
661 </p>
662 <h2><a name="net__ssleay_on_solaris">Net::SSLeay on Solaris</a></h2>
663 <p>Net::SSLeay requires a /dev/urandom to be present. This device is
664 available from Solaris 9 onwards. For earlier Solaris versions you
665 can either get the package SUNWski (packaged with several Sun
666 software products, for example the Sun WebServer, which is part of
667 the Solaris Server Intranet Extension, or the Sun Directory Services,
668 part of Solaris for ISPs) or download the ANDIrand package from
669 <a href="http://www.cosy.sbg.ac.at/~andi/">http://www.cosy.sbg.ac.at/~andi/</a>. If you use SUNWski, make a
670 symbolic link /dev/urandom pointing to /dev/random. For more details,
671 see Document ID27606 entitled ``Differing /dev/random support requirements
672 within Solaris[TM] Operating Environments'', available at
673 <a href="http://sunsolve.sun.com">http://sunsolve.sun.com</a> .</p>
674 <p>It may be possible to use the Entropy Gathering Daemon (written in
675 Perl!), available from <a href="http://www.lothar.com/tech/crypto/">http://www.lothar.com/tech/crypto/</a>.</p>
677 </p>
678 <hr />
679 <h1><a name="sunos_4_x">SunOS 4.x</a></h1>
680 <p>In SunOS 4.x you most probably want to use the SunOS ld, /usr/bin/ld,
681 since the more recent versions of GNU ld (like 2.13) do not seem to
682 work for building Perl anymore. When linking the extensions, the
683 GNU ld gets very unhappy and spews a lot of errors like this</p>
684 <pre>
685 ... relocation truncated to fit: BASE13 ...</pre>
686 <p>and dies. Therefore the SunOS 4.1 hints file explicitly sets the
687 ld to be /usr/bin/ld.</p>
688 <p>As of Perl 5.8.1 the dynamic loading of libraries (DynaLoader, XSLoader)
689 also seems to have become broken in in SunOS 4.x. Therefore the default
690 is to build Perl statically.</p>
691 <p>Running the test suite in SunOS 4.1 is a bit tricky since the
692 <em>lib/Tie/File/t/09_gen_rs</em> test hangs (subtest #51, FWIW) for some
693 unknown reason. Just stop the test and kill that particular Perl
694 process.</p>
695 <p>There are various other failures, that as of SunOS 4.1.4 and gcc 3.2.2
696 look a lot like gcc bugs. Many of the failures happen in the Encode
697 tests, where for example when the test expects ``0'' you get ``&amp;#48;''
698 which should after a little squinting look very odd indeed.
699 Another example is earlier in <em>t/run/fresh_perl</em> where <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_chr"><code>chr(0xff)</code></a> is
700 expected but the test fails because the result is chr(0xff). Exactly.</p>
701 <p>This is the ``make test'' result from the said combination:</p>
702 <pre>
703 Failed 27 test scripts out of 745, 96.38% okay.</pre>
704 <p>Running the <code>harness</code> is painful because of the many failing
705 Unicode-related tests will output megabytes of failure messages,
706 but if one patiently waits, one gets these results:</p>
707 <pre>
708 Failed Test Stat Wstat Total Fail Failed List of Failed
709 -----------------------------------------------------------------------------
711 ../ext/Encode/t/at-cn.t 4 1024 29 4 13.79% 14-17
712 ../ext/Encode/t/at-tw.t 10 2560 17 10 58.82% 2 4 6 8 10 12
713 14-17
714 ../ext/Encode/t/enc_data.t 29 7424 ?? ?? % ??
715 ../ext/Encode/t/enc_eucjp.t 29 7424 ?? ?? % ??
716 ../ext/Encode/t/enc_module.t 29 7424 ?? ?? % ??
717 ../ext/Encode/t/encoding.t 29 7424 ?? ?? % ??
718 ../ext/Encode/t/grow.t 12 3072 24 12 50.00% 2 4 6 8 10 12 14
719 16 18 20 22 24
720 Failed Test Stat Wstat Total Fail Failed List of Failed
721 ------------------------------------------------------------------------------
722 ../ext/Encode/t/guess.t 255 65280 29 40 137.93% 10-29
723 ../ext/Encode/t/jperl.t 29 7424 15 30 200.00% 1-15
724 ../ext/Encode/t/mime-header.t 2 512 10 2 20.00% 2-3
725 ../ext/Encode/t/perlio.t 22 5632 38 22 57.89% 1-4 9-16 19-20
726 23-24 27-32
727 ../ext/List/Util/t/shuffle.t 0 139 ?? ?? % ??
728 ../ext/PerlIO/t/encoding.t 14 1 7.14% 11
729 ../ext/PerlIO/t/fallback.t 9 2 22.22% 3 5
730 ../ext/Socket/t/socketpair.t 0 2 45 70 155.56% 11-45
731 ../lib/CPAN/t/vcmp.t 30 1 3.33% 25
732 ../lib/Tie/File/t/09_gen_rs.t 0 15 ?? ?? % ??
733 ../lib/Unicode/Collate/t/test.t 199 30 15.08% 7 26-27 71-75
734 81-88 95 101
735 103-104 106 108-
736 109 122 124 161
737 169-172
738 ../lib/sort.t 0 139 119 26 21.85% 107-119
739 op/alarm.t 4 1 25.00% 4
740 op/utfhash.t 97 1 1.03% 31
741 run/fresh_perl.t 91 1 1.10% 32
742 uni/tr_7jis.t ?? ?? % ??
743 uni/tr_eucjp.t 29 7424 6 12 200.00% 1-6
744 uni/tr_sjis.t 29 7424 6 12 200.00% 1-6
745 56 tests and 467 subtests skipped.
746 Failed 27/811 test scripts, 96.67% okay. 1383/75399 subtests failed, 98.17% okay.</pre>
747 <p>The <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_alarm"><code>alarm()</code></a> test failure is caused by <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_system"><code>system()</code></a> apparently blocking
748 alarm(). That is probably a libc bug, and given that SunOS 4.x
749 has been end-of-lifed years ago, don't hold your breath for a fix.
750 In addition to that, don't try anything too Unicode-y, especially
751 with Encode, and you should be fine in SunOS 4.x.</p>
753 </p>
754 <hr />
755 <h1><a name="author">AUTHOR</a></h1>
756 <p>The original was written by Andy Dougherty <em><a href="mailto:doughera@lafayette.edu">doughera@lafayette.edu</a></em>
757 drawing heavily on advice from Alan Burlison, Nick Ing-Simmons, Tim Bunce,
758 and many other Solaris users over the years.</p>
759 <p>Please report any errors, updates, or suggestions to <em><a href="mailto:perlbug@perl.org">perlbug@perl.org</a></em>.</p>
760 <table border="0" width="100%" cellspacing="0" cellpadding="3">
761 <tr><td class="block" style="background-color: #cccccc" valign="middle">
762 <big><strong><span class="block">&nbsp;README.solaris - Perl version 5 on Solaris systems</span></strong></big>
763 </td></tr>
764 </table>
766 </body>
768 </html>