[collectd] collectd-4.1.2 compiling bug

Sebastian Harl sh at tokkee.org
Mon Oct 1 11:43:21 CEST 2007


Hi Alex,

On Mon, Oct 01, 2007 at 11:09:03AM +0300, a.shubnik at btis.by wrote:
>    But when i start compiling on x86_64 machine (with  
> kernel-2.6.16.53-0.8-smp
> and libnlink-2.6.15-14.4) got error:
> 
> ...
> make[3]: Entering directory `/usr/local/src/collectd-4.1.2/src'
> /bin/sh ../libtool --tag=CC --mode=link gcc -Wall -Werror -g -O2   -o  
> netlink.la -rpath /usr/local/stow/collectd-4.1.2/lib/collectd -module  
> -avoid-version netlink_la-netlink.lo -lnetlink
> gcc -shared  .libs/netlink_la-netlink.o  -lnetlink  -Wl,-soname  
> -Wl,netlink.so -o .libs/netlink.so
> /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld:  
> /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/libnetlink.a(libnetlink.o):  
> relocation R_X86_64_32 against `a local symbol' can not be used when  
> making a shared object; recompile with -fPIC
> /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/libnetlink.a:  
> could not read symbols: Bad value
> collect2: ld returned 1 exit status

This is a problem on 64 bit architectures. You cannot link a static library
(which has been compiled without -fPIC) into a shared object. For some reason
most 32 bit architectures (obviously including i386) don't care about that.
Most Linux distributors (including Debian and SuSE) seem to not realize that
(or not really care about it). You have to ask your distributor to provide a
version of the netlink library (and probably iptables and nut) compiled with
-fPIC or compile it yourself.

See Debian bugs #419684 ([1]) and #358637 ([2]) for more details on this
issue.

HTH,
Sebastian

[1] http://bugs.debian.org/419684
[2] http://bugs.debian.org/358637

-- 
Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20071001/67cce0f3/attachment.pgp 


More information about the collectd mailing list