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