Showing posts with label hp-ux. Show all posts
Showing posts with label hp-ux. Show all posts

Wednesday, October 12, 2005

64-bit perl on HP-UX (PARISC or Itanium)

Here's something that took me a few hours to get dialed in. This is all set for linking DBD::Oracle and DBD::Sybase to their respective 64-bit client libraries without hassle. I'm assuming the HP ANSI C compiler is installed. I never even tried with gcc due to some custom extensions that require the HP compiler.


CC=/opt/ansic/bin/cc \
CXX=/opt/aCC/bin/aCC \
CFLAGS="+DD64 +Z -I/opt/perl-5.8/local/include" \
CXXFLAGS=$CFLAGS \
LDFLAGS="-L/opt/perl-5.8/local/lib -L/usr/lib/hpux64" \
PATH=/opt/ansic/bin:/usr/ccs/bin:/opt/perl-5.8/local/bin:/opt/perl-5.8/bin:/usr/bin:/usr/local/bin:/bin:/sbin \
PERL=/opt/perl-5.8/bin/perl \
MAKE=/usr/local/bin/gmake \
./Configure -der \
-A prepend:libswanted='cl pthread ' \
-Dprefix=/opt/perl-5.8 \
-Dinstallprefix=/opt/perl-5.8 \
-Duselargefiles \
-Dusethreads \
-Duse64bitall \
-Dyacc='/usr/local/bin/bison -y' \
-Uusemallocwrap \
-Dcf_by="Al Tobey" \
-Dperladmin='tobert@gmail.com' \
-Dcf_email='tobert@gmail.com'

make
make test
make install

(cd /usr/include; /opt/perl-5.8/bin/h2ph -r -l .)

Tuesday, September 20, 2005

pdksh 5.2.14 on HP-UX 11.23 Itanium: If you grab the source for pdksh and try to compile it on Itanium HP-UX, it will tend to dump core with SIGBUS. SIGBUS is a signal sent to processes when they access unaligned memory, usually in C unions or structs. pdksh has a union in it that ends up unaligned on Itanium, which is very particular about such things. HP-UX is also fussy.

Go into the source tree and open up "alloc.c" in your favorite editor. Search for "union Cell", which is the union declaration that is causing the trouble. Change the last member "double djunk; /* alignement */" to "long double djunk; /* alignemnt */." On Itanic, long double is 128 bits and double is 64 bits. Pushing the union out to 128 bits makes it align right all the time, even though it does eat up a bit more memory now.

I also have a patch at work that logs all commands run by root to syslog with the username of the owner of the terminal device. It's a fancy way to avoid typing "sudo" in front of everything while still logging every command for auditing purposes. Unfortunately, I probably can't post that patch.