cross-compiling ghc to openbsd

Matthias Kilian kili at
Fri Jan 29 14:23:38 EST 2010

On Fri, Jan 29, 2010 at 06:10:52PM +0100, Nicolas Martyanoff wrote:
> I'm trying to cross-compile GHC as follows:
> Host: Linux, x86_64, GHC 6.12.1
> Target: OpenBSD 4.6 stable, i386

IMHO, you shouldn't go that way, because it adds much more complexity
than you already have with OpenBSD as host *adn* target. During my
last tests back in december, not even OpenBSD/i386 -> OpenBSD/i386
worked with .hc files. That should be fixed first. Then, something
like OpenBSD/i386 -> OpenBSD-amd64 (and vice versa) should be done.
And if this works, it's questionable wether one should work on cross
building with .hc files using differen host an target operating
systems or wether it would be more useful to start getting GHC
running on other OpenBSD archs.

> I follow the guide at:
> I downloaded the last stable source tarball (ghc-6.12.1-src.tar.bz2), then ran
> the following commands:
> export AUTOCONF_VERSION=2.62
> cp /bin/pwd utils/ghc-pwd/ghc-pwd
> sh boot
> ./configure --enable-hc-boot --build=i386-unknown-openbsd --host=i386-unknown-openbsd --target=i386-unknown-openbsd

IIRC there where some discussions (or even patches pushed?) about
the build/host/target combo, so you may try to pull ghc sources
with darcs (head or the 6.12 branch).

> The latest fails, with the following trace:
> The following errors are quite interesting:
>     includes/stg/Types.h:103:2: #error GHC untested on this architecture: sizeof(void *) != 4 or 8
>     includes/rts/Constants.h:156:2: #error unknown SIZEOF_VOID_P

Your build is (re)creating includes/ghcautoconf.h -- this looks
very wrong to me, since ghcautoconf.h is supposed to be created by
a former configure / make bootstrapping-files on the target platform
and then used on the host for creating the .hc files.


More information about the Glasgow-haskell-users mailing list