Bug#1082359: llvm-toolchain-18: Ensure that at least 1 CPU is used for build

Santiago Vila sanvila at debian.org
Fri Sep 20 11:44:49 BST 2024


Package: src:llvm-toolchain-18
Version: 1:18.1.8-11

Hello. The attached patch, already accepted for llvm-toolchain-17,
ensures that:

- At least 1 CPU is used for building (without the patch, the result of
the calculation may yield 0 CPUs to be used).
- No more than $(nproc) CPUs are used for building.

Thanks.
-------------- next part --------------
--- a/debian/rules
+++ b/debian/rules
@@ -60,7 +60,7 @@ else
 endif
 NJOBS := $(shell mt=`awk '/^(MemAvail|SwapFree)/ { mt += $$2 } END {print mt}' /proc/meminfo`; \
 		awk -vn=$(NCPUS) -vmt=$$mt -vm=$(MEM_PER_CPU) \
-		  'END { mt/=1024; n2 = int(mt/m); print n==1 ? 1 : n2<n+1 ? n2 : n+1}' < /dev/null)
+		  'END { mt/=1024; n2 = int(mt/m); print n==1 || n2<=1 ? 1 : n2<=n ? n2 : n }' < /dev/null)
 
 DH_VERSION := $(shell dpkg -s debhelper | grep '^Version' | awk '{print $$2}')
 


More information about the Pkg-llvm-team mailing list