hsc2hs on Mac OS 10.6 unreliable?

Axel Simon Axel.Simon at in.tum.de
Wed Jun 9 06:35:47 EDT 2010


Hi Christian,

On 09.06.2010, at 10:30, Christian Maeder wrote:

> Chris Kuklewicz schrieb:
>> hsc2hs: On OS 10.6 ghc is calling hsc2hs without any special -arch
>> option, and hsc2hs is calculating offsets in x86_64 mode.  This is
>> breaking the interface between ghc and c-structures for various
>> libraries.  In particular I ran into this with gtk2hs.
>>
>> It may suffice to get '--cc-flag=-m32 --ld-flag=-m32' to hsc2hs as a
>> work around.  While ticket #2965 is not yet fixed it would be  
>> better if
>> hsc2hs understood the default arch on OS X 10.6 is not compatible  
>> with ghc.
>
> Sorry, I'm only on a 32bit Mac, but my (installed) hsc2hs (for
> ghc-6.12.2.20100521) file contains:
>
> HSC2HS_EXTRA="--cflag=-m32 --lflag=-m32 -I<...>
>
> Is this not sufficient for 64bit Macs, too?

I guess it would be enough, but obiously ghc or cabal should do this  
correctly themselves.

What I would like to get out of this email thread is a set of rules  
that allows me to hack around this issue.

So far:

if os(darwin) && arch(x86_64) && impl(ghc >=6.10 <=6.12)
   cpp-options: -DHSC2HS_EXTRA="--cflag=-m32 --lflag=-m32"

(although I'm not even sure the above works).

Is the above rule correct and future-proof?

Cheers,
Axel


More information about the Glasgow-haskell-users mailing list