Re: IMCROSS and ghc

2008-12-11 Thread Simon Marlow

Duncan Coutts wrote:

On Wed, 2008-12-10 at 11:19 -0800, John Meacham wrote:

I was wondering if anyone has gotten ghc to work with IMCROSS[1]. I'm
Cross is a way to build native windows and mac osx apps on linux. quite
convinient for making distribution packages for those other platforms or
if you want to use linux's toolset during your build.

basically, IMCROSS installs a couple new gccs with names like
/usr/local/bin/i386-mingw-gcc and so forth, is there some way to get ghc
to use said non-native compiler as its back end? It seems that ghc will
also need to build the libraries with different #define's as well to
reflect the target windows or mac environment.


It sounds like you would need to set ghc up as a cross-compiler. I'm
told that this there is a fair bit of work required to get ghc to
support cross-compilation. I expect Ian or Simon could provide more
details on what would need doing if you're interested in pursuing it.


Right - the stage 1 compiler has to be a cross-compiler, running on the 
host system and generating binaries for the target system.  Bits of the 
infrastructure are in place (i.e. we make some attempt to use the right 
_HOST_ARCH vs. TARGET_ARCH #defines), but we've never actually done real 
cross-compilation with GHC so I imagine there will be various things to 
fix.  The build system probably assumes that host==target in lots of places.


Cheers,
Simon
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: IMCROSS and ghc

2008-12-11 Thread Malcolm Wallace
 basically, IMCROSS installs a couple new gccs with names like
 /usr/local/bin/i386-mingw-gcc and so forth, is there some way to get
 ghc to use said non-native compiler as its back end?

I don't know about IMCROSS specifically, but earlier this year Sylvain
Nahas adapted the build system of nhc98 to allow it to become a
cross-compiler.  At configure time, you simply give some additional
arguments to point to the C cross-compilation toolchain, e.g.

./configure --target=i386-mingw
--hostcc=i386-mingw-gcc
--hoststrip=...
--endian=-DLOW_BYTE_FIRST
--ccoption=...
--ldoption=...

Regards,
Malcolm
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


IMCROSS and ghc

2008-12-10 Thread John Meacham
I was wondering if anyone has gotten ghc to work with IMCROSS[1]. I'm
Cross is a way to build native windows and mac osx apps on linux. quite
convinient for making distribution packages for those other platforms or
if you want to use linux's toolset during your build.

basically, IMCROSS installs a couple new gccs with names like
/usr/local/bin/i386-mingw-gcc and so forth, is there some way to get ghc
to use said non-native compiler as its back end? It seems that ghc will
also need to build the libraries with different #define's as well to
reflect the target windows or mac environment.

[1] http://www.sandroid.org/imcross/

John

-- 
John Meacham - ⑆repetae.net⑆john⑈
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: IMCROSS and ghc

2008-12-10 Thread Duncan Coutts
On Wed, 2008-12-10 at 11:19 -0800, John Meacham wrote:
 I was wondering if anyone has gotten ghc to work with IMCROSS[1]. I'm
 Cross is a way to build native windows and mac osx apps on linux. quite
 convinient for making distribution packages for those other platforms or
 if you want to use linux's toolset during your build.
 
 basically, IMCROSS installs a couple new gccs with names like
 /usr/local/bin/i386-mingw-gcc and so forth, is there some way to get ghc
 to use said non-native compiler as its back end? It seems that ghc will
 also need to build the libraries with different #define's as well to
 reflect the target windows or mac environment.

It sounds like you would need to set ghc up as a cross-compiler. I'm
told that this there is a fair bit of work required to get ghc to
support cross-compilation. I expect Ian or Simon could provide more
details on what would need doing if you're interested in pursuing it.

Duncan

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users