Compiling 32-bit binary in a 64-bit environment
Hi all!
I ran into some problems while compiling a binary file for an application which is only compatible on 32-bit platforms. I'm using the following distribution:
Red Hat Enterprise Linux ES (v. 3 for Intel EM64T, update 2) <recently patched via up2date>
The problem occurs when I run the following:
cc -rdynamic -o /opt/CA/ingresii/ingres/bin/iimerge /opt/CA/ingresii/ingres/lib/iimerge.o -L/opt/CA/ingresii/ingres/lib -lbecompat.1 -lscf.1 -lpsf.1 -lopf.1 -lrdf.1 -lqef.1 -lqsf.1 -ldbutil.1 -ltpf.1 -lrqf.1 -lgcf.1 -lsxf.1 -lcuf.1 -lgwf.1 -ldmf.1 -lulf.1 -lcompat.1 -lq.1 -lframe.1 /opt/CA/ingresii/ingres/lib/iiclsadt.o /opt/CA/ingresii/ingres/lib/iiuseradt.o /opt/CA/ingresii/ingres/lib/libsd.a
Which resulted in the output below:
/usr/bin/ld: skipping incompatible /opt/CA/ingresii/ingres/lib/libbecompat.1.so when searching for -lbecompat.1
/usr/bin/ld: cannot find -lbecompat.1
collect2: ld returned 1 exit status
After checking the compatibility list it seems that the application does not support EM64T platforms - hence the failure to compile iimerge as seen above. Then it got me thinking; if I could use related 32-bit native c libraries on the 64-bit platform, would it be possible to successfully compile the binary?
Just to confirm that glibc is indeed the culprit, I did a comparison for both 32bit and 64bit versions of binutils (where 'ld' is part of the package), and got the following dependencies:
[root@localhost root]# rpm binutils-2.14.90.0.4-26 -qR
/bin/sh
/bin/sh
/sbin/install-info
/sbin/ldconfig
libbfd-2.14.90.0.4.so
libc.so.6
libc.so.6(GLIBC_2.0)
libc.so.6(GLIBC_2.1)
libc.so.6(GLIBC_2.1.3)
libc.so.6(GLIBC_2.2.3)
libc.so.6(GLIBC_2.3)
libdl.so.2
libdl.so.2(GLIBC_2.0)
libdl.so.2(GLIBC_2.1)
libopcodes-2.14.90.0.4.so
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
[root@localhost root]# rpm binutils-2.14.90.0.4-35.x86_64.rpm -qpR
warning: binutils-2.14.90.0.4-35.x86_64.rpm: V3 DSA signature: NOKEY, key ID db42a60e
/bin/sh
/bin/sh
/sbin/install-info
/sbin/ldconfig
libbfd-2.14.90.0.4.so()(64bit)
libc.so.6()(64bit)
libc.so.6(GLIBC_2.2.5)(64bit)
libc.so.6(GLIBC_2.3)(64bit)
libdl.so.2()(64bit)
libdl.so.2(GLIBC_2.2.5)(64bit)
libopcodes-2.14.90.0.4.so()(64bit)
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
So it looks like we're dealing with two different sets of standard C libraries for each platform.
It's a longshot, but has anyone tried to use 32-bit libraries to successfully compile in a 64-bit env?
Many thanks in advance!
Last edited by Kaj; 12-12-2004 at 11:21 PM.
|