[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linaro-android
Subject:    Re: The static linked 32bit binary size is different between flounder and flo
From:       YongQin Liu <yongqin.liu () linaro ! org>
Date:       2015-12-28 8:15:53
Message-ID: CAMSo37UQFieLwTcG8uAXeEmP_4D+EWSuf9LjGeEGEbbAYW=q4Q () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi, All

Thanks for the help on this thread.

After some investigations, and I found that that the big difference is
caused by that flounder uses demalloc in the implementation,
and flo uses jemalloc implementation.


Thanks,
Yongqin Liu

On 4 November 2015 at 10:13, Bin Chen <bin.chen@linaro.org> wrote:

>
>
> On 4 November 2015 at 00:54, YongQin Liu <yongqin.liu@linaro.org> wrote:
>
>> Hi, All
>>
>> The main difference is caused by the libc.a file.
>>
>> Following is the information when link the libc.c statically, the size
>> for flo is much bigger than the one on flounder.
>> 21:38:23 liuyq: marshmallow$ ll
>> out/target/product/flo/system/bin/libstagefright_mp3dec_test
>> out/target/product/flounder/system/bin/libstagefright_mp3dec_test
>> -rwxrwxr-x 1 liuyq liuyq 227264 Nov  3 14:43
>> out/target/product/flo/system/bin/libstagefright_mp3dec_test*
>> -rwxrwxr-x 1 liuyq liuyq 124684 Nov  3 14:56
>> out/target/product/flounder/system/bin/libstagefright_mp3dec_test*
>> 21:38:51 liuyq: marshmallow$
>>
>> Following is the information when changed to link the libc.so
>> dynamically, and the size is the same for both flo and flounder.
>> 21:41:28 liuyq: marshmallow$ ll
>> out/target/product/flo/system/bin/libstagefright_mp3dec_test
>> out/target/product/flounder/system/bin/libstagefright_mp3dec_test
>> -rwxrwxr-x 1 liuyq liuyq 67156 Nov  3 21:41
>> out/target/product/flo/system/bin/libstagefright_mp3dec_test*
>> -rwxrwxr-x 1 liuyq liuyq 67156 Nov  3 21:41
>> out/target/product/flounder/system/bin/libstagefright_mp3dec_test*
>> 21:41:37 liuyq: marshmallow$
>>
>>
>> Here is the information about libc.a and libc.so on flo and flounder, the
>> version for flo is bigger than the version for flounder:
>> 21:45:46 liuyq: marshmallow$ ll out/target/product/flo/system/lib/libc.so
>> out/target/product/flounder/system/lib/libc.so
>> -rwxrwxr-x 1 liuyq liuyq 674268 Oct 29 15:34
>> out/target/product/flo/system/lib/libc.so*
>> -rwxrwxr-x 1 liuyq liuyq 552072 Oct 19 18:32
>> out/target/product/flounder/system/lib/libc.so*
>> 21:46:03 liuyq: marshmallow$
>> 21:39:27 liuyq: marshmallow$ ll
>> out/target/product/flo/obj/STATIC_LIBRARIES/libc_intermediates/libc.a
>> out/target/product/flounder/obj_arm/STATIC_LIBRARIES/libc_intermediates/libc.a
>> -rw-rw-r-- 1 liuyq liuyq 8110006 Oct 29 15:29
>> out/target/product/flo/obj/STATIC_LIBRARIES/libc_intermediates/libc.a
>> -rw-rw-r-- 1 liuyq liuyq 5960258 Oct 19 17:51
>> out/target/product/flounder/obj_arm/STATIC_LIBRARIES/libc_intermediates/libc.a
>> 21:39:46 liuyq: marshmallow$
>>
>>
>> I will check what cause the difference, and report here later.
>> but before that if you know something about that or could give some
>> suggestions, that would be very appreciated.
>>
>
> I would suggest the same thing : build libc.a using showcommands to see
> the difference :)
>
>
>>
>> Thanks,
>> Yongqin Liu
>> On 3 November 2015 at 20:47, fengwei.yin <fengwei.yin@linaro.org> wrote:
>>
>>> Hi YongQin,
>>>
>>> On 2015/11/2 11:35, YongQin Liu wrote:
>>>
>>>> Hi, Bin
>>>>
>>>> On 2 November 2015 at 11:04, Bin Chen <bin.chen@linaro.org
>>>> <mailto:bin.chen@linaro.org>> wrote:
>>>>
>>>>     YongQin,
>>>>
>>>>     You probably can use the option "showcommands" to see there is any
>>>>     difference during the compile/strip process.
>>>>
>>>> I compared the output, there is no big difference except the following
>>>> 2 header
>>>> files paths specified for flo platfomr:
>>>>
>>>>     -isystem device/asus/flo/kernel-headers -isystem
>>>>     hardware/qcom/msm8960/kernel-headers
>>>>
>>>>
>>>> I don't think these options make the difference.
>>>>
>>>> nexus9.txt is the output for flounder platform.
>>>> nexus7.txt is the output for the flo platform.
>>>>
>>>> Thanks,
>>>> Yongqin Liu
>>>>
>>>>
>>>>     On 2 November 2015 at 13:52, YongQin Liu <yongqin.liu@linaro.org
>>>>     <mailto:yongqin.liu@linaro.org>> wrote:
>>>>
>>>>         Hi, Bero
>>>>
>>>>
>>>>         Any idea why the size of the binaries compiled from the same
>>>> source
>>>>         files are different between the flounder version and the flo
>>>> version?
>>>>
>>>>         10:29:01 liuyq: marshmallow$ ll
>>>>
>>>> out/target/product/{flo,flounder}/system/bin/libstagefright_mp3dec_test
>>>>         -rwxrwxr-x 1 liuyq liuyq 231360 Nov  2 10:29
>>>>         out/target/product/flo/system/bin/libstagefright_mp3dec_test*
>>>>         -rwxrwxr-x 1 liuyq liuyq 124684 Nov  2 10:28
>>>>
>>>> out/target/product/flounder/system/bin/libstagefright_mp3dec_test*
>>>>         10:29:39 liuyq: marshmallow$
>>>>
>>>>         The binaries are 32bit static linked version compiled with the
>>>> attached
>>>>         Android.mk
>>>>
>>>>
>>>>         And the size of libc.so files  are different as well.
>>>>         10:37:13 liuyq: marshmallow$ ll
>>>>         out/target/product/{flo,flounder}/system/lib/libc.so  -h
>>>>         -rwxrwxr-x 1 liuyq liuyq 659K Oct 29 15:34
>>>>         out/target/product/flo/system/lib/libc.so*
>>>>         -rwxrwxr-x 1 liuyq liuyq 540K Oct 19 18:32
>>>>         out/target/product/flounder/system/lib/libc.so*
>>>>         10:37:21 liuyq: marshmallow$
>>>>
>>>>
>>>>         Some features are not compiled into the libc.so  on the
>>>> flounder platform?
>>>>
>>>
>>> My 2 cents:
>>> Is it possible that you dump the build command of libc.so for flo and
>>> flounder?
>>> For your build log, flo is 32bit android while flounder is 64bit. 32bit
>>> libc
>>> 64bit android is built as 2nd arch. It may be something different there.
>>>
>>> Regards
>>> Yin, Fengwei
>>>
>>>
>>>>
>>>>         --
>>>>         Best Regards,
>>>>         Yongqin Liu
>>>>         ---------------------------------------------------------------
>>>>         #mailing list
>>>>         linaro-android@lists.linaro.org <mailto:
>>>> linaro-dev@lists.linaro.org>
>>>>         http://lists.linaro.org/mailman/listinfo/linaro-android
>>>>
>>>>         _______________________________________________
>>>>         linaro-android mailing list
>>>>         linaro-android@lists.linaro.org <mailto:
>>>> linaro-android@lists.linaro.org>
>>>>         https://lists.linaro.org/mailman/listinfo/linaro-android
>>>>
>>>>
>>>>
>>>>
>>>>     --
>>>>     Regards,
>>>>     Bin
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Best Regards,
>>>> Yongqin Liu
>>>> ---------------------------------------------------------------
>>>> #mailing list
>>>> linaro-android@lists.linaro.org <mailto:linaro-dev@lists.linaro.org>
>>>> http://lists.linaro.org/mailman/listinfo/linaro-android
>>>>
>>>>
>>>> _______________________________________________
>>>> linaro-android mailing list
>>>> linaro-android@lists.linaro.org
>>>> https://lists.linaro.org/mailman/listinfo/linaro-android
>>>>
>>>>
>>
>>
>> --
>> Best Regards,
>> Yongqin Liu
>> ---------------------------------------------------------------
>> #mailing list
>> linaro-android@lists.linaro.org <linaro-dev@lists.linaro.org>
>> http://lists.linaro.org/mailman/listinfo/linaro-android
>>
>
>
>
> --
> Regards,
> Bin
>



-- 
Best Regards,
Yongqin Liu
---------------------------------------------------------------
#mailing list
linaro-android@lists.linaro.org <linaro-dev@lists.linaro.org>
http://lists.linaro.org/mailman/listinfo/linaro-android

[Attachment #5 (text/html)]

<div dir="ltr">Hi, All<div><br></div><div>Thanks for the help on this \
thread.</div><div><br></div><div>After some investigations, and I found that that the \
big difference is caused by that flounder uses demalloc in the \
implementation,</div><div>and flo uses jemalloc \
implementation.</div><div><br></div><div><br></div><div>Thanks,</div><div>Yongqin \
Liu</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 4 November \
2015 at 10:13, Bin Chen <span dir="ltr">&lt;<a href="mailto:bin.chen@linaro.org" \
target="_blank">bin.chen@linaro.org</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div \
class="gmail_quote"><span class="">On 4 November 2015 at 00:54, YongQin Liu <span \
dir="ltr">&lt;<a href="mailto:yongqin.liu@linaro.org" \
target="_blank">yongqin.liu@linaro.org</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">Hi, All<div><br></div><div>The main difference \
is caused by the libc.a file.<br></div><div><br></div><div>Following is the \
information when link the libc.c statically, the size for flo is much bigger than the \
one on flounder.</div><div><div>21:38:23 liuyq: marshmallow$ ll \
out/target/product/flo/system/bin/libstagefright_mp3dec_test \
out/target/product/flounder/system/bin/libstagefright_mp3dec_test</div><div>-rwxrwxr-x \
1 liuyq liuyq 227264 Nov   3 14:43 \
out/target/product/flo/system/bin/libstagefright_mp3dec_test*</div><div>-rwxrwxr-x 1 \
liuyq liuyq 124684 Nov   3 14:56 \
out/target/product/flounder/system/bin/libstagefright_mp3dec_test*</div><div>21:38:51 \
liuyq: marshmallow$  </div><div><br></div><div>Following is the information when \
changed to link the libc.so dynamically, and the size is the same for both flo and \
flounder.</div><div><div><div>21:41:28 liuyq: marshmallow$ ll \
out/target/product/flo/system/bin/libstagefright_mp3dec_test \
out/target/product/flounder/system/bin/libstagefright_mp3dec_test</div><div>-rwxrwxr-x \
1 liuyq liuyq 67156 Nov   3 21:41 \
out/target/product/flo/system/bin/libstagefright_mp3dec_test*</div><div>-rwxrwxr-x 1 \
liuyq liuyq 67156 Nov   3 21:41 \
out/target/product/flounder/system/bin/libstagefright_mp3dec_test*</div><div>21:41:37 \
liuyq: marshmallow$</div></div></div><div><br></div><div><br></div><div>Here is the \
information about libc.a and libc.so on flo and flounder, the version for flo is \
bigger than the version for flounder:</div><div><div>21:45:46 liuyq: marshmallow$ ll \
out/target/product/flo/system/lib/libc.so \
out/target/product/flounder/system/lib/libc.so</div><div>-rwxrwxr-x 1 liuyq liuyq \
674268 Oct 29 15:34 out/target/product/flo/system/lib/libc.so*</div><div>-rwxrwxr-x 1 \
liuyq liuyq 552072 Oct 19 18:32 \
out/target/product/flounder/system/lib/libc.so*</div><div>21:46:03 liuyq: \
marshmallow$  </div></div><div>21:39:27 liuyq: marshmallow$ ll \
out/target/product/flo/obj/STATIC_LIBRARIES/libc_intermediates/libc.a \
out/target/product/flounder/obj_arm/STATIC_LIBRARIES/libc_intermediates/libc.a<br></div><div>-rw-rw-r-- \
1 liuyq liuyq 8110006 Oct 29 15:29 \
out/target/product/flo/obj/STATIC_LIBRARIES/libc_intermediates/libc.a</div><div>-rw-rw-r-- \
1 liuyq liuyq 5960258 Oct 19 17:51 \
out/target/product/flounder/obj_arm/STATIC_LIBRARIES/libc_intermediates/libc.a</div><div>21:39:46 \
liuyq: marshmallow$  </div><div><br></div><div class="gmail_extra"><br></div><div \
class="gmail_extra">I will check what cause the difference, and report here \
later.</div><div class="gmail_extra">but before that if you know something about that \
or could give some suggestions, that would be very  <span \
style="font-size:12.8px">appreciated.</span></div></div></div></blockquote><div><br></div></span><div>I \
would suggest the same thing : build libc.a using showcommands to see the difference \
:)  </div><div><div class="h5"><div><br></div><blockquote class="gmail_quote" \
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div \
dir="ltr"><div><div class="gmail_extra"><br><div class="gmail_quote"><br></div><div \
class="gmail_quote">Thanks,</div><div class="gmail_quote">Yongqin \
Liu</div><div><div><div class="gmail_quote">On 3 November 2015 at 20:47, fengwei.yin \
<span dir="ltr">&lt;<a href="mailto:fengwei.yin@linaro.org" \
target="_blank">fengwei.yin@linaro.org</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi \
YongQin,<span><br> <br>
On 2015/11/2 11:35, YongQin Liu wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>
 Hi, Bin<br>
<br>
On 2 November 2015 at 11:04, Bin Chen &lt;<a href="mailto:bin.chen@linaro.org" \
target="_blank">bin.chen@linaro.org</a><br></span><span> &lt;mailto:<a \
href="mailto:bin.chen@linaro.org" target="_blank">bin.chen@linaro.org</a>&gt;&gt; \
wrote:<br> <br>
      YongQin,<br>
<br>
      You probably can use the option &quot;showcommands&quot; to see there is \
any<br>  difference during the compile/strip process.<br>
<br>
I compared the output, there is no big difference except the following 2 header<br>
files paths specified for flo platfomr:<br>
<br>
      -isystem device/asus/flo/kernel-headers -isystem<br>
      hardware/qcom/msm8960/kernel-headers<br>
<br>
<br>
I don&#39;t think these options make the difference.<br>
<br>
nexus9.txt is the output for flounder platform.<br>
nexus7.txt is the output for the flo platform.<br>
<br>
Thanks,<br>
Yongqin Liu<br>
<br>
<br>
      On 2 November 2015 at 13:52, YongQin Liu &lt;<a \
href="mailto:yongqin.liu@linaro.org" \
                target="_blank">yongqin.liu@linaro.org</a><br></span><span>
      &lt;mailto:<a href="mailto:yongqin.liu@linaro.org" \
target="_blank">yongqin.liu@linaro.org</a>&gt;&gt; wrote:<br> <br>
            Hi, Bero<br>
<br>
<br>
            Any idea why the size of the binaries compiled from the same source<br>
            files are different between the flounder version and the flo version?<br>
<br>
            10:29:01 liuyq: marshmallow$ ll<br>
            out/target/product/{flo,flounder}/system/bin/libstagefright_mp3dec_test<br>
                
            -rwxrwxr-x 1 liuyq liuyq 231360 Nov   2 10:29<br>
            out/target/product/flo/system/bin/libstagefright_mp3dec_test*<br>
            -rwxrwxr-x 1 liuyq liuyq 124684 Nov   2 10:28<br>
            out/target/product/flounder/system/bin/libstagefright_mp3dec_test*<br>
            10:29:39 liuyq: marshmallow$<br>
<br>
            The binaries are 32bit static linked version compiled with the \
attached<br>  Android.mk<br>
<br>
<br>
            And the size of libc.so files   are different as well.<br>
            10:37:13 liuyq: marshmallow$ ll<br>
            out/target/product/{flo,flounder}/system/lib/libc.so   -h<br>
            -rwxrwxr-x 1 liuyq liuyq 659K Oct 29 15:34<br>
            out/target/product/flo/system/lib/libc.so*<br>
            -rwxrwxr-x 1 liuyq liuyq 540K Oct 19 18:32<br>
            out/target/product/flounder/system/lib/libc.so*<br>
            10:37:21 liuyq: marshmallow$<br>
<br>
<br>
            Some features are not compiled into the libc.so   on the flounder \
platform?<br> </span></blockquote>
<br>
My 2 cents:<br>
Is it possible that you dump the build command of libc.so for flo and flounder?<br>
For your build log, flo is 32bit android while flounder is 64bit. 32bit libc<br>
64bit android is built as 2nd arch. It may be something different there.<br>
<br>
Regards<br>
Yin, Fengwei<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>
 <br>
<br>
            --<br>
            Best Regards,<br>
            Yongqin Liu<br>
            ---------------------------------------------------------------<br>
            #mailing list<br></span>
            <a href="mailto:linaro-android@lists.linaro.org" \
target="_blank">linaro-android@lists.linaro.org</a> &lt;mailto:<a \
href="mailto:linaro-dev@lists.linaro.org" \
target="_blank">linaro-dev@lists.linaro.org</a>&gt;<span><br>  <a \
href="http://lists.linaro.org/mailman/listinfo/linaro-android" rel="noreferrer" \
target="_blank">http://lists.linaro.org/mailman/listinfo/linaro-android</a><br> <br>
            _______________________________________________<br>
            linaro-android mailing list<br></span>
            <a href="mailto:linaro-android@lists.linaro.org" \
target="_blank">linaro-android@lists.linaro.org</a> &lt;mailto:<a \
href="mailto:linaro-android@lists.linaro.org" \
target="_blank">linaro-android@lists.linaro.org</a>&gt;<span><br>  <a \
href="https://lists.linaro.org/mailman/listinfo/linaro-android" rel="noreferrer" \
target="_blank">https://lists.linaro.org/mailman/listinfo/linaro-android</a><br> <br>
<br>
<br>
<br>
      --<br>
      Regards,<br>
      Bin<br>
<br>
<br>
<br>
<br>
--<br>
Best Regards,<br>
Yongqin Liu<br>
---------------------------------------------------------------<br>
#mailing list<br>
</span><a href="mailto:linaro-android@lists.linaro.org" \
target="_blank">linaro-android@lists.linaro.org</a> &lt;mailto:<a \
href="mailto:linaro-dev@lists.linaro.org" \
target="_blank">linaro-dev@lists.linaro.org</a>&gt;<span><br> <a \
href="http://lists.linaro.org/mailman/listinfo/linaro-android" rel="noreferrer" \
target="_blank">http://lists.linaro.org/mailman/listinfo/linaro-android</a><br> <br>
<br>
_______________________________________________<br>
linaro-android mailing list<br>
<a href="mailto:linaro-android@lists.linaro.org" \
target="_blank">linaro-android@lists.linaro.org</a><br> <a \
href="https://lists.linaro.org/mailman/listinfo/linaro-android" rel="noreferrer" \
target="_blank">https://lists.linaro.org/mailman/listinfo/linaro-android</a><br> <br>
</span></blockquote>
</blockquote></div><br><br clear="all"><div><br></div>-- <br></div></div><div><div \
dir="ltr"><div><div><div><span \
style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Best \
Regards,</span></div><div><span \
style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Yongqin \
Liu</span></div><div><span \
style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px;background-color \
:rgb(255,255,255)">---------------------------------------------------------------</span></div><div><span \
style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">#mailing \
list</span></div><a href="mailto:linaro-dev@lists.linaro.org" \
style="color:rgb(17,85,204);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)" \
target="_blank">linaro-android@lists.linaro.org</a></div></div><div><div><a \
href="http://lists.linaro.org/mailman/listinfo/linaro-android" \
target="_blank">http://lists.linaro.org/mailman/listinfo/linaro-android</a></div></div></div></div>
 </div></div></div>
</blockquote></div></div></div><span class="HOEnZb"><font color="#888888"><br><br \
clear="all"><div><br></div>-- <br><div><div \
dir="ltr">Regards,<div>Bin</div></div></div> </font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div \
class="gmail_signature"><div dir="ltr"><div><span \
style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Best \
Regards,</span></div><div><span \
style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Yongqin \
Liu</span></div><div><span \
style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px;background-color \
:rgb(255,255,255)">---------------------------------------------------------------</span></div><div><span \
style="background-color:rgb(255,255,255);color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">#mailing \
list</span></div><a href="mailto:linaro-dev@lists.linaro.org" \
style="color:rgb(17,85,204);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)" \
target="_blank">linaro-android@lists.linaro.org</a><div><div><a \
href="http://lists.linaro.org/mailman/listinfo/linaro-android" \
target="_blank">http://lists.linaro.org/mailman/listinfo/linaro-android</a></div></div></div></div>
 </div>


[Attachment #6 (text/plain)]

_______________________________________________
linaro-android mailing list
linaro-android@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/linaro-android


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic