From: Michael Tremer Date: Tue, 22 May 2018 19:46:03 +0000 (+0100) Subject: make.sh: Limit XZ memory to 2GB on 32 bit systems X-Git-Tag: v2.21-core122~130 X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=commitdiff_plain;h=a92fb74d1aeb9229044c1a9fbc54abafca50da58;hp=f7585bc7ecf81e172ff18c04fece3e4f3227cf2c;ds=sidebyside make.sh: Limit XZ memory to 2GB on 32 bit systems Signed-off-by: Michael Tremer --- diff --git a/make.sh b/make.sh index d7f56f293a..84c8405e7d 100755 --- a/make.sh +++ b/make.sh @@ -867,8 +867,18 @@ if [ ${HOST_MEM} -lt 1024 ]; then fi # We compress archives with "xz -8", using all cores and up to 70% of memory -XZ_MEM="$(( HOST_MEM * 7 / 10 ))MiB" -XZ_OPT="-T$(system_processors) -8 --memory=${XZ_MEM}" +XZ_MEM=$(( HOST_MEM * 7 / 10 )) + +# XZ memory cannot be larger than 2GB on 32 bit systems +case "${HOST_ARCH}" in + i*86|armv*) + if [ ${XZ_MEM} -gt 2048 ]; then + XZ_MEM=2048 + fi + ;; +esac + +XZ_OPT="-T$(system_processors) -8 --memory=${XZ_MEM}MiB" if [ -n "${BUILD_ARCH}" ]; then configure_build "${BUILD_ARCH}"