📄 perlhpux.1
字号:
http://www.cmve.net/~merijn/ for HP-UX 10.20, HP-UX 11.00, and HP-UX 11.11(HP-UX 11i) in both 32\- and 64\-bit versions. These are bzipped tar archivesthat also include recent \s-1GNU\s0 binutils and \s-1GNU\s0 gdb. Read the instructionson that page to rebuild gcc using itself..PPOn PA-RISC you need a different compiler for 32\-bit applications and for64\-bit applications. On PA-RISC, 32\-bit objects and 64\-bit objects donot mix. Period. There is no different behaviour for \s-1HP\s0 C\-ANSI-C or \s-1GNU\s0gcc. So if you require your perl binary to use 64\-bit libraries, likeOracle\-64bit, you \s-1MUST\s0 build a 64\-bit perl..PPBuilding a 64\-bit capable gcc on PA-RISC from source is possible only whenyou have the \s-1HP\s0 C\-ANSI C compiler or an already working 64\-bit binary ofgcc available. Best performance for perl is achieved with \s-1HP\s0's nativecompiler..Sh "Using Large Files with Perl on HP-UX".IX Subsection "Using Large Files with Perl on HP-UX"Beginning with HP-UX version 10.20, files larger than 2GB (2^31 bytes)may be created and manipulated. Three separate methods of doing thisare available. Of these methods, the best method for Perl is to compileusing the \-Duselargefiles flag to Configure. This causes Perl to becompiled using structures and functions in which these are 64 bits wide,rather than 32 bits wide. (Note that this will only work with \s-1HP\s0's \s-1ANSI\s0C compiler. If you want to compile Perl using gcc, you will have to geta version of the compiler that supports 64\-bit operations. See above forwhere to find it.).PPThere are some drawbacks to this approach. One is that any extensionwhich calls any file-manipulating C function will need to be recompiled(just follow the usual \*(L"perl Makefile.PL; make; make test; make install\*(R"procedure)..PPThe list of functions that will need to recompiled is: creat, fgetpos, fopen, freopen, fsetpos, fstat, fstatvfs, fstatvfsdev, ftruncate, ftw, lockf, lseek, lstat, mmap, nftw, open, prealloc, stat, statvfs, statvfsdev, tmpfile, truncate, getrlimit, setrlimit.PPAnother drawback is only valid for Perl versions before 5.6.0. Thisdrawback is that the seek and tell functions (both the builtin versionand \s-1POSIX\s0 module version) will not perform correctly..PPIt is strongly recommended that you use this flag when you runConfigure. If you do not do this, but later answer the question aboutlarge files when Configure asks you, you may get a configuration thatcannot be compiled, or that does not function as expected..Sh "Threaded Perl on HP-UX".IX Subsection "Threaded Perl on HP-UX"It is possible to compile a version of threaded Perl on any version ofHP-UX before 10.30, but it is strongly suggested that you be running onHP-UX 11.00 at least..PPTo compile Perl with threads, add \-Dusethreads to the arguments ofConfigure. Verify that the \-D_POSIX_C_SOURCE=199506L compiler flag isautomatically added to the list of flags. Also make sure that \-lpthreadis listed before \-lc in the list of libraries to link Perl with. Thehints provided for HP-UX during Configure will try very hard to getthis right for you..PPHP-UX versions before 10.30 require a separate installation of a \s-1POSIX\s0threads library package. Two examples are the \s-1HP\s0 \s-1DCE\s0 package, availableon \*(L"HP-UX Hardware Extensions 3.0, Install and Core \s-1OS\s0, Release 10.20,April 1999 (B3920\-13941)\*(R" or the Freely available \s-1PTH\s0 package, availableon H.Merijn's site (http://mirrors.develooper.com/hpux/)..PPIf you are going to use the \s-1HP\s0 \s-1DCE\s0 package, the library used for threadingis /usr/lib/libcma.sl, but there have been multiple updates of thatlibrary over time. Perl will build with the first version, but itwill not pass the test suite. Older Oracle versions might be a compellingreason not to update that library, otherwise please find a newer versionin one of the following patches: \s-1PHSS_19739\s0, \s-1PHSS_20608\s0, or \s-1PHSS_23672\s0.PPreformatted output:.PP.Vb 10\& d3:/usr/lib 106 > what libcma\-*.1\& libcma\-00000.1:\& HP DCE/9000 1.5 Module: libcma.sl (Export)\& Date: Apr 29 1996 22:11:24\& libcma\-19739.1:\& HP DCE/9000 1.5 PHSS_19739\-40 Module: libcma.sl (Export)\& Date: Sep 4 1999 01:59:07\& libcma\-20608.1:\& HP DCE/9000 1.5 PHSS_20608 Module: libcma.1 (Export)\& Date: Dec 8 1999 18:41:23\& libcma\-23672.1:\& HP DCE/9000 1.5 PHSS_23672 Module: libcma.1 (Export)\& Date: Apr 9 2001 10:01:06\& d3:/usr/lib 107 >.Ve.PPIf you choose for the \s-1PTH\s0 package, use swinstall to install pth inthe default location (/opt/pth), and then make symbolic links to thelibraries from /usr/lib.PP.Vb 2\& # cd /usr/lib\& # ln \-s /opt/pth/lib/libpth* ..Ve.PPFor building perl to support Oracle, it needs to be linked with libcland libpthread. So even if your perl is an unthreaded build, theselibraries might be required. See \*(L"Oracle on HP-UX\*(R" below..Sh "64\-bit Perl on HP-UX".IX Subsection "64-bit Perl on HP-UX"Beginning with HP-UX 11.00, programs compiled under HP-UX can takeadvantage of the \s-1LP64\s0 programming environment (\s-1LP64\s0 means Longs andPointers are 64 bits wide), in which scalar variables will be ableto hold numbers larger than 2^32 with complete precision. Perl hasproven to be consistent and reliable in 64bit mode since 5.8.1 onall HP-UX 11.xx..PPAs of the date of this document, Perl is fully 64\-bit compliant onHP-UX 11.00 and up for both cc\- and gcc builds. If you are about tobuild a 64\-bit perl with \s-1GNU\s0 gcc, please read the gcc section carefully..PPShould a user have the need for compiling Perl in the \s-1LP64\s0 environment,use the \-Duse64bitall flag to Configure. This will force Perl to becompiled in a pure \s-1LP64\s0 environment (with the +DD64 flag for \s-1HP\s0 C\-ANSI-C,with no additional options for \s-1GNU\s0 gcc 64\-bit on PA-RISC, and with\&\-mlp64 for \s-1GNU\s0 gcc on Itanium).If you want to compile Perl using gcc, you will have to get a version ofthe compiler that supports 64\-bit operations.).PPYou can also use the \-Duse64bitint flag to Configure. Although thereare some minor differences between compiling Perl with this flag versusthe \-Duse64bitall flag, they should not be noticeable from a Perl user'sperspective. When configuring \-Duse64bitint using a 64bit gcc on apa-risc architecture, \-Duse64bitint is silently promoted to \-Duse64bitall..PPIn both cases, it is strongly recommended that you use these flags whenyou run Configure. If you do not use do this, but later answer thequestions about 64\-bit numbers when Configure asks you, you may get aconfiguration that cannot be compiled, or that does not function asexpected..Sh "Oracle on HP-UX".IX Subsection "Oracle on HP-UX"Using perl to connect to Oracle databases through \s-1DBI\s0 and DBD::Oraclehas caused a lot of people many headaches. Read \s-1README\s0.hpux in theDBD::Oracle for much more information. The reason to mention it hereis that Oracle requires a perl built with libcl and libpthread, thelatter even when perl is build without threads. Building perl usingall defaults, but still enabling to build DBD::Oracle later on can beachieved using.PP.Vb 1\& Configure \-A prepend:libswanted=\*(Aqcl pthread \*(Aq ....Ve.PPDo not forget the space before the trailing quote..PPAlso note that this does not (yet) work with all configurations,it is known to fail with 64\-bit versions of \s-1GCC\s0..Sh "\s-1GDBM\s0 and Threads on HP-UX".IX Subsection "GDBM and Threads on HP-UX"If you attempt to compile Perl with (\s-1POSIX\s0) threads on an 11.X systemand also link in the \s-1GDBM\s0 library, then Perl will immediately core dumpwhen it starts up. The only workaround at this point is to relink the\&\s-1GDBM\s0 library under 11.X, then relink it into Perl..PPthe error might show something like:.PPPthread internal error: message: _\|\fI_libc_reinit()\fR failed, file: ../pthreads/pthread.c, line: 1096Return Pointer is 0xc082bf33sh: 5345 Quit(coredump).PPand Configure will give up..Sh "\s-1NFS\s0 filesystems and \fIutime\fP\|(2) on HP-UX".IX Subsection "NFS filesystems and utime on HP-UX"If you are compiling Perl on a remotely-mounted \s-1NFS\s0 filesystem, the testio/fs.t may fail on test #18. This appears to be a bug in HP-UX and nofix is currently available..Sh "perl \-P and // and HP-UX".IX Subsection "perl -P and // and HP-UX"If HP-UX Perl is compiled with flags that will cause problems if the\&\-P flag of Perl (preprocess Perl code with the C preprocessor beforeperl sees it) is used. The problem is that \f(CW\*(C`//\*(C'\fR, being a \*(C+\-styleuntil-end-of-line comment, will disappear along with the remainderof the line. This means that common Perl constructs like.PP.Vb 1\& s/foo//;.Ve.PPwill turn into illegal code.PP.Vb 1\& s/foo.Ve.PPThe workaround is to use some other quoting separator than \f(CW"/"\fR,like for example \f(CW"!"\fR:.PP.Vb 1\& s!foo!!;.Ve.Sh "HP-UX Kernel Parameters (maxdsiz) for Compiling Perl".IX Subsection "HP-UX Kernel Parameters (maxdsiz) for Compiling Perl"By default, HP-UX comes configured with a maximum data segment size of64MB. This is too small to correctly compile Perl with the maximumoptimization levels. You can increase the size of the maxdsiz kernelparameter through the use of \s-1SAM\s0..PPWhen using the \s-1GUI\s0 version of \s-1SAM\s0, click on the Kernel Configurationicon, then the Configurable Parameters icon. Scroll down and selectthe maxdsiz line. From the Actions menu, select the Modify ConfigurableParameter item. Insert the new formula into the Formula/Value box.Then follow the instructions to rebuild your kernel and reboot yoursystem..PPIn general, a value of 256MB (or \*(L"256*1024*1024\*(R") is sufficient forPerl to compile at maximum optimization..SH "nss_delete core dump from op/pwent or op/grent".IX Header "nss_delete core dump from op/pwent or op/grent"You may get a bus error core dump from the op/pwent or op/grenttests. If compiled with \-g you will see a stack trace much likethe following:.PP.Vb 10\& #0 0xc004216c in () from /usr/lib/libc.2\& #1 0xc00d7550 in _\|_nss_src_state_destr () from /usr/lib/libc.2\& #2 0xc00d7768 in _\|_nss_src_state_destr () from /usr/lib/libc.2\& #3 0xc00d78a8 in nss_delete () from /usr/lib/libc.2\& #4 0xc01126d8 in endpwent () from /usr/lib/libc.2\& #5 0xd1950 in Perl_pp_epwent () from ./perl\& #6 0x94d3c in Perl_runops_standard () from ./perl\& #7 0x23728 in S_run_body () from ./perl\& #8 0x23428 in perl_run () from ./perl\& #9 0x2005c in main () from ./perl.Ve.PPThe key here is the \f(CW\*(C`nss_delete\*(C'\fR call. One workaround for thisbug seems to be to create add to the file \fI/etc/nsswitch.conf\fR(at least) the following lines.PP.Vb 2\& group: files\& passwd: files.Ve.PPWhether you are using \s-1NIS\s0 does not matter. Amazingly enough,the same bug also affects Solaris..SH "Miscellaneous".IX Header "Miscellaneous"HP-UX 11 Y2K patch \*(L"Y2K\-1100 B.11.00.B0125 HP-UX Core \s-1OS\s0 Year 2000Patch Bundle\*(R" has been reported to break the io/fs test #18 whichtests whether \fIutime()\fR can change timestamps. The Y2K patch seems tobreak \fIutime()\fR so that over \s-1NFS\s0 the timestamps do not get changed(on local filesystems \fIutime()\fR still works). This has probably beenfixed on your system by now..SH "AUTHOR".IX Header "AUTHOR"H.Merijn Brand <h.m.brand@xs4all.nl>Jeff Okamoto <okamoto@corp.hp.com>.PPWith much assistance regarding shared libraries from Marc Sabatella..SH "DATE".IX Header "DATE"Version 0.8.0: 2007\-09\-09
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -