Measurerament I took with the following configuration:
- 32 GB memory
- 16 thread
- compiler clang/clang++ (version: 9.0.1)
With ld as a linker (version: 2.33.1) ====
-DLLVM_PARALLEL_LINK_JOBS=any => out of memory
-DLLVM_PARALLEL_LINK_JOBS=5 => no more than 30 GB memory
-DLLVM_PARALLEL_LINK_JOBS=2 => no more than 14 GB memory
-DLLVM_PARALLEL_LINK_JOBS=1 => no more than 10 GB memory
With lld as a linker (version: 2.33.1) => -DLLVM_USE_LINKER=lld
====
-DLLVM_PARALLEL_LINK_JOBS=any => no more then 9 GB memory
-DLLVM_PARALLEL_LINK_JOBS=2 => no more than 6 GB memory
The current defaults for LLVM_PARALLEL_LINK_JOBS is empty, meaning any number
(only limited by ninja/make parallel option).
The LLVM_PARALLEL_LINK_JOBS=2 is a better default option,
if the linker is not lld.
Signed-off-by: Kokai Peter <kokaipeter@gmail.com>