Hello, I have an inline::c app that works just fine on a 32-bit linux
box.  The problem I have is trying to get it installed/working on a
x86-64 SuSE 9.1 pro box.  The inline::c app is a wrapper around a 
32-bit third party library (closed source)

To get it to compile a 32 bit application, I have the following:

use Inline C => Config =>
    CC => 'gcc',
    CCFLAGS => '-m32',
    LD => 'gcc',
    LDDLFLAGS => '-m32 -shared',
    LIBS => '-L/opt/ams -lz4lnx',
    PRINT_INFO => 1,
    BUILD_NOISY => 1,
    INC => '-I/opt/ams';

The code compiles, but fails to load in the DynaLoader.  I am guessing
that it is a problem with 32 bit shared module being loaded into a 64
bit perl space, but I am guessing.

Here is the trace of the compile:
--BEGIN--
<-----------------------Information Section----------------------------------->

Information about the processing of your Inline C code:

Your source code needs to be compiled. I'll use this build directory:
/opt/project/zip4/_Inline/build/ZIP4_PARM_59d8

and I'll install the executable as:
/opt/project/zip4/_Inline/lib/auto/ZIP4_PARM_59d8/ZIP4_PARM_59d8.so

The following Inline C function(s) have been successfully bound to Perl:
        void DESTROY(SV * obj)
        char * abcty(SV * obj)
        char * addon(SV * obj)
        char * adrkey(SV * obj)
        char auto_zone_ind(SV * obj)
        char * county(SV * obj)
        char * cris(SV * obj)
        char * dadl1(SV * obj)
        char * dadl2(SV * obj)
        char * dadl3(SV * obj)
        char * dctya(SV * obj)
        char * dctys(SV * obj)
        char * dlast(SV * obj)
        char * dpbc(SV * obj)
        char * dprurb(SV * obj)
        char * dstaa(SV * obj)
        char * dstas(SV * obj)
        char * iadl1(SV * obj)
        char * iadl2(SV * obj)
        char * iadl3(SV * obj)
        char * ictyi(SV * obj)
        char * iprurb(SV * obj)
        SV * new(char * class, char * iadl1, char * iadl3, char * iadl2, char * ictyi)
        short respn(SV * obj)
        int retcc(SV * obj)
        void z4_close(SV * obj)
        char * zipc(SV * obj)

<-----------------------End of Information Section---------------------------->
Starting Build Prepocess Stage
Finished Build Prepocess Stage

Starting Build Parse Stage
Finished Build Parse Stage

Starting Build Glue 1 Stage
Finished Build Glue 1 Stage

Starting Build Glue 2 Stage
Finished Build Glue 2 Stage

Starting Build Glue 3 Stage
Finished Build Glue 3 Stage

Starting Build Compile Stage
  Starting "perl Makefile.PL" Stage
Writing Makefile for ZIP4_PARM_59d8
  Finished "perl Makefile.PL" Stage

  Starting "make" Stage
/usr/bin/perl /usr/lib/perl5/5.8.3/ExtUtils/xsubpp  -typemap
/usr/lib/perl5/5.8.3/ExtUtils/typemap   ZIP4_PARM_59d8.xs >
ZIP4_PARM_59d8.xsc && mv ZIP4_PARM_59d8.xsc ZIP4_PARM_59d8.c

gcc -c  -I/opt/project/zip4 -I/opt/ams -m32 -O2 -fmessage-length=0
-Wall -Wall -pipe   -DVERSION=\"0.00\" -DXS_VERSION=\"0.00\" -fPIC
"-I/usr/lib/perl5/5.8.3/x86_64-linux-thread-multi/CORE"
ZIP4_PARM_59d8.c

Running Mkbootstrap for ZIP4_PARM_59d8 ()
chmod 644 ZIP4_PARM_59d8.bs
rm -f blib/arch/auto/ZIP4_PARM_59d8/ZIP4_PARM_59d8.so
LD_RUN_PATH="/opt/ams" gcc  -m32 -shared ZIP4_PARM_59d8.o  -o
blib/arch/auto/ZIP4_PARM_59d8/ZIP4_PARM_59d8.so   -L/opt/ams -lz4lnx    
chmod 755 blib/arch/auto/ZIP4_PARM_59d8/ZIP4_PARM_59d8.so
cp ZIP4_PARM_59d8.bs blib/arch/auto/ZIP4_PARM_59d8/ZIP4_PARM_59d8.bs
chmod 644 blib/arch/auto/ZIP4_PARM_59d8/ZIP4_PARM_59d8.bs
  Finished "make" Stage

  Starting "make install" Stage
Installing /opt/project/zip4/_Inline/lib/auto/ZIP4_PARM_59d8/ZIP4_PARM_59d8.bs
Installing /opt/project/zip4/_Inline/lib/auto/ZIP4_PARM_59d8/ZIP4_PARM_59d8.so
Files found in blib/arch: installing files in blib/lib into architecture dependent 
library tree
Writing /opt/project/zip4/_Inline/lib/auto/ZIP4_PARM_59d8/.packlist
  Finished "make install" Stage

  Starting Cleaning Up Stage
  Finished Cleaning Up Stage

Finished Build Compile Stage

Had problems bootstrapping Inline module 'ZIP4_PARM_59d8'

Can't load
'/opt/project/zip4/_Inline/lib/auto/ZIP4_PARM_59d8/ZIP4_PARM_59d8.so'
for module ZIP4_PARM_59d8:
/opt/project/zip4/_Inline/lib/auto/ZIP4_PARM_59d8/ZIP4_PARM_59d8.so:
cannot open shared object file: No such file or directory at
/usr/lib/perl5/5.8.3/x86_64-linux-thread-multi/DynaLoader.pm line
229. 
 at /usr/lib/perl5/vendor_perl/5.8.3/Inline.pm line 500


 at ZIP4_PARM.pm line 71
BEGIN failed--compilation aborted at ZIP4_PARM.pm line 246.
Compilation failed in require at ./simpleZip4.pl line 16.
BEGIN failed--compilation aborted at ./simpleZip4.pl line 16.
--END--

The file exists and is a 32 bit ELF file.
file /opt/project/zip4/_Inline/lib/auto/ZIP4_PARM_59d8/ZIP4_PARM_59d8.so 
/opt/project/zip4/_Inline/lib/auto/ZIP4_PARM_59d8/ZIP4_PARM_59d8.so:
ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), not
stripped


perl -V results:
--BEGIN--
Summary of my perl5 (revision 5.0 version 8 subversion 3) configuration:
  Platform:
    osname=linux, osvers=2.6.4, archname=x86_64-linux-thread-multi
    uname='linux reger 2.6.4 #1 smp wed mar 31 11:30:50 utc 2004 x86_64 x86_64 x86_64 
gnulinux '
    config_args='-ds -e -Dprefix=/usr -Dvendorprefix=/usr
                 -Dinstallusrbinperl -Dusethreads -Di_db -Di_dbm -Di_ndbm -Di_gdbm
                 -Duseshrplib=true -Doptimize=-O2 -fmessage-length=0 -Wall -Wall -pipe'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=define use64bitall=define uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS 
-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2 -fmessage-length=0 -Wall -Wall -pipe',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing'
    ccversion='', gccversion='3.3.3 (SuSE Linux)', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib64'
    libpth=/lib64 /usr/lib64 /usr/local/lib64
    libs=-lm -ldl -lcrypt -lpthread
    perllibs=-lm -ldl -lcrypt -lpthread
    libc=/lib64//lib64/libc.so.6, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version='2.3.3'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic 
-Wl,-rpath,/usr/lib/perl5/5.8.3/x86_64-linux-thread-multi/CORE'
    cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib64'


Characteristics of this binary (from libperl): 
  Compile-time options: MULTIPLICITY USE_ITHREADS USE_64_BIT_INT USE_64_BIT_ALL 
USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
  Built under linux
  Compiled at Apr  3 2004 00:47:45
  %ENV:
    PERL_DL_NONLAZY="1"
  @INC:
    /usr/lib/perl5/5.8.3/x86_64-linux-thread-multi
    /usr/lib/perl5/5.8.3
    /usr/lib/perl5/site_perl/5.8.3/x86_64-linux-thread-multi
    /usr/lib/perl5/site_perl/5.8.3
    /usr/lib/perl5/site_perl
    /usr/lib/perl5/vendor_perl/5.8.3/x86_64-linux-thread-multi
    /usr/lib/perl5/vendor_perl/5.8.3
    /usr/lib/perl5/vendor_perl
--END--



Any one with ideas?

Thanks.
--
Brian Millett - [ Delenn (to Teronn), "A Distant Star"]
"I am more 'one of us' at this moment, than I have ever been. More than
you will ever know."


Reply via email to