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