[Haskell-iPhone] Running hsc2hs

Stephen Blackheath [to GHC-iPhone] likeliest.complexions.stephen at blacksapphire.com
Sat Nov 12 06:05:08 CET 2011


David,

It's all coming back to me. It uses the standard hsc2hs, but it gets it 
to compile using the iphone simulator gcc (even if it's compiling for 
iphone). It turned out that the answers are close enough to the real 
iphone that it works.

When I was developing it, there were no link errors. You could compile 
with the iphone simulator gcc, and the resulting binary would just work. 
Perhaps this has changed.

You could try iphone-cabal -v install <package>. That ought to tell you 
what arguments it is passing to hsc2hs, and debug from there.


Steve

On 12/11/11 17:32, David Pollak wrote:
> Hmmm…
>
>
> iphone-hsc2hs doesn't seem to be part of the ghc-iphone distribution:
> dpp at snowraptor:/opt/iphone$ find . -name "iphone*"
> ./bin/iphone-cabal
> ./bin/iphone-ghc
> ./bin/iphone-ghc-pkg
> ./bin/iphone-simulator-cabal
> ./bin/iphone-simulator-ghc
> ./bin/iphone-simulator-ghc-pkg
> dpp at snowraptor:/opt/iphone$
>
>
> Should I do a build from source?
>
> Thanks,
>
> David
> --
> @dpp
>
> On Friday, November 11, 2011 at 8:26 PM, Stephen Blackheath [to
> GHC-iPhone] wrote:
>
>> David,
>>
>> iphone-hsc2hs and iphone-simulator-hsc2hs are automatic, and
>> iphone-cabal can run them for you automatically. The native hsc2hs
>> (meaning, the stock standard version without a prefix for compiling
>> programs on the PC) definitely won't work. I haven't used c2hs.
>>
>> I don't know what is going wrong for you.
>>
>>
>> Steve
>>
>> On 12/11/11 12:19, David Pollak wrote:
>>> Howdy,
>>>
>>> Does hsc2hs need to be run as a separate manual phase or can it be run
>>> from the iphone-cabal thing?
>>>
>>> When I try to run it via iphone-cabal, I get link errors because the
>>> generated C program is being linked against the iphone stuff, rather
>>> than the native libraries.
>>>
>>> Any hints or pointers would be appreciated.
>>>
>>> Also, if there's any hints on running c2hs, they'd be appreciated, too,
>>> but I haven't spent a lot of time in c2hs land.
>>>
>>> Thanks,
>>>
>>> David
>>>
>>>
>>> _______________________________________________
>>> iPhone mailing list
>>> iPhone at haskell.org <mailto:iPhone at haskell.org>
>>> http://www.haskell.org/mailman/listinfo/iphone
>>
>> _______________________________________________
>> iPhone mailing list
>> iPhone at haskell.org <mailto:iPhone at haskell.org>
>> http://www.haskell.org/mailman/listinfo/iphone
>
>
>
> _______________________________________________
> iPhone mailing list
> iPhone at haskell.org
> http://www.haskell.org/mailman/listinfo/iphone



More information about the iPhone mailing list