]> git.puffer.fish Git - mirror/frr.git/commit
lib/memory: fix indirect static link with zlib
authorBaruch Siach <baruch@tkos.co.il>
Fri, 2 Sep 2016 03:42:08 +0000 (06:42 +0300)
committerDonald Sharp <sharpd@cumulusnetwroks.com>
Fri, 2 Sep 2016 16:54:22 +0000 (12:54 -0400)
commitbfe15094c260719095c92ecc617ad29fdda160eb
tree7fc33e58f8b4d5ef294178a47c6202e798b3a714
parent4c2f8e95a1ae558be380da0a2f42fea5a02785d3
lib/memory: fix indirect static link with zlib

quagga SNMP support depends on netsnmp, that optionally depends on OpenSSL,
which in turn requires zlib. zlib exports the 'zcalloc' symbol, which collides
with a function of the same name in memory.c. This is not a problem when
linking dynamically, since quagga does not use zlib directly. But static
linking fails with the error:

  CCLD     ospfd
.../output/host/usr/mips64el-buildroot-linux-uclibc/sysroot/usr/lib/libz.a(zutil.o): In function `zcalloc':
zutil.c:(.text+0x48): multiple definition of `zcalloc'
.../output/build/quagga-1.0.20160315/lib/.libs/libzebra.a(memory.o):memory.c:(.text+0x1a0): first defined here

Rename 'zcalloc' to 'zzcalloc' to avoid symbol collision.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
lib/memory.c
lib/memory.h