liblldb-core.a是否真的需要763MB? [英] Does liblldb-core.a really need to be 763MB in size?

查看:95
本文介绍了liblldb-core.a是否真的需要763MB?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这绝对是蛋糕,因为它是我见过的最大的单个可执行代码.

This definitely takes the cake in terms of being the largest single piece of executable code I have ever seen.

现在在我的Mac上构建整个组件要容易一些(我也一直在尝试在Linux上构建LLDB,现在我正在与那里的Python进行链接).值得庆幸的是,但是这个巨大的可执行文件让我感到second惑……我做错什么了吗?这个巨大的档案库里面有什么?

Now it was a bit easier to get this whole thing built on my Mac here (I have been trying to build LLDB on a Linux as well, and currently I'm fighting with linking to Python there), for which I am thankful, but this astoundingly large executable file has me second-guessing myself... Did I do something wrong? What is inside of this monstrous archive?

我确实运行过此

% otool -TV liblldb-core.a

它产生1159行输出,将其放置在350多个目标文件中.听起来不错,我看到了XCode项目在大约350个源文件中的工作方式.

It produces 1159 lines of output, which puts it around 350+ object files. That sounds about right, I saw the XCode project work its way through about 350 source files.

我想我的问题是,为什么LLDB会以这种方式工作,为什么它不那么轻巧?为什么它不只是链接到LLVM和Clang代码,而不是做什么呢?或者,此归档文件的内容已经是所有LLDB特定的代码了吗?我认识到构建调试器是一项艰巨的任务,但是说实话,这简直令人难以置信.

I guess my question is why does LLDB work this way, why isn't it a bit more lightweight and why doesn't it just link to LLVM and Clang code rather than doing whatever this is? OR, are the contents of this archive already ALL LLDB-specific code? I recognize building a debugger is quite the undertaking, but this is honestly just mind-boggling.

我知道以-O3编译可能会使可执行文件的大小膨胀.我不想回去重新编译这个怪物(计算机几乎被smcFanControl融化了,报告的CPU核心温度高达106摄氏度).

I am aware that compiling at -O3 likely bloats executable file size. I'm not about to go back and recompile this monster though (the computer nearly melted with smcFanControl reporting CPU core temps as high as 106 degrees C).

更新:我记录了一些我刚刚做过的进一步学习的记录

Update: I sort of chronicled some further learning I just did over here... I'm still not able to find a monstrous liblldb-core.a or anything of the sort inside of XCode.app, and I'm still a bit confused about how this whole thing works.

推荐答案

这是liblldb-core.a真正的问题所在的调试信息. 750MB中的大约720MB是DWARF. (您可以自己进行测试-将ar x liblldb-core.a放入目录中,然后将其放入strip -S *.o,您将拥有约32MB的.o文件.)不带实型唯一性的DWARF对于C ++程序来说有些讨厌.

It's the debug info that's the real issue with liblldb-core.a. Around 720MB of the 750MB is DWARF. (You can test this yourself - ar x liblldb-core.a into a directory, then strip -S *.o and you'll have about 32MB of .o files.) DWARF without real type uniquing has some nasty bloat with C++ programs.

我可以制作一个(剥离的)LLDB框架和lldb驱动程序的.tar.gz,压缩后它们大约在10MB左右-这是在链接了所有需要的llvm和clang位之后lldb.即使中间步骤看起来很疯狂,这里也没有什么特别令人发指的.

I can make a .tar.gz of the (stripped) LLDB framework and lldb driver program and they come in at around 10MB or so with that compression -- and this is after linking in all of the llvm and clang bits needed by lldb. Nothing particularly outrageous here, even if the intermediate steps can look crazy.

这篇关于liblldb-core.a是否真的需要763MB?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆