The package rpms/ghc9.4.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/ghc9.4.git/commit/?id=d77196da3cb....
Change:
+%ifarch s390x
Thanks.
Full change:
============
commit d77196da3cbfbc94007c5f443cbe2ac2fc685d68
Author: Jens Petersen <petersen(a)redhat.com>
Date: Fri Dec 22 20:07:20 2023 +0800
s390x: patch from @stefansf (IBM) to fix llvm alignment in data sections
diff --git a/11662.patch b/11662.patch
new file mode 100644
index 0000000..ce6ca44
--- /dev/null
+++ b/11662.patch
@@ -0,0 +1,31 @@
+From bed85f7bc358fdca4677a3070b94ea544bb9e7ff Mon Sep 17 00:00:00 2001
+From: Stefan Schulze Frielinghaus <stefansf(a)linux.ibm.com>
+Date: Mon, 27 Nov 2023 12:34:47 +0100
+Subject: [PATCH] llvmGen: Align objects in the data section
+
+Objects in the data section may be referenced via tagged pointers.
+Thus, align those objects to a 4- or 8-byte boundary for 32- or 64-bit
+platforms, respectively. Note, this may need to be reconsidered if
+objects with a greater natural alignment requirement are emitted as e.g.
+128-bit atomics.
+
+Fixes #24163.
+---
+ compiler/GHC/CmmToLlvm/Data.hs | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/compiler/GHC/CmmToLlvm/Data.hs b/compiler/GHC/CmmToLlvm/Data.hs
+index caac121413c..5e8912e3bc7 100644
+--- a/compiler/GHC/CmmToLlvm/Data.hs
++++ b/compiler/GHC/CmmToLlvm/Data.hs
+@@ -89,6 +89,7 @@ genLlvmData (sec, CmmStaticsRaw lbl xs) = do
+ align = case sec of
+ Section CString _ -> if (platformArch platform ==
ArchS390X)
+ then Just 2 else Just 1
++ Section Data _ -> Just $ platformWordSizeInBytes
platform
+ _ -> Nothing
+ const = if sectionProtection sec == ReadOnlySection
+ then Constant else Global
+--
+GitLab
+
diff --git a/ghc9.4.spec b/ghc9.4.spec
index ff4d18d..9e23ff0 100644
--- a/ghc9.4.spec
+++ b/ghc9.4.spec
@@ -75,7 +75,7 @@ Version: 9.4.8
# - release can only be reset if *all* library versions get bumped simultaneously
# (sometimes after a major release)
# - minor release numbers for a branch should be incremented monotonically
-Release: 24%{?dist}
+Release: 25%{?dist}
Summary: Glasgow Haskell Compiler
License: BSD-3-Clause AND HaskellReport
@@ -112,6 +112,11 @@ Patch13: text2-allow-ghc8-arm.patch
Patch15: ghc-warnings.mk-CC-Wall.patch
Patch16: ghc-hadrian-s390x-rts--qg.patch
+# s390x
+#
https://gitlab.haskell.org/ghc/ghc/-/issues/24163
+#
https://gitlab.haskell.org/ghc/ghc/-/merge_requests/11662
+Patch17:
https://gitlab.haskell.org/ghc/ghc/-/merge_requests/11662.patch
+
# Debian patches:
Patch24: buildpath-abi-stability.patch
Patch26: no-missing-haddock-file-warning.patch
@@ -424,15 +429,12 @@ rm libffi-tarballs/libffi-*.tar.gz
%ifarch %{ghc_unregisterized_arches}
%patch -P15 -p1 -b .orig
-%endif
-
-%if %{with hadrian}
-# remove s390x if all ghc using llvm
-%ifarch %{ghc_unregisterized_arches} s390x
%patch -P16 -p1 -b .orig
%endif
-%endif
+%ifarch s390x
+%patch -P17 -p1 -b .orig
+%endif
#debian
#%%patch -P24 -p1 -b .orig
@@ -996,6 +998,10 @@ env -C %{ghc_html_libraries_dir} ./gen_contents_index
%changelog
+* Sat Nov 25 2023 Jens Petersen <petersen(a)redhat.com> - 9.4.8-25
+- s390x: patch from @stefansf (IBM) to fix llvm alignment in data sections
+ which should fix certain runtime crashes (#2248097)
+
* Sat Nov 11 2023 Jens Petersen <petersen(a)redhat.com> - 9.4.8-24
-
https://downloads.haskell.org/~ghc/9.4.8/docs/users_guide/9.4.8-notes.html