diff --git a/0001-fix-build-error-for-loongarch64.patch b/0001-fix-build-error-for-loongarch64.patch new file mode 100644 index 0000000000000000000000000000000000000000..4acb4e864593f150069b44ad50f88026478aa433 --- /dev/null +++ b/0001-fix-build-error-for-loongarch64.patch @@ -0,0 +1,11 @@ +--- a/vendor/compiler_builtins-0.1.123/configure.rs ++++ b/vendor/compiler_builtins-0.1.123/configure.rs +@@ -72,6 +72,8 @@ pub fn configure_f16_f128(target: &Target) { + "sparc" | "sparcv9" => (true, false), + // `f16` miscompiles + "wasm32" | "wasm64" => (false, true), ++ "loongarch64" => (false, true), ++ "riscv64" | "riscv64gc" => (false, true), + // Most everything else works as of LLVM 19 + _ => (true, true), + }; diff --git a/rust.spec b/rust.spec index d2a480aad24b2ad32c308933000f0862b30fb7fa..f93e5c7f6ca1e4ea6e7cbc5e4d4433ce332243ec 100644 --- a/rust.spec +++ b/rust.spec @@ -18,7 +18,7 @@ Name: rust Version: 1.82.0 -Release: 2 +Release: 3 Summary: The Rust Programming Language License: Apache-2.0 OR MIT URL: https://www.rust-lang.org @@ -38,6 +38,7 @@ Patch0002: rustc-1.70.0-rust-gdb-substitute-path.patch Patch0003: 0001-add-support-for-ppc64le.patch # https://github.com/rust-lang/rust/pull/130034 (from 1.83) Patch0004: 0001-Fix-enabling-wasm-component-ld-to-match-other-tools.patch +Patch0005: 0001-fix-build-error-for-loongarch64.patch %{lua: function rust_triple(arch) local abi = "gnu" @@ -276,6 +277,7 @@ sed -i.try-python -e '/^try python3 /i try "%{python}" "$@"' ./configure %patch -P 0002 -p1 %patch -P 0003 -p1 %patch -P 0004 -p1 +%patch -P 0005 -p1 rm -rf vendor/curl-sys*/curl/ rm -rf vendor/jemalloc-sys/jemalloc/ rm -rf vendor/libffi-sys*/libffi/ @@ -543,6 +545,9 @@ export %{rust_env} %{_mandir}/man1/cargo*.1* %changelog +* Fri Nov 22 2024 Wenlong Zhang - 1.82.0-3 +- fix build error for loongarch64 + * Wed Nov 13 2024 jchzhou - 1.82.0-2 - Switch to bundled llvm for building, halve the 'max_cpus' in this case