问题
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/
回答1:
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).
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.)
来源:https://stackoverflow.com/questions/56016796/build-size-for-llvm-6-0-0-is-huge-42g