====== meta-clang ====== ===== llvm-tblgen oom killed ===== cmake_do_compile:prepend() { # When building lib/Target/*/ there are some .inc files generated # by call to `llvm-tblgen`. This very CPU and RAM consuming process # so running it with -j 22 triggers oomkiller. Additionally when icecc # is used with -j 150 almost 100 processess of `llvm-tblgen` are spawned. # Dirty workaroud is below: # # TODO: can be fixed in CMake files using `JOB_POOLS` feature # # First try to prebuild some generic cpp files needed by lib/Target # at full parallel make: cmake_runcmake_build --target clang-tablegen-targets cmake_runcmake_build --target lib/CodeGen/install cmake_runcmake_build --target lib/Frontend/install cmake_runcmake_build --target lib/ExecutionEngine/install cmake_runcmake_build --target lib/MC/install cmake_runcmake_build --target lib/MCA/install # Now run part which involves `llvm-tblgen` with limited resources: cmake_runcmake_build --target lib/Target/install -- -l ${@oe.utils.cpu_count()} -j ${@oe.utils.cpu_count() // 2} # And finish rest of build process at full speed: cmake_runcmake_build --target ${OECMAKE_TARGET_COMPILE} } ==== fixed in new version ==== It is already fixed with new llvm version. Related issues: * [[https://github.com/llvm/llvm-project/issues/121399|Out of memory error while building clang #121399]] Commit with fix is here: * [[https://github.com/llvm/llvm-project/pull/84762|[CMake] Add tablegen job pool support #84762]] * [[https://github.com/llvm/llvm-project/commit/8b99b815574de882da309be9ac0473d9c417b538.patch|patch]]. Usage in ''local.conf'': EXTRA_OECMAKE:append:pn-clang-native = " -DLLVM_PARALLEL_TABLEGEN_JOBS=${@oe.utils.cpu_count() // 2}" # By default meta-clang is configured to built all architectures, limit it: LLVM_TARGETS_TO_BUILD = "X86;AArch64"