Thread overview
Win64 MinGW
Apr 15, 2011
dsimcha
Apr 15, 2011
Daniel Gibson
Apr 15, 2011
dsimcha
Apr 15, 2011
Daniel Green
Apr 15, 2011
dsimcha
Apr 23, 2011
Daniel Green
Apr 27, 2011
Daniel Green
Apr 27, 2011
Brad Roberts
Apr 30, 2011
Daniel Green
April 15, 2011
I've just had the unexpected misfortune of having my work computer break, and then the unexpected fortune of being told I'm getting an 8 core with 24 gigs of RAM to replace it.  However, I strongly prefer Windows as my desktop OS. Therefore, I've started caring a lot more lately about 64-bit Windows support.

How far away are we from getting a reasonably stable/usable MinGW GDC for
Win64?  I've noticed that GDC for Linux has made tremendous strides lately and
almost "just works" for the code I've been testing it on.  (Thanks to Iain for
his hard work.)  I've also noticed that GDC has been ported to Windows using
MinGW (thanks to Daniel Green), but as far as I can tell it only supports 32.
 Are there any major, fundamental roadblocks to 64 support or are we a few bug
fixes away?
April 15, 2011
Am 15.04.2011 19:38, schrieb dsimcha:
> I've just had the unexpected misfortune of having my work computer break, and then the unexpected fortune of being told I'm getting an 8 core with 24 gigs of RAM to replace it.  However, I strongly prefer Windows as my desktop OS. Therefore, I've started caring a lot more lately about 64-bit Windows support.
> 
> How far away are we from getting a reasonably stable/usable MinGW GDC for
> Win64?  I've noticed that GDC for Linux has made tremendous strides lately and
> almost "just works" for the code I've been testing it on.  (Thanks to Iain for
> his hard work.)  I've also noticed that GDC has been ported to Windows using
> MinGW (thanks to Daniel Green), but as far as I can tell it only supports 32.
>  Are there any major, fundamental roadblocks to 64 support or are we a few bug
> fixes away?

(I don't know anything specific, the following is just a guess)

Probably Phobos would need a lot of fixes, because I guess everything in
version(Win32) blocks will have to be rewritten?
Probably new Versions ("Win" and "Win64") will be needed: "Win" for
generic stuff that works on win32 and win64 and Win64 for win64 specific
stuff.

But this is just a guess, I'm not really familiar with Windows programming.

Cheers,
- Daniel
April 15, 2011
== Quote from Daniel Gibson (metalcaedes@gmail.com)'s article
> Am 15.04.2011 19:38, schrieb dsimcha:
> > I've just had the unexpected misfortune of having my work computer break, and then the unexpected fortune of being told I'm getting an 8 core with 24 gigs of RAM to replace it.  However, I strongly prefer Windows as my desktop OS. Therefore, I've started caring a lot more lately about 64-bit Windows support.
> >
> > How far away are we from getting a reasonably stable/usable MinGW GDC for
> > Win64?  I've noticed that GDC for Linux has made tremendous strides lately and
> > almost "just works" for the code I've been testing it on.  (Thanks to Iain for
> > his hard work.)  I've also noticed that GDC has been ported to Windows using
> > MinGW (thanks to Daniel Green), but as far as I can tell it only supports 32.
> >  Are there any major, fundamental roadblocks to 64 support or are we a few bug
> > fixes away?
> (I don't know anything specific, the following is just a guess)
> Probably Phobos would need a lot of fixes, because I guess everything in
> version(Win32) blocks will have to be rewritten?
> Probably new Versions ("Win" and "Win64") will be needed: "Win" for
> generic stuff that works on win32 and win64 and Win64 for win64 specific
> stuff.
> But this is just a guess, I'm not really familiar with Windows programming.
> Cheers,
> - Daniel

Interesting.  This is good in that it's something I could help out with.  I have neither the time nor the desire to get deep into compiler implementations, but I already know the Phobos codebase pretty well and could fix up these issues. However, I would need a reasonably working barebones compiler to test my work.
April 15, 2011
On 4/15/2011 1:38 PM, dsimcha wrote:

> How far away are we from getting a reasonably stable/usable MinGW GDC for
> Win64?  I've noticed that GDC for Linux has made tremendous strides lately and
> almost "just works" for the code I've been testing it on.  (Thanks to Iain for
> his hard work.)  I've also noticed that GDC has been ported to Windows using
> MinGW (thanks to Daniel Green), but as far as I can tell it only supports 32.
>   Are there any major, fundamental roadblocks to 64 support or are we a few bug
> fixes away?
That was something I was going to look into this weekend.  I've mentioned before I chose to have GDC/MinGW releases use the TDM build scripts because it supports both 32 and 64 bit compilers.

> Interesting.  This is good in that it's something I could help out with.  I have
> neither the time nor the desire to get deep into compiler implementations, but I
> already know the Phobos codebase pretty well and could fix up these issues.
> However, I would need a reasonably working barebones compiler to test my work.
Your help would be welcomed.  I have 32 bit Windows which limits the testing I can do.

April 15, 2011
== Quote from Daniel Green (venix1@gmail.com)'s article
> On 4/15/2011 1:38 PM, dsimcha wrote:
> > How far away are we from getting a reasonably stable/usable MinGW GDC for
> > Win64?  I've noticed that GDC for Linux has made tremendous strides lately and
> > almost "just works" for the code I've been testing it on.  (Thanks to Iain for
> > his hard work.)  I've also noticed that GDC has been ported to Windows using
> > MinGW (thanks to Daniel Green), but as far as I can tell it only supports 32.
> >   Are there any major, fundamental roadblocks to 64 support or are we a few bug
> > fixes away?
> That was something I was going to look into this weekend.  I've mentioned before I chose to have GDC/MinGW releases use the TDM build scripts because it supports both 32 and 64 bit compilers.

Excellent.  Could you please try to get a barebones (i.e. no Phobos or druntime support) 64-bit compiler working so I have something to use for testing?
April 23, 2011
Thought I'd post an update.  I spent last weekend building the support libraries for MinGW-w64.  I also took the opportunity to automate the build process from start to finish.

I had to do this inside VirtualBox which not only adds significantly to compiling, the latest version(4.0.4) kept locking up.  I see they just released 4.0.6, but 4.0 works so I'm going to stick with that for now.

I've been attempting to duplicate the TDM64 build process but met with issues in gtype-desc.c.  The errors appear to be undefined types due to lto support.

I've disabled lto(rebuilding now).  If it works I'll integrate GDC into the process and see about adding lto in later.



April 27, 2011
MinGW-w64 D1 with phobos has been successfully compiled.  Phobos contained 3 errors.  Two were Windows function calls.  Phobos uses size_t but Win64 uses uint.  The other was with the GC relating to Windows stack information.  Several functions in the GC expect uint which causes warnings and should probably be made size_t.

MinGW-w64 D2 with phobos has been successfully compiled.  This one was a little more work.

In both cases GDC compiled without issues.  The majority of the D2 issues are <symbol>.length defaulting to size_t and being used as a function parameter wanting int/uint.  Most Windows API calls that do not deal with memory have the same signature as Win32.

There are still a few quirks I don't understand about the build process until I get those figured out I won't release any binaries.
April 27, 2011
On 4/26/2011 7:47 PM, Daniel Green wrote:
> MinGW-w64 D1 with phobos has been successfully compiled.  Phobos contained 3 errors.  Two were Windows function calls. Phobos uses size_t but Win64 uses uint.  The other was with the GC relating to Windows stack information.  Several functions in the GC expect uint which causes warnings and should probably be made size_t.
> 
> MinGW-w64 D2 with phobos has been successfully compiled.  This one was a little more work.
> 
> In both cases GDC compiled without issues.  The majority of the D2 issues are <symbol>.length defaulting to size_t and being used as a function parameter wanting int/uint.  Most Windows API calls that do not deal with memory have the same signature as Win32.
> 
> There are still a few quirks I don't understand about the build process until I get those figured out I won't release any binaries.

You should file bug reports with the appropriate patches.
April 30, 2011
On 4/27/2011 12:03 AM, Brad Roberts wrote:
> You should file bug reports with the appropriate patches.

The patches are diffed from GDC sources, is it recommended to apply them to the phobos/druntime trunk or leave them as is.  I can't test them against DMD.  I do not know how GDC and DMD phobos mingle.

The changes encompass druntime, phobos and phobos 2.  The only exception was dll_helper.d.  It's not working with MinGW, so I didn't update it.