From ceca7985d2d0b68a51d894e04166328e329bc4fa Mon Sep 17 00:00:00 2001 From: David Abdurachmanov Date: Mon, 16 Jan 2023 10:46:21 +0200 Subject: [PATCH] Try to enable rust-analyzer for riscv64 This is the 2nd attempt. Signed-off-by: David Abdurachmanov --- rust-enable-ra-for-riscv64.patch | 17 +++++++++++++++++ rust.spec | 11 ++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 rust-enable-ra-for-riscv64.patch diff --git a/rust-enable-ra-for-riscv64.patch b/rust-enable-ra-for-riscv64.patch new file mode 100644 index 0000000..40a1525 --- /dev/null +++ b/rust-enable-ra-for-riscv64.patch @@ -0,0 +1,17 @@ +diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs +index 12585e80e..360b7b6c7 100644 +--- a/src/bootstrap/dist.rs ++++ b/src/bootstrap/dist.rs +@@ -1086,12 +1086,6 @@ impl Step for RustAnalyzer { + let compiler = self.compiler; + let target = self.target; + +- if target.contains("riscv64") { +- // riscv64 currently has an LLVM bug that makes rust-analyzer unable +- // to build. See #74813 for details. +- return None; +- } +- + let rust_analyzer = builder + .ensure(tool::RustAnalyzer { compiler, target }) + .expect("rust-analyzer always builds"); diff --git a/rust.spec b/rust.spec index 414d501..da75a4a 100644 --- a/rust.spec +++ b/rust.spec @@ -88,7 +88,7 @@ Name: rust Version: 1.66.1 -Release: 1.0.riscv64%{?dist} +Release: 1.1.riscv64%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -135,6 +135,8 @@ Patch101: rustc-1.65.0-disable-http2.patch # (affects RHEL6 kernels when building for RHEL7) Patch102: rustc-1.65.0-no-default-pie.patch +# Enable rust-analyzer on riscv64 +Patch103: rust-enable-ra-for-riscv64.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -610,6 +612,8 @@ rm -rf vendor/libnghttp2-sys/ %patch102 -p1 %endif +%patch103 -p1 + # Use our explicit python3 first sed -i.try-python -e '/^try python3 /i try "%{__python3}" "$@"' ./configure @@ -1032,9 +1036,7 @@ end} %files analyzer %{_bindir}/rls -%ifnarch riscv64 %{_bindir}/rust-analyzer -%endif %doc src/tools/rust-analyzer/README.md %license src/tools/rust-analyzer/LICENSE-{APACHE,MIT} @@ -1062,6 +1064,9 @@ end} %changelog +* Mon Jan 16 2022 David Abdurachmanov - 1.66.1-1.1.riscv64 +- Enable riscv-analyzer for riscv64 + * Fri Jan 13 2022 David Abdurachmanov - 1.66.1-1.0.riscv64 - Do not package rust-analyzer on riscv64 - Enable riscv64