hsc2hs and base
Donn Cave
donn at avvanta.com
Sun Dec 27 18:28:24 EST 2009
Quoth "Bryan O'Sullivan" <bos at serpentine.com>,
> On Sun, Dec 27, 2009 at 10:55 AM, Bryan O'Sullivan <bos at serpentine.com>wrote:
>
>> Is it licit to have source files in base depend on preprocessing by hsc2hs?
>> My suspicion is "no", but I want to be sure.
>>
>
> Never mind, I found a ".hsc" source file in base, so it must be okay after
> all :-)
I guess it depends on your definition of "okay". It's awkward for
the `unregisterised' port process, where you build .hc files on a
supported host with similar hardware, because the .hc files will have
been hsc2hs processed on the wrong platform when you compile them.
So just for example if 1) the layout of struct rusage is different
between the two hosts, and 2) the initial bootstrap ghc uses those
functions in System/CPUTime.hsc while trying to build itself, there's
going to be trouble.
Strictly speaking, though, that isn't so much a problem with hsc2hs
per se, rather with .hsc files that include platform-dependent
C definitions. If you provide the C source also, and hsc2hs sees
only platform-independent definitions from your source, then I don't
see how that would be a problem. In the above example I suppose that
would mean a `struct ghc_rusage' or something.
Donn Cave, donn at avvanta.com
More information about the Glasgow-haskell-users
mailing list