📄 perlsolaris.1
字号:
for 64 bit development: SUNWarcx, SUNWbtoox, SUNWdplx, SUNWscpux,SUNWsprox, SUNWtoox, SUNWlmsx, SUNWlmx, SUNWlibCx.PPIf you are in doubt which package contains a file you are missing,try to find an installation that has that file. Then do a.PP.Vb 1\& $ grep /my/missing/file /var/sadm/install/contents.Ve.PPThis will display a line like this:.PP/usr/include/sys/errno.h f none 0644 root bin 7471 37605 956241356 SUNWhea.PPThe last item listed (SUNWhea in this example) is the package you need..PP\fIAvoid /usr/ucb/cc.\fR.IX Subsection "Avoid /usr/ucb/cc.".PPYou don't need to have /usr/ucb/ in your \s-1PATH\s0 to build perl. If youwant /usr/ucb/ in your \s-1PATH\s0 anyway, make sure that /usr/ucb/ is \s-1NOT\s0in your \s-1PATH\s0 before the directory containing the right C compiler..PP\fISun's C Compiler\fR.IX Subsection "Sun's C Compiler".PPIf you use Sun's C compiler, make sure the correct directory(usually /opt/SUNWspro/bin/) is in your \s-1PATH\s0 (before /usr/ucb/)..PP\fI\s-1GCC\s0\fR.IX Subsection "GCC".PPIf you use gcc, make sure your installation is recent and complete.perl versions since 5.6.0 build fine with gcc > 2.8.1 on Solaris >=2.6..PPYou must Configure perl with.PP.Vb 1\& $ sh Configure \-Dcc=gcc.Ve.PPIf you don't, you may experience strange build errors..PPIf you have updated your Solaris version, you may also have to updateyour gcc. For example, if you are running Solaris 2.6 and your gcc isinstalled under /usr/local, check in /usr/local/lib/gcc\-lib and makesure you have the appropriate directory, sparc\-sun\-solaris2.6/ ori386\-pc\-solaris2.6/. If gcc's directory is for a different version ofSolaris than you are running, then you will need to rebuild gcc foryour new version of Solaris..PPYou can get a precompiled version of gcc from<http://www.sunfreeware.com/> or <http://www.blastwave.org/>. Makesure you pick up the package for your Solaris release..PPIf you wish to use gcc to build add-on modules for use with the perlshipped with Solaris, you should use the Solaris::PerlGcc modulewhich is available from \s-1CPAN\s0. The perl shipped with Solarisis configured and built with the Sun compilers, and the compilerconfiguration information stored in Config.pm is therefore onlyrelevant to the Sun compilers. The Solaris:PerlGcc module contains areplacement Config.pm that is correct for gcc \- see the module fordetails..PP\fI\s-1GNU\s0 as and \s-1GNU\s0 ld\fR.IX Subsection "GNU as and GNU ld".PPThe following information applies to gcc version 2. Volunteers toupdate it as appropropriate for gcc version 3 would be appreciated..PPThe versions of as and ld supplied with Solaris work fine for buildingperl. There is normally no need to install the \s-1GNU\s0 versions tocompile perl..PPIf you decide to ignore this advice and use the \s-1GNU\s0 versions anyway,then be sure that they are relatively recent. Versions newer than 2.7are apparently new enough. Older versions may have trouble withdynamic loading..PPIf you wish to use \s-1GNU\s0 ld, then you need to pass it the \-Wl,\-E flag.The hints/solaris_2.sh file tries to do this automatically by settingthe following Configure variables:.PP.Vb 2\& ccdlflags="$ccdlflags \-Wl,\-E"\& lddlflags="$lddlflags \-Wl,\-E \-G".Ve.PPHowever, over the years, changes in gcc, \s-1GNU\s0 ld, and Solaris ld have madeit difficult to automatically detect which ld ultimately gets called.You may have to manually edit config.sh and add the \-Wl,\-E flagsyourself, or else run Configure interactively and add the flags at theappropriate prompts..PPIf your gcc is configured to use \s-1GNU\s0 as and ld but you want to use theSolaris ones instead to build perl, then you'll need to add\&\-B/usr/ccs/bin/ to the gcc command line. One convenient way to dothat is with.PP.Vb 1\& $ sh Configure \-Dcc=\*(Aqgcc \-B/usr/ccs/bin/\*(Aq.Ve.PPNote that the trailing slash is required. This will result in someharmless warnings as Configure is run:.PP.Vb 1\& gcc: file path prefix \`/usr/ccs/bin/\*(Aq never used.Ve.PPThese messages may safely be ignored.(Note that for a SunOS4 system, you must use \-B/bin/ instead.).PPAlternatively, you can use the \s-1GCC_EXEC_PREFIX\s0 environment variable toensure that Sun's as and ld are used. Consult your gcc documentationfor further information on the \-B option and the \s-1GCC_EXEC_PREFIX\s0 variable..PP\fISun and \s-1GNU\s0 make\fR.IX Subsection "Sun and GNU make".PPThe make under /usr/ccs/bin works fine for building perl. If youhave the Sun C compilers, you will also have a parallel version ofmake (dmake). This works fine to build perl, but can sometimes causeproblems when running 'make test' due to underspecified dependenciesbetween the different test harness files. The same problem can alsoaffect the building of some add-on modules, so in those cases eitherspecify '\-m serial' on the dmake command line, or use/usr/ccs/bin/make instead. If you wish to use \s-1GNU\s0 make, be sure thatthe set-group-id bit is not set. If it is, then arrange your \s-1PATH\s0 sothat /usr/ccs/bin/make is before \s-1GNU\s0 make or else have the systemadministrator disable the set-group-id bit on \s-1GNU\s0 make..PP\fIAvoid libucb.\fR.IX Subsection "Avoid libucb.".PPSolaris provides some BSD-compatibility functions in /usr/ucblib/libucb.a.Perl will not build and run correctly if linked against \-lucb since itcontains routines that are incompatible with the standard Solaris libc.Normally this is not a problem since the solaris hints file preventsConfigure from even looking in /usr/ucblib for libraries, and alsoexplicitly omits \-lucb..Sh "Environment for Compiling perl on Solaris".IX Subsection "Environment for Compiling perl on Solaris"\fI\s-1PATH\s0\fR.IX Subsection "PATH".PPMake sure your \s-1PATH\s0 includes the compiler (/opt/SUNWspro/bin/ if you'reusing Sun's compiler) as well as /usr/ccs/bin/ to pick up the otherdevelopment tools (such as make, ar, as, and ld). Make sure your patheither doesn't include /usr/ucb or that it includes it after thecompiler and compiler tools and other standard Solaris directories.You definitely don't want /usr/ucb/cc..PP\fI\s-1LD_LIBRARY_PATH\s0\fR.IX Subsection "LD_LIBRARY_PATH".PPIf you have the \s-1LD_LIBRARY_PATH\s0 environment variable set, be sure thatit does \s-1NOT\s0 include /lib or /usr/lib. If you will be buildingextensions that call third-party shared libraries (e.g. Berkeley \s-1DB\s0)then make sure that your \s-1LD_LIBRARY_PATH\s0 environment variable includesthe directory with that library (e.g. /usr/local/lib)..PPIf you get an error message.PP.Vb 1\& dlopen: stub interception failed.Ve.PPit is probably because your \s-1LD_LIBRARY_PATH\s0 environment variableincludes a directory which is a symlink to /usr/lib (such as /lib).The reason this causes a problem is quite subtle. The filelibdl.so.1.0 actually *only* contains functions which generate 'stubinterception failed' errors! The runtime linker intercepts links to\&\*(L"/usr/lib/libdl.so.1.0\*(R" and links in internal implementations of thosefunctions instead. [Thanks to Tim Bunce for this explanation.].SH "RUN CONFIGURE.".IX Header "RUN CONFIGURE."See the \s-1INSTALL\s0 file for general information regarding Configure.Only Solaris-specific issues are discussed here. Usually, thedefaults should be fine..Sh "64\-bit perl on Solaris.".IX Subsection "64-bit perl on Solaris."See the \s-1INSTALL\s0 file for general information regarding 64\-bit compiles.In general, the defaults should be fine for most people..PPBy default, perl\-5.6.0 (or later) is compiled as a 32\-bit applicationwith largefile and long-long support..PP\fIGeneral 32\-bit vs. 64\-bit issues.\fR.IX Subsection "General 32-bit vs. 64-bit issues.".PPSolaris 7 and above will run in either 32 bit or 64 bit mode on \s-1SPARC\s0CPUs, via a reboot. You can build 64 bit apps whilst running 32 bitmode and vice-versa. 32 bit apps will run under Solaris running ineither 32 or 64 bit mode. 64 bit apps require Solaris to be running64 bit mode..PPExisting 32 bit apps are properly known as \s-1LP32\s0, i.e. Longs andPointers are 32 bit. 64\-bit apps are more properly known as \s-1LP64\s0.The discriminating feature of a \s-1LP64\s0 bit app is its ability to utilise a64\-bit address space. It is perfectly possible to have a \s-1LP32\s0 bit appthat supports both 64\-bit integers (long long) and largefiles (> 2GB),and this is the default for perl\-5.6.0..PPFor a more complete explanation of 64\-bit issues, see the\&\*(L"Solaris 64\-bit Developer's Guide\*(R" at <http://docs.sun.com/>.PPYou can detect the \s-1OS\s0 mode using \*(L"isainfo \-v\*(R", e.g..PP.Vb 3\& $ isainfo \-v # Ultra 30 in 64 bit mode\& 64\-bit sparcv9 applications\& 32\-bit sparc applications.Ve.PPBy default, perl will be compiled as a 32\-bit application. Unlessyou want to allocate more than ~ 4GB of memory inside perl, or unlessyou need more than 255 open file descriptors, you probably don't needperl to be a 64\-bit app..PP\fILarge File Support\fR.IX Subsection "Large File Support".PPFor Solaris 2.6 and onwards, there are two different ways for 32\-bitapplications to manipulate large files (files whose size is > 2GByte).(A 64\-bit application automatically has largefile support built inby default.).PPFirst is the \*(L"transitional compilation environment\*(R", described in\&\fIlfcompile64\fR\|(5). According to the man page,.PP.Vb 7\& The transitional compilation environment exports all the\& explicit 64\-bit functions (xxx64()) and types in addition to\& all the regular functions (xxx()) and types. Both xxx() and\& xxx64() functions are available to the program source. A\& 32\-bit application must use the xxx64() functions in order\& to access large files. See the lf64(5) manual page for a\& complete listing of the 64\-bit transitional interfaces..Ve.PPThe transitional compilation environment is obtained with thefollowing compiler and linker flags:.PP.Vb 3\& getconf LFS64_CFLAGS \-D_LARGEFILE64_SOURCE\& getconf LFS64_LDFLAG # nothing special needed\& getconf LFS64_LIBS # nothing special needed.Ve.PPSecond is the \*(L"large file compilation environment\*(R", described in\&\fIlfcompile\fR\|(5). According to the man page,.PP.Vb 5\& Each interface named xxx() that needs to access 64\-bit entities\& to access large files maps to a xxx64() call in the\& resulting binary. All relevant data types are defined to be\& of correct size (for example, off_t has a typedef definition\& for a 64\-bit entity).\&\& An application compiled in this environment is able to use\& the xxx() source interfaces to access both large and small\& files, rather than having to explicitly utilize the transitional\& xxx64() interface calls to access large files..Ve.PPTwo exceptions are \fIfseek()\fR and \fIftell()\fR. 32\-bit applications shoulduse fseeko(3C) and ftello(3C). These will get automatically mappedto \fIfseeko64()\fR and \fIftello64()\fR..PPThe large file compilation environment is obtained with.PP.Vb 3\& getconf LFS_CFLAGS \-D_LARGEFILE_SOURCE \-D_FILE_OFFSET_BITS=64\& getconf LFS_LDFLAGS # nothing special needed\& getconf LFS_LIBS # nothing special needed.Ve.PPBy default, perl uses the large file compilation environment andrelies on Solaris to do the underlying mapping of interfaces.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -