Calling a 32 bit Library from 64 bit perl extension

S

sstoural

Because of an OS port, I'm faced with a situation where a 64-bit
version of perl (5.8.8) is installed on a Suse Linux 10 server that
needs to call a proprietary 32 bit library. Is there a way to create
a 32 bit extension from a 64 bit version of Perl by forcing xsubpp to
use the 32 bit compiler?
 
B

Ben Morrow

Quoth (e-mail address removed):
Because of an OS port, I'm faced with a situation where a 64-bit
version of perl (5.8.8) is installed on a Suse Linux 10 server that
needs to call a proprietary 32 bit library. Is there a way to create
a 32 bit extension from a 64 bit version of Perl by forcing xsubpp to
use the 32 bit compiler?

You can set the C compiler to use with the CC MakeMaker parameter, and
the linker with LD. I can't see an easy way to do this with either
Module::Build (perhaps config(cc => $cc) would work?) or
Module::Install. If instead you want the same compiler but with
different options you can put them in the CFLAGS parameter.

However, I would expect you would get fairly serious link problems,
either when linking the .so or when loading it into perl. I don't really
know anything about 64bit systems (never having owned one), but is it
even possible to load a 32bit library from a 64bit program? Don't they
require different versions of libc?

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,961
Messages
2,570,131
Members
46,689
Latest member
liammiller

Latest Threads

Top