How easy is it to build a GHC cross compiler targeting Windows?

[ glasgow-haskell-users CC'd, as requested ] Hi Hamish, Sorry for the delay in replying, things have been busy over the last few days with paper deadlines and suchlike. On 05/06/2010 15:14, Hamish Mackenzie wrote: > We want to try to add Haskell to TakeoffGW (a new Windows > distribution like cygwin, but using MinGW). TakeoffGW is built using > SUSE's mingw32 cross compiling system, so I figured the first step > would be to add GHC to that if possible. > > I figure we will need to two new GHC packages * mingw32-cross-ghc > (GHC cross compiler for building Haskell packages) * mingw32-ghc > (Windows GHC compiler to install on users machines) > > I am a bit concerned that making a cross compiler to build the > Haskell packages might not be practical. So before we spend to much > time on this I thought I should ask how hard it is to build a cross > compiler like this? Is it just a matter of setting the correct > configure flags? We will have the SUSE's mingw32 available > (including binutils and gcc cross compiler), but will this be > enough? First of all, I think TakeoffGW is a great idea, I've been hoping that something like this would emerge. In principle cross-compiling GHC ought to be possible, but actually making it work could be difficult. It's hard to predict without trying. Much of our build system is structured to make cross-compiling work: we have separate build/host/target platforms and generally try to check the correct one, but we almost never actually cross-compile GHC, only when porting GHC to a new platform and there it's a fairly involved manual process. If I had to guess, I'd say you'll probably run into quite a few things that need fixing in the build system to make this work. Probably nothing fatal, but lots of fiddling around. It would be worth doing, and we'll help as much as we can along the way if you want to try. > If we can build the cross compiler will we be able to use it to build > the Windows ghc with it? > > If there are parts that can't be done we may need to resort to using > Wine or a Windows machine. > > I wanted to CC the GHC developers mailing list, but haskell.org is > down. Could you please CC the appropriate list in your reply? Done! Cheers, Simon