View Single Post

  #2  
Old 08-25-2008, 05:59 PM
Default Re: compile 32-bit perl on 64bit redhat linux

Finally I figured it out.

Actually the 3rd method would work . The error I got was the 32bit
librarie files /usr/lib/libgdbm.so and /usr/lib/libdb.so are needed
for the compilation. The 64 bit version will not work. After I
installed the gdbm-devel and db4-devel, the compilation was good the
generated perl executable is ELF-32, which is what we are looking for.

Thanks.


On Aug 18, 10:21*am, BILL wrote:
> I am trying to compile 32bit perl on 64 bit redhat Enterprise Linux 4
> running. The gcc we have in the box is also 64 bit. The reason I need
> to compile 32 bit perl is because we were told some home-grown
> modules
> need 32bit perl.
>
> I tried a few ways, but none seemed working.
>
> After unpack the perl 5.10.0
> 1) setarch i386 ./Configure
> * * The perl was compiled successfully. But the executable is still 64
> bit
>
> 2) Configure
> * * When ptompted for the architecture, answered with "i386"
> * * *The perl was compiled successfully. But the executable is still
> 64 bit
>
> 3) Configure -des -Dcc="gcc -m32"
> * * get the following error:
>
> * * * * gcc -m32 -o try -O2 -fno-strict-aliasing -pipe -I/usr/local/
> include -L/usr/local/lib try.c -lnsl -lgdbm -ldb -ldl -lm -lcrypt -
> lutil -lc
> * * * * *./try
>
> and I got the following output:
>
> /usr/bin/ld: skipping incompatible /usr/lib64/libgdbm.so when
> searching for -lgdbm
> /usr/bin/ld: skipping incompatible /usr/lib64/libgdbm.a when searching
> for -lgdbm
> /usr/bin/ld: cannot find -lgdbm
> collect2: ld returned 1 exit status
> I can't compile the test program.
> You have a BIG problem. *Shall I abort Configure [y]
> Ok. *Stopping Configure.
>
> Do I have install 32bit gcc to compile? Can 64bit gcc and 32bit gcc co-
> exist in the box?
>
> Thanks.


Reply With Quote