Debian Codegraph @

upstream/opensuse-tumbleweed/man1/perlsolaris.1

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