ld: fatal: symbol `__gmpz_abs' is multiply-defined:

Andreev Konstantin andreev at swemel.ru
Tue Jun 23 12:31:42 CEST 2009

Hello, Marc.

The same problem with gmp-4.3.1 has been demonstrated on: 

   Solaris 10 x86_64 + SunStudio Express 2009/03.

and the your cure also works. Exact system specification:

[andreev at jabba t]$ cc -V
cc: Sun C 5.9 SunOS_i386 Patch 124868-01 2007/07/12
[andreev at jabba t]$ uname -a
SunOS jabba 5.11 snv_109 i86pc i386 i86xpv
[andreev at jabba t]$ cat /etc/release 
                  Solaris Express Community Edition snv_109 X86
                           Assembled 23 February 2009
[andreev at jabba t]$ ./configure --prefix=/usr --disable-static
checking build system type... core2-pc-solaris2.11
checking host system type... core2-pc-solaris2.11
using ABI="64"
      CFLAGS="-xO3 -m64"
      MPN_PATH=" x86_64/core2 x86_64 generic"

Best regards,
Konstantin Andreev

On Sunday, 31/05/2009 00:55 +0200, Marc Glisse wrote:
> On Sat, 30 May 2009, Dennis Clarke wrote:
> > ld: fatal: symbol `__gmpz_abs' is multiply-defined:
> >        (file .libs/assert.o type=FUNC; file mpz/.libs/abs.o type=FUNC);
> In gmp-h.in, you have the following:
> /* Recent enough Sun C compilers accept "extern inline" */
> #if defined (__SUNPRO_C) && __SUNPRO_C >= 0x560 \
>    && ! defined (__GMP_EXTERN_INLINE)
> #define __GMP_EXTERN_INLINE  extern inline
> #endif
> /* Somewhat older Sun C compilers accept "static inline" */
> #if defined (__SUNPRO_C) && __SUNPRO_C >= 0x540 \
>    && ! defined (__GMP_EXTERN_INLINE)
> #define __GMP_EXTERN_INLINE  static inline
> #endif
> If you remove the first block, things work better. Now I am off to try and understand what goes wrong with the "extern inline" version, my basic tests seemed to imply that it should work... Apparently, putting just "inline" also fails with a weird message about non-PIC code. At least "static inline" works...
> Sorry about that.

More information about the gmp-bugs mailing list