Bug#1055884: ghc: Please update sparc-support patch to fix FTBFS on sparc64

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

Hi!

src:ghc currently FTBFS on sparc64 since libraries/ghc-boot/GHC/Platform/ArchOS.hs is
missing the architecture names for sparc and sparc64 [1].

I have therefore updated the sparc-support patch to address this and also opened a pull
request upstream [2].

Can you update the patch for the next upload?

Thanks,
Adrian

> [1] https://buildd.debian.org/status/fetch.php?pkg=ghc&arch=sparc64&ver=9.4.7-1&stamp=1699776000&raw=0
> [2] https://gitlab.haskell.org/ghc/ghc/-/merge_requests/11599

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
sparc-support (text/plain, 1.7 KB)
Index: ghc-9.4.7/m4/ghc_convert_cpu.m4
===================================================================
--- ghc-9.4.7.orig/m4/ghc_convert_cpu.m4
+++ ghc-9.4.7/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.7/m4/fptools_set_haskell_platform_vars.m4
===================================================================
--- ghc-9.4.7.orig/m4/fptools_set_haskell_platform_vars.m4
+++ ghc-9.4.7/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"
             ;;
         *)
Index: ghc-9.4.7/libraries/ghc-boot/GHC/Platform/ArchOS.hs
===================================================================
--- ghc-9.4.7.orig/libraries/ghc-boot/GHC/Platform/ArchOS.hs
+++ ghc-9.4.7/libraries/ghc-boot/GHC/Platform/ArchOS.hs
@@ -38,6 +38,8 @@ data Arch
    | ArchPPC
    | ArchPPC_64 PPC_64ABI
    | ArchS390X
+   | ArchSPARC
+   | ArchSPARC64
    | ArchARM ArmISA [ArmISAExt] ArmABI
    | ArchAArch64
    | ArchAlpha
@@ -124,6 +126,8 @@ stringEncodeArch = \case
   ArchPPC_64 ELF_V1 -> "powerpc64"
   ArchPPC_64 ELF_V2 -> "powerpc64le"
   ArchS390X         -> "s390x"
+  ArchSPARC         -> "sparc"
+  ArchSPARC64       -> "sparc64"
   ArchARM ARMv5 _ _ -> "armv5"
   ArchARM ARMv6 _ _ -> "armv6"
   ArchARM ARMv7 _ _ -> "armv7"
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.