Size of crosscompiled exectuable

Nathan Hüsken nathan.huesken at posteo.de
Sat Jan 26 09:24:43 CET 2013


On 01/25/2013 05:45 PM, Simon Marlow wrote:
> On 25/01/13 16:35, Simon Marlow wrote:
>> On 25/01/13 15:51, Stephen Paul Weber wrote:
>>> Somebody claiming to be Simon Marlow wrote:
>>>> On 25/01/13 13:58, Nathan Hüsken wrote:
>>>>> A simple hello world application has 1Mb in by 64 bit ubunut machine.
>>>>> When I stript it, is has about 750kb.
>>>>> When I build a cross compiler for android (arm), the executable has a
>>>>> asize of about 10MB, stripped about 5MB.
>>>>>
>>>>> That is huge, five times the size on my linux sysem.
>>>>
>>>> Not sure what you mean by "five times the size on my linux system".
>>>> What is 5 times larger than what?
>>>
>>> He's saying that the size of the android executable (made by his cross
>>> compiler) is five time the sive of the equivalent Ubuntu executable
>>> (made by, I assume, his system's GHC).

Yes, exactly. Sorry for my bad phrasing.

>>> The problem is not the size, but the size ratio.
>>
>> Ah, I see.  Yes, my executables are a similar size.  I'm not sure why,
>> I'll try to look into it.
> 
> It's just the lack of SPLIT_OBJS.  Also, unregisterised accounts for a
> factor of 1.5 or so.

What exactly does SPLIT_OBJS do? Is there a chance to get it working for
cross platform?
There must be a lot of unused code in the exectuable. Is there no way to
remove it?
5 Mb is rather large for an android app.

> Incidentally, I now have a registerised cross-compiler for Raspberry Pi
> compiling a working hello world :)  (LLVM 3.0, GHC HEAD)
> 
> GhcStage2HcOpts    = -O0 -fllvm -pgmlc llc-3.0 -pgmlo opt-3.0 -optlc
> -mtriple=arm-linux-gnueabihf -optlc -mattr=+vfp2 -optlc -float-abi=hard
> GhcLibHcOpts       = -O -fllvm -pgmlc llc-3.0 -pgmlo opt-3.0 -optlc
> -mtriple=arm-linux-gnueabihf -optlc -mattr=+vfp2 -optlc -float-abi=hard
> GhcRtsHcOpts      += -fllvm -pgmlc llc-3.0 -pgmlo opt-3.0 -optlc
> -mtriple=arm-linux-gnueabihf -optlc -mattr=+vfp2 -optlc -float-abi=hard
> 
> Nice work everyone.

Nice!




More information about the Glasgow-haskell-users mailing list