From 05891075c8154e14b4bd3c91d5368793fac8f807 Mon Sep 17 00:00:00 2001 From: wk333 <13474090681@163.com> Date: Thu, 14 Nov 2024 09:04:05 +0800 Subject: [PATCH] switch to bundled llvm --- rust.spec | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/rust.spec b/rust.spec index dd05582..d2a480a 100644 --- a/rust.spec +++ b/rust.spec @@ -4,7 +4,7 @@ %global bootstrap_date 2024-06-13 %global bootstrap_arches x86_64 aarch64 riscv64 %bcond_with llvm_static -%bcond_with bundled_llvm +%bcond_without bundled_llvm %bcond_without bundled_libgit2 %bcond_with disabled_libssh2 %bcond_without lldb @@ -18,7 +18,7 @@ Name: rust Version: 1.82.0 -Release: 1 +Release: 2 Summary: The Rust Programming Language License: Apache-2.0 OR MIT URL: https://www.rust-lang.org @@ -324,7 +324,11 @@ export %{rust_env} %define codegen_units_std --set rust.codegen-units-std=1 %endif ncpus=$(/usr/bin/getconf _NPROCESSORS_ONLN) +%if %{with bundled_llvm} +max_cpus=$(( ($(free -g | awk '/^Mem:/{print $2}') + 1) / 4 )) +%else max_cpus=$(( ($(free -g | awk '/^Mem:/{print $2}') + 1) / 2 )) +%endif if [ "$max_cpus" -ge 1 -a "$max_cpus" -lt "$ncpus" ]; then ncpus="$max_cpus" fi @@ -539,6 +543,9 @@ export %{rust_env} %{_mandir}/man1/cargo*.1* %changelog +* Wed Nov 13 2024 jchzhou - 1.82.0-2 +- Switch to bundled llvm for building, halve the 'max_cpus' in this case + * Wed Oct 23 2024 jchzhou - 1.82.0-1 - Update to 1.82.0 -- Gitee