From ccb0a3a786e5f59ec681a013be94ddd0d9e97ec9 Mon Sep 17 00:00:00 2001 From: Mingli Yu Date: Wed, 12 Aug 2020 05:22:48 +0000 Subject: clang: set the default pigz thread pigz, which stands for parallel implementation of gzip, is a fully functional replacement for gzip that exploits multiple processors and multiple cores to the hilt when compressing data. do_package uses pigz to compress data to speed up the time if there is pigz available on the build server. But for some big package such as clang, there comes below error during do_package. gzip: stdout: Cannot allocate memory tar: TOPDIR/sstate-cache/20/80/sstate:clang:cortexa57-wrs-linux:10.0.1:r0:cortexa57:3:20808f8a746b00ec9470a81057c8595d878cfe8c565cfbcbbaa3ea870528ee34_package.tgz.QF5dss8M: Wrote only 8192 of 10240 bytes tar: Child returned status 1 tar: Error is not recoverable: exiting now So set the default pigz thread for clang and the user also can customize the pigz thread such as PIGZ_pn-clang = "-p 3" for clang in local.conf to avoid eating so much memory. Signed-off-by: Mingli Yu --- recipes-devtools/clang/clang.inc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes-devtools/clang/clang.inc b/recipes-devtools/clang/clang.inc index a99049d..41ba7bb 100644 --- a/recipes-devtools/clang/clang.inc +++ b/recipes-devtools/clang/clang.inc @@ -20,4 +20,7 @@ LLDBMD5SUM = "2e0d44968471fcde980034dbb826bea9" LLVM_LIBDIR_SUFFIX="${@d.getVar('baselib').replace('lib', '')}" +# set the default pigz thread +export PIGZ = "-p ${@oe.utils.cpu_count(at_least=2)}" + require common.inc -- cgit v1.2.3-54-g00ecf