compile 32-bit perl on 64bit redhat linux

This is a discussion on compile 32-bit perl on 64bit redhat linux within the Redhat forums, part of the Linux category; 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 ...

Go Back   Unix Linux Forum > Unix > Linux > Redhat

FixUnix.com - Unix Linux Forums

Unix Content Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-18-2008, 11:21 AM
Default compile 32-bit perl on 64bit redhat linux


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
  #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
Reply

Thread Tools


All times are GMT -5. The time now is 01:06 PM.

In an effort to better serve ads to our visitors, cookies are used on Fixunix.com. For more information, check out our Privacy Policy.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Ad Management by RedTyger