From 0cfd415229bd89e5e414febbfad88e4907d9fb81 Mon Sep 17 00:00:00 2001 From: jchzhou Date: Wed, 13 Nov 2024 10:20:03 +0800 Subject: [PATCH] switch to bundled llvm Signed-off-by: jchzhou --- rust.spec | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/rust.spec b/rust.spec index dd05582..d8b688e 100644 --- a/rust.spec +++ b/rust.spec @@ -1,10 +1,11 @@ +%define _lto_cflags %{nil} %global bootstrap_rust 1.82.0 %global bootstrap_cargo 1.82.0 %global bootstrap_channel 1.82.0 %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 +19,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 +325,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 +544,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