LLVM 6.0.0的构建大小巨大(42G) [英] Build size for LLVM 6.0.0 is huge (42G)

查看:78
本文介绍了LLVM 6.0.0的构建大小巨大(42G)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从源代码构建了 llvm-6.0.0 ,并且一切正常.我只是想知道它的大小为何如此之大( 42G ).我可以轻松擦除一些目标文件或其他文件以使构建目录更小吗?

I built llvm-6.0.0 from source and everything works fine. I'm just wondering how come its size is so huge (42G). Can I easily erase some object files or other to make the build directory smaller?

$ du -hs ~/GIT/llvm-6.0.0/build/
42G /home/oren/GIT/llvm-6.0.0/build/

推荐答案

您在构建时没有共享库,这意味着许多非常大的库被静态链接到大量(否则较小)的工具中.我猜测您可能还会针对所有目标(32位ARM,64位ARM,几十个其他对象,32位X86、64位X86)进行构建.

You're building without shared libraries, which means that a number of very large libraries are linked statically into a large number of (otherwise small) tools. I'm guessing that you may also be building for all targets (32-bit ARM, 64-bit ARM, a few dozens more, 32-bit X86, 64-bit X86).

如果运行 cmake -DLLVM_TARGETS_TO_BUILD = HOST -DCMAKE_BUILD_TYPE = RelWithDebInfo -DBUILD_SHARED_LIBS = on.,则应将空间使用减少到大约10G.(至少我有一个类似的命令行生成的10G构建树.我也有更大的树,因为这些设置并不是所有目的的最佳匹配.)

If you run cmake -DLLVM_TARGETS_TO_BUILD=HOST -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=on ., you should reduce the space use to about 10G. (At least I have a 10G build tree produced from a similar command line. I also have bigger trees, because those settings aren't the best match for all purposes.)

这篇关于LLVM 6.0.0的构建大小巨大(42G)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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