<div dir="ltr">As Pavel mentioned the unreasonable large size for lldb-server is caused by the fact that we are relying on the liker to remove the unused code and it can't do too good job because we have lot of unreasonable dependencies.<div><br></div><div>The size difference between arm and arrahc64 caused by several reason:</div><div>* On arm we compile to thumb2 instruction set what is in average ~30% smaller then the arm (and aarch64) instruction set. Before this change the size of lldb-server on arm was ~14MB</div><div>* We have Safe ICF (identical code folding) enabled for arm what reduces the binary size by 5-10%. It is not enabled for aarch64 because last time I checked there was still some issue in ld.gold when using ICF on aarch64. It should be already fixed upstream but haven't reached the NDK yet.</div><div>* The aarch64 lldb-server capable of debugging both arm and aarch64 applications so it contains a bit more code because of this (e.g. 2 spearate register context)</div><div><br></div><div>Optimizing the size of both binary is possible (and we want to do it sooner or later) but because of the reasons I listed the arm one will stay much smaller then the aarch64 one.</div><div><br></div><div>Tamas</div><br><div class="gmail_quote"><div dir="ltr">On Tue, Mar 1, 2016 at 9:18 AM Pavel Labath via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
so the problem here is that we are currently relying on the linker to<br>
remove code that we don't need, and it can't always do a good job in<br>
figuring out which code is not used due to complex dependencies. So,<br>
innocent-looking changes in the code can pull in lots of transitive<br>
dependencies, even though they are not used. I suspect something like<br>
that is going on here, although we should keep in mind that arm64 code<br>
is less dense naturally. Any help on this front will be welcome,<br>
although it probably won't be trivial, as we have probably picked off<br>
the low-hanging fruit already.<br>
<br>
That said, you may want to try adding LLVM_TARGETS_TO_BUILD=Aarch64 to<br>
your cmake line. We use that, although I can't say how much it affects<br>
the size of the resulting binary.<br>
<br>
help that helps,<br>
pl<br>
<br>
On 29 February 2016 at 20:15, Mikhail Filimonov via lldb-dev<br>
<<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a>> wrote:<br>
> Hello, fellow developers and congratulations with long awaited 3.8 Release.<br>
><br>
> I wonder why AArch64 stripped binary of lldb-server built from [3.8 Release] RC3 source is so much bigger than its ARM counterpart.<br>
> See the numbers:<br>
> 16318632 Feb 29 22:41 lldb-server-3.8.0-aarch64<br>
>  9570916 Feb 29 22:23 lldb-server-3.8.0-arm<br>
> lldb-server-3.8.0-aarch64: ELF 64-bit LSB  executable, ARM aarch64, version 1 (SYSV), statically linked, stripped<br>
> lldb-server-3.8.0-arm:     ELF 32-bit LSB  executable, ARM, EABI5 version 1 (SYSV), statically linked, stripped<br>
><br>
> My build configuration is MinSizeRel in both cases:<br>
> cmake -GNinja<br>
> -DCMAKE_BUILD_TYPE=MinSizeRel $HOME/llvm_git<br>
> -DCMAKE_TOOLCHAIN_FILE=tools/lldb/cmake/platforms/Android.cmake<br>
> -DANDROID_TOOLCHAIN_DIR=$HOME/Toolchains/aarch64-21-android<br>
> -DANDROID_ABI=aarch64<br>
> -DCMAKE_CXX_COMPILER_VERSION=4.9<br>
> -DLLVM_TARGET_ARCH=aarch64<br>
> -DLLVM_HOST_TRIPLE=aarch64-unknown-linux-android<br>
> -DLLVM_TABLEGEN=$HOME/llvm_host/bin/llvm-tblgen<br>
> -DCLANG_TABLEGEN=$HOME/llvm_host/bin/clang-tblgen<br>
><br>
> cmake -GNinja<br>
> -DCMAKE_BUILD_TYPE=MinSizeRel $HOME/llvm_git<br>
> -DCMAKE_TOOLCHAIN_FILE=tools/lldb/cmake/platforms/Android.cmake<br>
> -DANDROID_TOOLCHAIN_DIR=$HOME/Toolchains/arm-21-android-toolchain<br>
> -DANDROID_ABI=armeabi<br>
> -DCMAKE_CXX_COMPILER_VERSION=4.9<br>
> -DLLVM_TARGET_ARCH=arm<br>
> -DLLVM_HOST_TRIPLE=arm-unknown-linux-android<br>
> -DLLVM_TABLEGEN=$HOME/llvm_host/bin/llvm-tblgen<br>
> -DCLANG_TABLEGEN=$HOME/llvm_host/bin/clang-tblgen<br>
><br>
> Maybe I need some additional settings to be set for AArch64 case?<br>
><br>
> Regards,<br>
> Mikhail<br>
><br>
> -----Original Message-----<br>
> From: lldb-dev [mailto:<a href="mailto:lldb-dev-bounces@lists.llvm.org" target="_blank">lldb-dev-bounces@lists.llvm.org</a>] On Behalf Of Hans Wennborg via lldb-dev<br>
> Sent: Wednesday, February 24, 2016 12:51 AM<br>
> To: <a href="mailto:release-testers@lists.llvm.org" target="_blank">release-testers@lists.llvm.org</a><br>
> Cc: llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>>; cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>>; openmp-dev (<a href="mailto:openmp-dev@lists.llvm.org" target="_blank">openmp-dev@lists.llvm.org</a>) <<a href="mailto:openmp-dev@lists.llvm.org" target="_blank">openmp-dev@lists.llvm.org</a>>; LLDB Dev <<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a>><br>
> Subject: [lldb-dev] [3.8 Release] RC3 has been tagged<br>
><br>
> Dear testers,<br>
><br>
> Release Candidate 3 has just been tagged [1]. Please build, test, and upload to the sftp.<br>
><br>
> If there are no regressions from previous release candidates, this will be the last release candidate before the final release.<br>
><br>
> Release notes can still go into the branch.<br>
><br>
> Thanks again for all your work!<br>
> Hans<br>
><br>
>  [1] <a href="http://lists.llvm.org/pipermail/llvm-branch-commits/2016-February/009866.html" rel="noreferrer" target="_blank">http://lists.llvm.org/pipermail/llvm-branch-commits/2016-February/009866.html</a><br>
> _______________________________________________<br>
> lldb-dev mailing list<br>
> <a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br>
><br>
> -----------------------------------------------------------------------------------<br>
> This email message is for the sole use of the intended recipient(s) and may contain<br>
> confidential information.  Any unauthorized review, use, disclosure or distribution<br>
> is prohibited.  If you are not the intended recipient, please contact the sender by<br>
> reply email and destroy all copies of the original message.<br>
> -----------------------------------------------------------------------------------<br>
> _______________________________________________<br>
> lldb-dev mailing list<br>
> <a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br>
_______________________________________________<br>
lldb-dev mailing list<br>
<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br>
</blockquote></div></div>