Package: haskell-ghc-lib-parser
Version: 9.6.6.20240701-1
Tags: ftbfs
Usertags: hppa

Package fails to build from source on hppa:
...
error: In file included from 
/usr/lib/ghc/lib/../lib/hppa-linux-ghc-9.6.6/rts-1.0.2/include/Stg.h:415,
                  from 
/usr/lib/ghc/lib/../lib/hppa-linux-ghc-9.6.6/rts-1.0.2/include/Rts.h:38,
                  from FFIClosures_ProfilingDisabled.hsc:9:
/usr/lib/ghc/lib/../lib/hppa-linux-ghc-9.6.6/rts-1.0.2/include/stg/SMP.h: In 
function ‘write_barrier’:
/usr/lib/ghc/lib/../lib/hppa-linux-ghc-9.6.6/rts-1.0.2/include/stg/SMP.h:496:2: 
error: #error memory

The problem stems from the "ghc" source package which needs fixing in this 
header file:
rts-1.0.2/include/stg/SMP.h

See bug #1090806
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1090806
diff -up ./SMP.h.org ./SMP.h
--- ./SMP.h.org	2024-12-19 12:36:45.182588553 +0000
+++ ./SMP.h	2024-12-19 12:54:30.393622294 +0000
@@ -492,6 +492,8 @@ write_barrier(void) {
     __asm__ __volatile__ ("fence w,w" : : : "memory");
 #elif defined(loongarch64_HOST_ARCH)
     __asm__ __volatile__ ("dbar 0" : : : "memory");
+#elif defined(hppa_HOST_ARCH)
+    __sync_synchronize();
 #else
 #error memory barriers unimplemented on this architecture
 #endif
@@ -518,6 +520,8 @@ store_load_barrier(void) {
     __asm__ __volatile__ ("fence w,r" : : : "memory");
 #elif defined(loongarch64_HOST_ARCH)
     __asm__ __volatile__ ("dbar 0" : : : "memory");
+#elif defined(hppa_HOST_ARCH)
+    __sync_synchronize();
 #else
 #error memory barriers unimplemented on this architecture
 #endif
@@ -544,6 +548,8 @@ load_load_barrier(void) {
     __asm__ __volatile__ ("fence r,r" : : : "memory");
 #elif defined(loongarch64_HOST_ARCH)
     __asm__ __volatile__ ("dbar 0" : : : "memory");
+#elif defined(hppa_HOST_ARCH)
+    __sync_synchronize();
 #else
 #error memory barriers unimplemented on this architecture
 #endif

Reply via email to