[Haskell-cafe] building Ghc with msvc ?

Simon Marlow simonmar at microsoft.com
Tue Jul 26 04:39:19 EDT 2005

On 23 July 2005 22:52, Duncan Coutts wrote:

> On Sat, 2005-07-23 at 22:49 +0200, Jan Scott wrote:
>> Hi,
>> Has anyone ever tried to build Ghc with Microsofts c compiler (msvc)
>> ? 
> GHC relies quite heavily on gcc. GHC's C code backend uses a number of
> GNU C extensions I believe.
> I think it would be a great deal of work to make it use msvc. And
> there's no need since the mingw gcc works just fine on windows and is
> binary compatible with msvc (if one uses the appropriate gcc options).

I'd like to make the native code generator produce code in Intel syntax
so it would be possible to use the MS binutils as an alterntiave to the
GNU tools (the MS tools are available for free).  Playing nicely with
native Windows debuggers would be useful for debugging mixed
Haskell/foreign language apps, I've had no end of trouble trying to use
gdb for this.

I believe the C parts of the RTS has been (is?) compilable with MSVC.
The non-C parts of the RTS still need ghc -fvia-C (ie. gcc), but if I
ever get around to adding support for loops in the native code generator
we could drop that dependency too.  I seriously doubt that we'd add
support to the mangler for the Intel asm syntax, but generating Intel
asm with the NCG is a distinct possibility.


More information about the Haskell-Cafe mailing list