Bug#1052142: ghc: Please add patch to restore minimal build support for sparc and sparc64

John Paul Adrian Glaubitz <[email protected]>
Newsgroups gmane.linux.debian.ports.sparc
Message-ID <169502029848.1686758.11630302307702082767.reportbug__4421.41662804119$1695020620$gmane$org@nofan.physik.fu-berlin.de>
Source: ghc
Version: 9.4.6-1
Severity: normal
Tags: patch
User: [email protected]
Usertags: sparc64
X-Debbugs-Cc: [email protected]

Hello!

When upstream dropped NGC support for SPARC, they also accidentally removed build support
for unregisterised builds by removing sparc* and sparc64* from m4/ghc_convert_cpu.m4 and
m4/fptools_set_haskell_platform_vars.m4 meaning that building on sparc64 is no longer
possible.

The attached patch re-adds sparc and sparc64 to re-enable builds. The problem has also been
reported upstream [1].

Thanks,
Adrian

> [1] https://gitlab.haskell.org/ghc/ghc/-/issues/23959

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
sparc-support.patch (text/plain, 967 B)
Index: ghc-9.4.6/m4/ghc_convert_cpu.m4
===================================================================
--- ghc-9.4.6.orig/m4/ghc_convert_cpu.m4
+++ ghc-9.4.6/m4/ghc_convert_cpu.m4
@@ -68,6 +68,12 @@ case "$1" in
   sh4)
     $2="sh4"
     ;;
+  sparc64*)
+    $2="sparc64"
+    ;;
+  sparc*)
+    $2="sparc"
+    ;;
   vax)
     $2="vax"
     ;;
Index: ghc-9.4.6/m4/fptools_set_haskell_platform_vars.m4
===================================================================
--- ghc-9.4.6.orig/m4/fptools_set_haskell_platform_vars.m4
+++ ghc-9.4.6/m4/fptools_set_haskell_platform_vars.m4
@@ -42,7 +42,7 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_V
         riscv64)
             test -z "[$]2" || eval "[$]2=ArchRISCV64"
             ;;
-        hppa|hppa1_1|ia64|m68k|nios2|riscv32|rs6000|s390|sh4|vax)
+        hppa|hppa1_1|ia64|m68k|nios2|riscv32|rs6000|s390|sh4|sparc|sparc64|vax)
             test -z "[$]2" || eval "[$]2=ArchUnknown"
             ;;
         *)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.