diff --git a/macros.rust-toolset b/macros.rust-toolset index 135b3e2..f996136 100644 --- a/macros.rust-toolset +++ b/macros.rust-toolset @@ -42,6 +42,7 @@ -Cdebuginfo=%rustflags_debuginfo -Ccodegen-units=%rustflags_codegen_units -Cstrip=none + %[0%{?x86_64_v2} ? "-Ctarget_cpu=x86-64-v2" : ""] %{expr:0%{?_include_frame_pointers} && ("%{_arch}" != "ppc64le" && "%{_arch}" != "s390x" && "%{_arch}" != "i386") ? "-Cforce-frame-pointers=yes" : ""} %[0%{?_package_note_status} ? "-Clink-arg=%_package_note_flags" : ""] } diff --git a/rust.spec b/rust.spec index edaa3e0..7824bef 100644 --- a/rust.spec +++ b/rust.spec @@ -173,6 +173,8 @@ Patch100: rustc-1.84.0-disable-libssh2.patch arch = "powerpc64le" elseif arch == "riscv64" then arch = "riscv64gc" + elseif arch == "x86_64_v2" then + arch = "x86_64" end return arch.."-unknown-linux-"..abi end} @@ -771,6 +773,20 @@ find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+' print(env) end} +%ifarch x86_64_v2 +%global rustc_target_cpus %{lua: do + local fedora = tonumber(rpm.expand("0%{?fedora}")) + local rhel = tonumber(rpm.expand("0%{?rhel}")) + local env = + " RUSTC_TARGET_CPU_X86_64=x86-64-v2" + .. " RUSTC_TARGET_CPU_PPC64LE=" .. ((rhel >= 9) and "pwr9" or "pwr8") + .. " RUSTC_TARGET_CPU_S390X=" .. + ((rhel >= 9) and "z14" or (rhel == 8 or fedora >= 38) and "z13" or + (fedora >= 26) and "zEC12" or (rhel == 7) and "z196" or "z10") + print(env) +end} +%endif + # Set up shared environment variables for build/install/check. # *_USE_PKG_CONFIG=1 convinces *-sys crates to use the system library. %global rust_env %{shrink: @@ -1191,6 +1207,9 @@ rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/" %changelog +* Thu May 15 2025 Eduard Abdullin - 1.84.1-1 +- AlmaLinux changes: Use the correct architecture in x86_64_v2 + ## START: Generated by rpmautospec * Tue Feb 04 2025 Josh Stone - 1.84.1-1 - Update to Rust 1.84.1