[CentOS] Re: /usr/bin/ld: skipping incompatible

Fri Mar 7 09:04:09 UTC 2008
Nicolas Thierry-Mieg <Nicolas.Thierry-Mieg at imag.fr>


Scott Silva wrote:
<snip>
>> Can anyone explain me "/usr/bin/ld: skipping incompatible" in plain
>> english ;) How to solve it?
>>
> 
> It is very difficult to build 64 bit software when 32 bit libs are 
> present because the 32 bit lib path gets searched first.

this is not true by default on centos5.
I just tested with both i386 and x86_64 expat and expat-devel packages 
installed, and compiled a program that includes expat:
$ ldd ipoolValidation
         libm.so.6 => /lib64/libm.so.6 (0x0000003d4d600000)
         libexpat.so.0 => /lib64/libexpat.so.0 (0x0000003d4fa00000)
         libc.so.6 => /lib64/libc.so.6 (0x0000003d4d200000)
         /lib64/ld-linux-x86-64.so.2 (0x0000003d4c200000)


The problem is with the snmppd Makefile:
 >> Making all in snmppd
 >> make[2]: Entering directory `/tmp/snmppd-0.5.2/snmppd'
 >> gcc  -Wall -Wno-uninitialized -Wchar-subscripts -Wmissing-declarations
 >> -Wmissing-prototypes -Wnested-externs -Wpointer-arith
 >> -Wno-sign-compare -Werror  -L/usr/lib  -o snmppd  conf.o control.o
 >> log.o queue.o snmp.o snmppd.o threads.o utils.o -lnetsnmp  -lcrypto
 >> -lpthread

that -L/usr/lib is causing the problem and breaking the build on x86_64. 
Is there a really good reason it's there?
This should be picked up with the upstream devs.