Win64 and GMP

Myria myriachan at cox.net
Thu Dec 28 02:01:41 CET 2006


Yes, that does look fairly complete, except for the issues I outlined.  As 
far as I know, Yasm does not support the mandatory function markup required 
by Windows x86-64, and as such the DLLs produced this way are invalid 
executables.  If an exception were to occur in one of those assembly 
language routines, even one that is automatically recovered by ntdll.dll, 
the process will be terminated without an error message.  (This is because 
ntdll.dll assumes that an exploit has occurred, and the complex procedure to 
display a message box stands a good chance of executing shellcode if memory 
has been corrupted.)

Melissa

----- Original Message ----- 
From: "Michael Abshoff" <Michael.Abshoff at fsmath.mathematik.uni-dortmund.de>
To: "Myria" <myriachan at cox.net>
Cc: <gmp-devel at swox.com>
Sent: Wednesday, December 27, 2006 06:17
Subject: Re: Win64 and GMP


Myria wrote:

Hello Myria,

> Currently, there is no Win64 (x86-64) build of GMP, and from the current
> situation, it would be difficult to make one.

You will find little love for Windows on this mailing list. If you check
the archives you will find plenty of evidence.

>
> As far as I know, the only compilers and assemblers that can do Win64 are
> Microsoft's and Intel's.  GAS can do x86-64 obviously, but it cannot
> currently do the mandatory function markup required by Win64 (the ".pdata"
> section).  GCC is a bigger problem - its x86-64 compiler assumes that all
> code is below 2 GB, an incorrect assumption on Win64.  (The correct
> assumption for Win64 is that a single module - EXE or DLL - is smaller
> than
> 2 GB, but modules can be anywhere.)
>
> I think with considerable work, GMP could be ported to Visual Studio.
> Probably the easiest way would be to use Cygwin so the scripts work, and
> modify the scripts to use different compiler options.  Not fun.
>
> For the assembly code, it's probably possible to use some script to
> translate the code to Intel syntax and insert the necessary markup
> required
> for MASM 64.  I don't know what m4 is.
>
> Has GMP been ported to Visual Studio before?
>

Yes, check out Brian Gladman's gmp4win page at
http://fp.gladman.plus.com/computing/gmp4win.htm - he has assembly support
for EMT64/Opterons. It works quite well.

> Melissa

Cheers,

Michael




More information about the gmp-devel mailing list