Source: haskell-ghc-lib-parser
Version: 9.4.7.20230826-1
Severity: normal
Tags: ftbfs patch

Dear Maintainer,

Build fails here:

Preprocessing library for ghc-lib-parser-9.4.7.20230826..
compiling dist-ghc/build/GHC/Exts/Heap/FFIClosures_ProfilingDisabled_hsc_make.c 
failed (exit code 1)
rsp file was: "dist-ghc/build/GHC/Exts/Heap/hsc2hscall3782483-0.rsp"
command was: /usr/bin/hppa-linux-gnu-gcc -c 
dist-ghc/build/GHC/Exts/Heap/FFIClosures_ProfilingDisabled_hsc_make.c -o 
dist-ghc/build/GHC/Exts/Heap/FFIClosures_ProfilingDisabled_hsc_make.o 
-D_HPUX_SOURCE -D_HPUX_SOURCE -fuse-ld=bfd -D_HPUX_SOURCE -UTHREADED_RTS 
-D__GLASGOW_HASKELL__=904 -Dlinux_BUILD_OS=1 -Dhppa_BUILD_ARCH=1 
-Dlinux_HOST_OS=1 -Dhppa_HOST_ARCH=1 -Irts/include -Ighc-lib/stage0/lib 
-Ighc-lib/stage0/compiler/build -Icompiler -Idist-ghc/build/rts/include 
-Idist-ghc/build/ghc-lib/stage0/lib 
-Idist-ghc/build/ghc-lib/stage0/compiler/build -Idist-ghc/build/compiler 
-DTHREADED_RTS -DTHREADED_RTS -Idist-ghc/build/autogen 
-Idist-ghc/build/global-autogen -include dist-ghc/build/autogen/cabal_macros.h 
-I/usr/lib/ghc/lib/../lib/hppa-linux-ghc-9.4.7/process-1.6.17.0/include 
-I/usr/lib/ghc/lib/../lib/hppa-linux-ghc-9.4.7/unix-2.7.3/include 
-I/usr/lib/ghc/lib/../lib/hppa-linux-ghc-9.4.7/time-1.12.2/include 
-I/usr/lib/ghc/lib/../lib/hppa-linux-ghc-9.4.7/bytestring-0.11.5.2/include 
-I/usr/lib/ghc/lib/../lib/hppa-linux-ghc-9.4.7/base-4.17.2.0/include 
-I/usr/lib/ghc/lib/../lib/hppa-linux-ghc-9.4.7/ghc-bignum-1.3/include 
-I/usr/lib/ghc/lib/../lib/hppa-linux-ghc-9.4.7/rts-1.0.2/include -I/usr/include/
error: In file included from 
/usr/lib/ghc/lib/../lib/hppa-linux-ghc-9.4.7/rts-1.0.2/include/Stg.h:348,
                 from 
/usr/lib/ghc/lib/../lib/hppa-linux-ghc-9.4.7/rts-1.0.2/include/Rts.h:38,
                 from FFIClosures_ProfilingDisabled.hsc:9:
/usr/lib/ghc/lib/../lib/hppa-linux-ghc-9.4.7/rts-1.0.2/include/stg/SMP.h: In 
function ‘write_barrier’:
/usr/lib/ghc/lib/../lib/hppa-linux-ghc-9.4.7/rts-1.0.2/include/stg/SMP.h:416:2: 
error: #error memory barriers unimplemented on this architecture
  416 | #error memory barriers unimplemented on this architecture
      |  ^~~~~
/usr/lib/ghc/lib/../lib/hppa-linux-ghc-9.4.7/rts-1.0.2/include/stg/SMP.h: In 
function ‘store_load_barrier’:
/usr/lib/ghc/lib/../lib/hppa-linux-ghc-9.4.7/rts-1.0.2/include/stg/SMP.h:440:2: 
error: #error memory barriers unimplemented on this architecture
  440 | #error memory barriers unimplemented on this architecture
      |  ^~~~~
/usr/lib/ghc/lib/../lib/hppa-linux-ghc-9.4.7/rts-1.0.2/include/stg/SMP.h: In 
function ‘load_load_barrier’:
/usr/lib/ghc/lib/../lib/hppa-linux-ghc-9.4.7/rts-1.0.2/include/stg/SMP.h:464:2: 
error: #error memory barriers unimplemented on this architecture
  464 | #error memory barriers unimplemented on this architecture
      |  ^~~~~

-e: error: debian/hlibrary.setup build --builddir=dist-ghc returned exit code 1
 at /usr/share/perl5/Debian/Debhelper/Dh_Lib.pm line 880.
        Debian::Debhelper::Dh_Lib::error("debian/hlibrary.setup build 
--builddir=dist-ghc returned exit"...) called at 
/usr/share/perl5/Debian/Debhelper/Dh_Lib.pm line 610
        Debian::Debhelper::Dh_Lib::error_exitcode("debian/hlibrary.setup build 
--builddir=dist-ghc") called at /usr/share/perl5/Debian/Debhelper/Dh_Lib.pm 
line 473
        Debian::Debhelper::Dh_Lib::doit("debian/hlibrary.setup", "build", 
"--builddir=dist-ghc") called at 
/usr/share/perl5/Debian/Debhelper/Buildsystem/Haskell/Recipes.pm line 656
        Debian::Debhelper::Buildsystem::Haskell::Recipes::build_recipe() called 
at -e line 1
make: *** [/usr/share/cdbs/1/class/hlibrary.mk:158: build-ghc-stamp] Error 25
dpkg-buildpackage: error: fakeroot debian/rules binary-arch subprocess returned 
exit status 2

Note "-D_HPUX_SOURCE" is not relevant in hppa-linux build.

Patch for SMP.h in ghc is attached to fix this issue.

Build will also run out of memory unless rules is updated to reduce gcc
memory usage. Patch is attached to add hppa to build rule for this.

Please update ghc SMP.h and rules files to fix build.

Thanks,
Dave Anglin

-- System Information:
Debian Release: trixie/sid
  APT prefers buildd-unstable
  APT policy: (500, 'buildd-unstable'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 6.1.60+ (SMP w/4 CPU threads)
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
--- ./rts/include/stg/SMP.h.save        2023-10-28 00:06:14.205202427 +0000
+++ ./rts/include/stg/SMP.h     2023-10-28 00:08:51.706312556 +0000
@@ -412,6 +412,8 @@
     __asm__ __volatile__ ("dmb  st" : : : "memory");
 #elif defined(riscv64_HOST_ARCH)
     __asm__ __volatile__ ("fence w,w" : : : "memory");
+#elif defined(hppa_HOST_ARCH)
+    __asm__ __volatile__ ("sync" : : : "memory");
 #else
 #error memory barriers unimplemented on this architecture
 #endif
@@ -436,6 +438,8 @@
     __asm__ __volatile__ ("dmb sy" : : : "memory");
 #elif defined(riscv64_HOST_ARCH)
     __asm__ __volatile__ ("fence w,r" : : : "memory");
+#elif defined(hppa_HOST_ARCH)
+    __asm__ __volatile__ ("sync" : : : "memory");
 #else
 #error memory barriers unimplemented on this architecture
 #endif
@@ -460,6 +464,8 @@
     __asm__ __volatile__ ("dmb ld" : : : "memory");
 #elif defined(riscv64_HOST_ARCH)
     __asm__ __volatile__ ("fence r,r" : : : "memory");
+#elif defined(hppa_HOST_ARCH)
+    __asm__ __volatile__ ("sync" : : : "memory");
 #else
 #error memory barriers unimplemented on this architecture
 #endif
--- rules.save  2023-10-28 13:57:03.017973521 +0000
+++ rules       2023-10-28 13:55:22.197249905 +0000
@@ -5,7 +5,7 @@
 DEB_DEFAULT_COMPILER = ghc
 
 DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
-ifneq (,$(filter $(DEB_BUILD_ARCH),arm64 armhf armel i386 s390x x32))
+ifneq (,$(filter $(DEB_BUILD_ARCH),arm64 armhf armel hppa i386 s390x x32))
        DEB_SETUP_GHC_CONFIGURE_ARGS += --ghc-options="-O0 -optc--param 
-optcggc-min-expand=10"
 endif
 

Reply via email to