GMP 5.0.1 C++ "make check" on x86_64-w64-mingw32

Marc Glisse marc.glisse at
Tue Apr 19 20:14:48 CEST 2011

On Tue, 19 Apr 2011, Ruben Van Boxem wrote:

> I have problems with "make check" part in GMP 5.0.1 I am using mingw-w64
> (GCC 4.5.2):
> ../../src/gmp-5.0.1/configure --host=x86_64-w64-mingw32
>> --build=x86_64-w64-mingw32 --disable-static --enable-shared --enable-cxx
>> CFLAGS="-mtune=core2 -fomit-frame-pointer -momit-leaf-frame-pointer"
>> --prefix=/home/Ruben/mingw64/x64/libs

Really, no -O ?

> The main problem: make check in the main directory does not run the cxx
> tests.

Strange (but then I don't have mingw to see such things). Any idea why?

> Running make check in the tests/cxx directory does, but these fail
> due to conflicting symbols in the test objects and msvcrt.a, which is the
> platform's C runtime. Either renaming the symbol or using the msvcrt version
> of the function should solve the problem:
> libtool: link: x86_64-w64-mingw32-g++ -mtune=core2 -fomit-frame-pointer
>> -momit-leaf-frame-pointer -o .libs/t-locale.exe t-locale.o clocale.o
>> -L/home/Ruben/mingw64/x64/gmp/.libs ../../tests/.libs/libtests.a
>> ../../.libs/libgmpxx.dll.a /home/Ruben/mingw64/x64/gmp/.libs/libgmp.dll.a
>> ../../.libs/libgmp.dll.a -L/home/Ruben/mingw64/x64/libs/lib
> m:/development/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.5.2/../../../../x86_64-w64-mingw32/lib/libmsvcrt.a(dgtbbs01029.o):(.text+0x0):
>> multiple definition of `localeconv'
> clocale.o:clocale.c:(.text+0x0): first defined here
> collect2: ld returned 1 exit status
> make[1]: *** [t-locale.exe] Error 1
> Either configure should check if the symbol is already present and #ifdef it
> away, or it should be removed completely from GMP code.

(actually configure only redefines it if it exists ;-)

I think I heard of that one before. And you don't have any problem with 
misc/t-locale.c which also redefines localeconv...

It seems that with mingw64, nl_langinfo is the function that matters and 
that the redefinition of localeconv has no effect (someone can check that 
by removing either redefinition from tests/cxx/clocale.c and checking that 
in one case the test passes and in the other it breaks) and that 
redefining nl_langinfo doesn't cause any linker error, so a very brittle 
workaround should be possible...

> A side problem: test t-perfpow.exe crashes the runtime:

That one is explained on the main page.

Marc Glisse

More information about the gmp-bugs mailing list