GMP patch: MinGW/win64 port

Wesley W. Terpstra wesley at
Sun Dec 9 00:58:35 CET 2007

With the small attached patch, GMP compiles on MinGW/win64 using the  
latest cross compiler. The patch fixes the assumption that 'long = 64  
bits' on all intel 64 bit platforms. Under win64, long remains 32 bit  
< pointer size. Also, the ABI for windows differs from linux, so the  
patch disables linux-specific assembly, using the generic C instead.

The successful compile used the prebuilt cross-compiler mingw-w64- 
bin_i686_mings32_20071020.tar.bz2 with
./configure --build=athlon64-pc-mingw32 --host=x86_64-pc-mingw32 -- 
It is necessary to use 'malloc-reentrant' to forbid use of alloca,  
which appears to be broken under win64.

make check succeeds except for the tests t-locale and t-printf.
t-locale fails to compile because it tries to replace an imported  
function with a local copy of localeconv. Probably GMP shouldn't do  
t-printf fails because the win64 printf ignores the high 32 bits of  

In short, after this patch is applied, the remaining problems aren't  
GMP's fault.

I've CC'd the MLton list as this patch is relevant to a 64-bit windows  
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gmp-mingw64.patch
Type: application/octet-stream
Size: 5362 bytes
Desc: not available
Url : 
-------------- next part --------------

More information about the gmp-bugs mailing list