in reply to Re: 32bit lib on 64bit system
in thread 32bit lib on 64bit system

We already had 32bit gcc installed, as we've had to compile other 32bit software. Those packages we installed are gcc-32bit, libstdc++42-devel-32bit, and libstdc++42-32bit.

Thanks to that rpm command, I learned that perl-32bit does indeed install a bunch of library (.a, .o, .so) files under /usr/lib/perl5/5.8.8/i586-linux-thread-multi. Just library files, no .pm or .h files-- guess all those are the same as under x86_64.

I got ICS to compile by altering the Makefile generated by "perl Makefile.PL". Changed every "x86_64-linux-thread-multi" to "i586-linux-thread-multi", which caused errors about not being able to find Config.pm, then not being able to find config.h. Changed PERL_ARCHLIB and PERL_INC back to x86_64-linux-thread-multi to fix those. Next, I ran make with some flags: make PASTHRU_INC='-m32' LD='cc -m32' ("-march=i386" only gives an error "CPU you selected does not support x86-64 instruction set"). That finally made ICS.c compile, and I got a file blib/arch/auto/ICS/ICS.so that is 32bit. Seems there ought to be an easier way to do that, some flag I can pass for "perl Makefile.PL".

But it still doesn't work. Now when I try "make test", upon reaching the line with "use ICS;", I get:

Can't load '.../blib/arch/auto/ICS/ICS.so' for module ICS: ... wrong ELF class: ELFCLASS32 at /usr/lib/perl5/5.8.8/x86_64-linux-thread-multi/DynaLoader.pm line 230.

Replies are listed 'Best First'.
Re^3: 32bit lib on 64bit system
by zwon (Abbot) on Nov 25, 2008 at 16:50 UTC
    It looks like make test runs 64 bit version of perl
Re^3: 32bit lib on 64bit system
by almut (Canon) on Nov 25, 2008 at 20:21 UTC

    You'd need to run Makefile.PL with the appropriate 32-bit perl binary.  Yes, I know, there wasn't one... but now that there is (i.e. after you've installed all required 32-bit files as described below), that would be

    /usr/bin/perl32 Makefile.PL

    Good luck!