diff --git a/rust.spec b/rust.spec index c6497eb3f2c6ecab931d77a5850c3e7c2fdc1259..53bea42fecac40e66a2c55986278efd69c775841 100644 --- a/rust.spec +++ b/rust.spec @@ -12,7 +12,7 @@ Name: rust Version: 1.80.0 -Release: 1 +Release: 2 Summary: The Rust Programming Language License: Apache-2.0 OR MIT URL: https://www.rust-lang.org @@ -42,6 +42,8 @@ Patch0003: 0001-add-support-for-ppc64le.patch arch = "powerpc64le" elseif arch == "riscv64" then arch = "riscv64gc" + elseif arch == "loongarch64" then + arch = "loongarch64" end return arch.."-unknown-linux-"..abi end} @@ -88,7 +90,11 @@ BuildRequires: cargo >= %{bootstrap_cargo} BuildRequires: (%{name} >= %{bootstrap_rust} with %{name} <= %{version}) %global local_rust_root %{_prefix} %endif +%ifarch loongarch64 +BuildRequires: make gcc gcc-c++ ncurses-devel curl curl-devel pkgconfig(libcurl) pkgconfig(liblzma) +%else BuildRequires: make gcc gcc-c++ ncurses-devel curl curl-devel musl-libc-static musl-gcc pkgconfig(libcurl) pkgconfig(liblzma) +%endif BuildRequires: pkgconfig(openssl) pkgconfig(zlib) pkgconfig(libssh2) >= 1.6.0 gnupg2 wget %global python python3 BuildRequires: %{python} @@ -333,8 +339,12 @@ test -r "%{profiler}" %configure --disable-option-checking \ --docdir=%{_pkgdocdir} \ --libdir=%{common_libdir} \ +%ifarch loongarch64 + --build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \ +%else %{rust_musl_root}=%{musl_root} \ --build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple},%{rust_musl_triple} \ +%endif --set target.%{rust_triple}.profiler="%{profiler}" \ --python=%{python} \ --local-rust-root=%{local_rust_root} \ @@ -436,20 +446,24 @@ export %{rust_env} %{_libexecdir}/rust-analyzer-proc-macro-srv %endif %{rustlibdir}/%{rust_triple}/lib/*.so +%ifnarch loongarch64 %dir %{rustlibdir}/%{rust_musl_triple} %dir %{rustlibdir}/%{rust_musl_triple}/lib +%endif %files std-static %dir %{rustlibdir} %dir %{rustlibdir}/%{rust_triple} %dir %{rustlibdir}/%{rust_triple}/lib %{rustlibdir}/%{rust_triple}/lib/*.rlib +%ifnarch loongarch64 %dir %{rustlibdir}/%{rust_musl_triple} %dir %{rustlibdir}/%{rust_musl_triple}/lib %{rustlibdir}/%{rust_musl_triple}/lib/*.rlib %{rustlibdir}/%{rust_musl_triple}/lib/self-contained/*.o %{rustlibdir}/%{rust_musl_triple}/lib/self-contained/libunwind.a %{rustlibdir}/%{rust_musl_triple}/lib/self-contained/libc.a +%endif %files debugger-common %dir %{rustlibdir} @@ -514,6 +528,9 @@ export %{rust_env} %{_mandir}/man1/cargo*.1* %changelog +* Tue Oct 22 2024 zhangwenlong - 1.80.0-2 +- disable musl for loongarch64 + * Wed Aug 07 2024 wangkai <13474090681@163.com> - 1.80.0-1 - Update to 1.80.0