Calling a 32 bit Library from 64 bit perl extension
am 24.09.2007 19:01:41 von 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?
Re: Calling a 32 bit Library from 64 bit perl extension
am 25.09.2007 00:11:42 von Ben Morrow
Quoth sstoural@gmail.com:
> 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