in reply to Loading a 32-bit library via DynaLoader into 64-bit Perl 5.8.8 on HP-UX 11i

Generally, you can't mix different binary formats in one program (i.e. executable + libs). If this is an Itanium based system (which I'm assuming), you typically have support for IA64 (native) and - for compatibility - IA32 (sometimes via emulation) and PA-RISC (the latter comes in several flavors, too). This doesn't always make things easy...

I'm afraid the short answer is, you'll have to build a Perl that matches your library - unless you can get a library that matches your Perl (from your description I'm assuming you don't have the sources of the lib).

BTW, what kind of library is this? Does your vendor actually ship a precompiled Perl extension without an appropriate Perl executable, or is this some more generic library for which you want to write the XS glue code yourself?

In any case, you need to find out exactly what type of lib you have. Basic info can be obtained with "file yourlib.s[lo]" (unfortunately, some HP-UXs come with a slightly buggy "magic" file (upon which the file utility bases its decisions), so you might want to cross-check with "chatr yourlib.s[lo]" (though the latter will usually only work for either IA/ELF (new) or PA-RISC (old)) ...).   Things are somewhat complicated by the fact that it's recommended to also use the same compiler (system cc vs. gcc? / versions?) - ideally with the same options. So you'll probably want to ask your vendor for those details.

I'm sorry, but it's hard to give precise instructions without knowing more details (and building software under HP-UX is generally not for the faint-of-heart), so all I can do at the moment is wish you good luck... :)

Replies are listed 'Best First'.
Re^2: Loading a 32-bit library via DynaLoader into 64-bit Perl 5.8.8 on HP-UX 11i
by MidLifeXis (Monsignor) on Jan 31, 2007 at 19:19 UTC
    Generally, you can't mix different binary formats in one program (i.e. executable + libs)

    Yeah, that is what I was figuring.

    A little more information. This is a PA-RISC 2.0 system, library from vendor is an interface library, precompiled, and we <paraphrase>should have a compatable version of PERL (sic) for, get the source from www.cpan.org</paraphrase> blah blah blah. Of course there are no instructions as to what flags it needs, the Makefile.PL is definitely not perlish (it is called only for the "make uninstall" and "make install" targets, rest of commands, all common make targets, are done with an install.sh script), etc. I cannot say that I have seen anyone who "speaks Perl" there.

    Vendors library is SOM, and my perl is ELF, so I was guessing that I would need to recompile in 32-bit SOM mode. Oh well.

    I have the SA searching out a 32-bit gcc, and will be re-running my system build script using that. I guess I wait for the next upgrade (12 months or so) to go to 64-bit. Maybe by then they will support Itanium.

    Oh well, this is starting to turn into a rant / gripe, so I should probably just leave it at that. Thanks for your feedback.

    --MidLifeXis