patch for 32bit Word64 primitives

This commit is contained in:
Jens Petersen 2023-02-17 02:18:16 +08:00
parent 99580cfc58
commit dfb0543efe
2 changed files with 25 additions and 0 deletions

View File

@ -17,6 +17,7 @@ Url: https://hackage.haskell.org/package/%{pkg_name}
Source0: https://hackage.haskell.org/package/%{pkgver}/%{pkgver}.tar.gz
Source1: https://hackage.haskell.org/package/%{pkgver}/%{pkg_name}.cabal#/%{pkgver}.cabal
# End cabal-rpm sources
Patch0: memory-Word64.patch
# Begin cabal-rpm deps:
BuildRequires: dos2unix
@ -95,6 +96,7 @@ This package provides the Haskell %{pkg_name} profiling library.
%setup -q -n %{pkgver}
dos2unix -k -n %{SOURCE1} %{pkg_name}.cabal
# End cabal-rpm setup
%patch0 -p1 -b .orig
%build

23
memory-Word64.patch Normal file
View File

@ -0,0 +1,23 @@
--- memory-0.17.0/Data/Memory/Internal/CompatPrim64.hs.orig 2019-09-02 10:59:04.000000000 +0800
+++ memory-0.17.0/Data/Memory/Internal/CompatPrim64.hs 2023-02-17 02:13:44.131991990 +0800
@@ -148,14 +148,14 @@
w64# w _ _ = w
#elif WORD_SIZE_IN_BITS == 32
-import GHC.IntWord64
+import GHC.Exts
import GHC.Prim (Word#)
-timesWord64# :: Word64# -> Word64# -> Word64#
-timesWord64# a b =
- let !ai = word64ToInt64# a
- !bi = word64ToInt64# b
- in int64ToWord64# (timesInt64# ai bi)
+-- timesWord64# :: Word64# -> Word64# -> Word64#
+-- timesWord64# a b =
+-- let !ai = word64ToInt64# a
+-- !bi = word64ToInt64# b
+-- in int64ToWord64# (timesInt64# ai bi)
w64# :: Word# -> Word# -> Word# -> Word64#
w64# _ hw lw =