From e0bf613b1c031085dcd36ae96b741c59e4f63a5b Mon Sep 17 00:00:00 2001 From: Suyun114 Date: Sat, 5 Jul 2025 21:37:18 +0800 Subject: [PATCH] Add riscv64 support (cherry picked from commit 9e4fa23304e3da7f98b058a6b134977ced069f17) --- ghc-hadrian-riscv64-rts--qg.patch | 11 +++++++++++ ghc.spec | 12 +++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 ghc-hadrian-riscv64-rts--qg.patch diff --git a/ghc-hadrian-riscv64-rts--qg.patch b/ghc-hadrian-riscv64-rts--qg.patch new file mode 100644 index 0000000..57a9088 --- /dev/null +++ b/ghc-hadrian-riscv64-rts--qg.patch @@ -0,0 +1,11 @@ +--- ghc-9.4.1/hadrian/hadrian.cabal~ 2022-08-07 12:00:38.000000000 +0800 ++++ ghc-9.4.1/hadrian/hadrian.cabal 2022-08-10 19:54:33.335164261 +0800 +@@ -173,7 +173,7 @@ + -- waiting for external processes + -- * -qg: Don't use parallel GC as the synchronization + -- time tends to eat any benefit. +- "-with-rtsopts=-I0 -qg" ++ "-with-rtsopts=-I0" + -threaded + + if flag(selftest) diff --git a/ghc.spec b/ghc.spec index 3079e5e..9d9de66 100644 --- a/ghc.spec +++ b/ghc.spec @@ -60,7 +60,7 @@ Name: ghc Version: %{full_version} -Release: 1 +Release: 2 Summary: The Glorious Glasgow Haskell Compiler License: BSD-3-Clause URL: https://www.haskell.org/ghc @@ -83,6 +83,9 @@ Patch3: ghc-Cabal-install-PATH-warning.patch Patch4: riscv64-ncg.patch Patch5: hadrian-9.10-deps.patch Patch6: ghc-pie.patch +# riscv64 does not support the argument -qg of hadrian +# https://src.fedoraproject.org/rpms/ghc/blob/2b31b684ce8b65747eb12acbe167b1b3d08515a4/f/ghc-hadrian-s390x-rts--qg.patch +Patch7: ghc-hadrian-riscv64-rts--qg.patch BuildRequires: binutils-devel BuildRequires: gcc-c++ @@ -272,6 +275,10 @@ rm libffi-tarballs/libffi-*.tar.gz %patch -P5 -p1 %patch -P6 -p1 +%ifarch riscv64 +%patch -P7 -p1 +%endif + %build %if %{with ghc_bootstrap} export PATH=/opt/bin:$PATH @@ -554,6 +561,9 @@ $GHC --info %endif %changelog +* Sat Jul 05 2025 Suyun - 9.10.1-2 +- Add riscv64 support + * Tue Dec 12 2024 Lin Runze - 9.10.1-1 - Update ghc to 9.10.1, also bootstrap_source to 9.8.2 -- Gitee