How MD are .hi files?

Simon Marlow marlowsd at
Wed May 14 06:35:36 EDT 2008

Matthias Kilian wrote:
> Hi,
> for an unregisterised ghc-6.8.2 (or newer), are the .hi files
> dependent (except for the 32 vs. 64 bit word size)? I had a quick
> look at the stuff in compiler/iface, but the only MD part I found
> was that 32/64 bit difference.

The word size is probably the only dependency, but there are many reasons 
that you can't just take the .hc/.hi files generated by an unregisterised 
build on one machine and expect them to work on another machine.

First, you have to watch out for conditional compilation in the original 
Haskell source file.  For example, if the .hs file contains something like 
#ifdef mingw32_HOST_OS, then the .hc and .hi files will both be 
Windows-only.  There are certainly many instances of this in the libraries 
right now.

Another problem is the configuration information that gets into the build 
via the autoconf scripts.  Things like the size of C types in 
Foreign.C.Types, or the errno values in Foreign.C.Error might be different 
on the target machine.

I hope I've managed to understand your question correctly... if not please 
ask again!


More information about the Glasgow-haskell-users mailing list