[Haskell-iPhone] Fat binaries on iOS Target

Carter Schonwald carter.schonwald at gmail.com
Wed Dec 25 16:14:57 UTC 2013


Woah! Jumping into cross compiling as your way to start learning Haskell?
That's pretty awesome.   Please continue to share any problems you may
have, it's always possible that it could be a bug!

On Wednesday, December 25, 2013, Joe wrote:

> Hi Carter,
>
> Sure! Just added new ticket #8629<https://ghc.haskell.org/trac/ghc/ticket/8629>
> .
>
> As for inlining, I think i’ll start learning haskell first before jumping
> into modifying the code :). Hopefully either split-objs, executable or
> other some other idea to reduce binary size could be found very soon.
>
> Thanks for helping.
>
> Best regards,
> Joe
>
> On Dec 25, 2013, at 10:14 PM, Carter Schonwald <carter.schonwald at gmail.com<javascript:_e({}, 'cvml', 'carter.schonwald at gmail.com');>>
> wrote:
>
> Huh.  Could you write up a ticket on trac?  This could be considered a bug
> in cross compilation.  Explain that you're trying to make sure the object
> code for iOS is small.
>
> @luke, are there any tricks for managing object size you've done
>
> There are some ideas to reduce object size for ghc 7.10, but that doesn't
> help you write now.
>
>
> @Joe: one idea could be to mess with the ghc flags that relate to
> Inlining.  Reducing the amount of Inlining may help with object size, BUT
> may make things slower.  I don't recall what the relevant ghc flags are off
> hand. You'd have to do some digging.
>
>
>
> On Wednesday, December 25, 2013, Joe wrote:
>
>> Hi Carter,
>>
>> When I have added “split-objs: True” in .cabal/config file, but when
>> running cabal I got this message:
>>
>> Preprocessing library pandoc-1.12.2.1...
>> unused terminals: 1
>>
>> on the commandline: Warning: ignoring -fsplit-objs
>>
>> And if I ignore that, at the end of build, I get another error message
>> that stop the build.
>>
>> cabal: dist-i386/build/Text/Pandoc_o_split: does not exist
>>
>> It seems that split-objs cannot work with cross-compilation ghc.
>>
>> What do you think?
>>
>> Best regards,
>> Joe
>>
>> On Dec 25, 2013, at 8:46 PM, Carter Schonwald <carter.schonwald at gmail.com>
>> wrote:
>>
>> You need to make sure every lib is built with split objs, not just the
>> final application.  Did you try it that way?   You could also try to limit
>> the amount of Inlining in your application too
>>
>> On Wednesday, December 25, 2013, Joe wrote:
>>
>>> Hi,
>>>
>>> I’m asking similar question on haskell-cafe group, but I think it’s more
>>> appropriate to ask here since it’s iPhone related. Please forgive my double
>>> post.
>>>
>>> I have been trying to statically link Pandoc packages to iOS application
>>> and I want to say that what have been done so far as explained in
>>> https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOS is
>>> great! I have finally successfully use Pandoc library in iOS app, but
>>> there’s an issue that the final app binary is *more than 50MB* when
>>> using Pandoc library. It’s around 5MB for simple haskell library. And
>>> without using Haskell, it’s around 100kb.
>>>
>>> Is it possible to strip the executable binary? I read that stripping is
>>> not possible using xcode strip. I also try to add -split-objs flag, but
>>> it’s not working either.
>>>
>>> Any idea? Is this a known issue?
>>>
>>> Thanks for making Haskell work on iOS!
>>>
>>> Best regards and merry christmas,
>>> Joe
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/iphone/attachments/20131225/439d1061/attachment.html>


More information about the iPhone mailing list