Hi all!
This is probably going to be a very noobish question, so I apologize in advance.
I want to work on LLVM for my thesis, so I forked the repo, cloned it and now I want to compile it. I issued
$ mkdir build
$ cd build
$ cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Debug -G "Ninja" ../llvm
$ cd ..
$ cmake --build ./build
and it started working. Compilation reached [3097/4621] Linking CXX shared library lib/libLTO.so.16git
, then as it often happens it threw an error due to low memory.
With a bit of Google-fu, I switched linker to gold
with
$ cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Debug -DLLVM_USE_LINKER=gold -G "Ninja" ../llvm
and relaunched the compilation
$ cmake --build ./build
However, now the compilation started from [1/3483] Linking CXX executable bin/llvm-PerfectShuffle
, so with more work to do than as it would have had if it resumed from where it stopped. In other words, the first compilation aborted with 4621-3097=1524 jobs left to do, but the second one restarted with 3483 jobs left: why? Is this normal when changing linkers? Did I misunderstand something related to the building process (it’s very likely)? Or did I issue the commands wrong, and I’m wasting resources?
Depending on the answers to these question, is a tool like ccache
needed?
Thanks!