[CLN-list] Multiple definition errors when natively compiling CLN 1.1.13 with GCC 3.4 for ARM target

Simon Pickering S.G.Pickering at bath.ac.uk
Tue Feb 27 00:03:38 CET 2007


Hello,

I'm attempting to compile CLN 1.1.13 using GCC 3.4 (inside scratchbox 
using qemu which allows GCC to be a native ARM compiler). I am 
compiling for the Nokia N800.

I'm compiling with the following configure command:

./configure --with-gmp --prefix=/usr

and with the following env vars:

CPPFLAGS="-DNO_ASM"
CXXFLAGS="-O2 -fno-exceptions -finline-limit=1000  -mfpu=vfp 
-mfloat-abi=softfp"

I get the following error (trimmed as the preceeding command is very long):

/bin/sh ../libtool --mode=link g++ -o libcln.la -rpath /usr/lib 
-version-info 4:2:0  -lgmp -objectlist libcln.objectlist
g++ -shared -nostdlib 
/scratchbox/compilers/cs2005q3.2-glibc-arm/lib/gcc/arm-none-linux-gnueabi/3.4.4/../../../../arm-none-linux-gnueabi/lib/crti.o

<snip>

.libs/cl_asm_.o  /usr/lib/libgmp.so 
-L/scratchbox/compilers/cs2005q3.2-glibc-arm/lib/gcc/arm-none-linux-gnueabi/3.4.4 -L/usr/lib/gcc/arm-none-linux-gnueabi/3.4.4 -L/scratchbox/compilers/cs2005q3.2-glibc-arm/lib/gcc/arm-none-linux-gnueabi/3.4.4/../../../../arm-none-linux-gnueabi/lib -lstdc++ -lm -lc -lgcc_s /scratchbox/compilers/cs2005q3.2-glibc-arm/lib/gcc/arm-none-linux-gnueabi/3.4.4/crtendS.o /scratchbox/compilers/cs2005q3.2-glibc-arm/lib/gcc/arm-none-linux-gnueabi/3.4.4/../../../../arm-none-linux-gnueabi/lib/crtn.o  -Wl,-soname -Wl,libcln.so.4 -o 
.libs/libcln.so.4.0.2
.libs/cl_I_ring.o: In function `cln::zerop(cln::cl_I 
const&)':cl_I_ring.cc:(.text._ZN3cln5zeropERKNS_4cl_IE[cln::zerop(cln::cl_I 
const&)]+0x0): multiple definition of `cln::zerop(cln::cl_I const&)'
.libs/cl_I_zerop.o:cl_I_zerop.cc:(.text+0x0): first defined here
.libs/cl_RA_ring.o: In function `cln::zerop(cln::cl_RA 
const&)':cl_RA_ring.cc:(.text._ZN3cln5zeropERKNS_5cl_RAE[cln::zerop(cln::cl_RA 
const&)]+0x0): multiple definition of `cln::zerop(cln::cl_RA const&)'
.libs/cl_RA_zerop.o:cl_RA_zerop.cc:(.text+0x0): first defined here
.libs/cl_R_signum.o: In function `cln::signum(cln::cl_I 
const&)':cl_R_signum.cc:(.text._ZN3cln6signumERKNS_4cl_IE[cln::signum(cln::cl_I const&)]+0x0): multiple definition of `cln::signum(cln::cl_I 
const&)'
.libs/cl_I_signum.o:cl_I_signum.cc:(.text+0x0): first defined here
collect2: ld returned 1 exit status
make[2]: *** [libcln.la] Error 1
make[2]: Leaving directory `/home/simon/build/qcalculate/cln-1.1.13.orig/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/simon/build/qcalculate/cln-1.1.13.orig'
make: *** [build] Error 2

I did a search of the mailing list archives and could only find this 
mentioned for MinGW. There was no solution as far as I could tell, but 
some talk of --param *inline* options that might make a difference. The 
installation instructions say the following: "If you use g++ on OSF/1 
or Tru64 using gcc-2.95.x, you should specify `--disable-shared' 
because of linker problems with duplicate symbols in shared 
libraries.", which sounds like my problem, though obviously on a 
different platform & compiler version.

I have tried altering -finline-limit (removing it, and changing the 
value to 10000), but to no avail, I still have the problem.

I am trying to compile Qalculate, and even if I compile CLN to be a 
static library, I get linking errors due to the multiple functions when 
compiling libqalculate.

Is there any way around this problem? Any other -finline*/--param 
options I could try, etc., or any other ideas?

Many thanks,


Simon

P.S. I'm not subscribed to the list, but can do so if needed.


More information about the CLN-list mailing list