GMP 5.0.1 C++ "make check" on x86_64-w64-mingw32
Ruben Van Boxem
vanboxem.ruben at gmail.com
Thu Apr 21 17:27:27 CEST 2011
2011/4/19 Marc Glisse <marc.glisse at inria.fr>
> 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 ?
Wrong assumption on my part. I guessed configure woould be smart and append
my options to its defaults, guess that's not true :)
>
>
> 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?
I have no idea where to start looking. Probably some autocrap magic going
wrong for mingw?
>
>
> 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...
I commented out the localeconv (not nl_langinfo!) definition in
tests/cxx/clocale.c, and compilation proceeded peacefully. On top of that,
all 14 tests passed without a hitch. Commenting out isn't really a bug fix,
but this depends on autocrap magic I know nothing about. I'm sure you guys
know a whole lot better where to start looking for this. I'll be glad to
test fixes (but I'll need a configure, as autocrap on Windows/MSYS is
horribly broken).
>
>
> A side problem: test t-perfpow.exe crashes the runtime:
>>
>
> That one is explained on the gmplib.org main page.
>
Stupid I missed that. Will shut up about it now :)
>
> --
> Marc Glisse
>
More information about the gmp-bugs
mailing list