add os-string big-endian patch

This commit is contained in:
Jens Petersen 2024-08-11 21:51:13 +08:00
parent 53cc500064
commit 03e46e8d1b
2 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,25 @@
From bafe87d871399b58ce4a50592b980c990a3eac39 Mon Sep 17 00:00:00 2001
From: Bodigrim <andrew.lelechenko@gmail.com>
Date: Thu, 9 May 2024 01:02:44 +0100
Subject: [PATCH] Fix compilation on big-endian arches
---
System/OsString/Data/ByteString/Short/Internal.hs | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/System/OsString/Data/ByteString/Short/Internal.hs b/System/OsString/Data/ByteString/Short/Internal.hs
index fedc199..f7ddcd8 100644
--- a/System/OsString/Data/ByteString/Short/Internal.hs
+++ b/System/OsString/Data/ByteString/Short/Internal.hs
@@ -311,7 +311,11 @@ word16ToLE#, word16FromLE# :: Word16# -> Word16#
word16ToLE#, word16FromLE# :: Word# -> Word#
#endif
#ifdef WORDS_BIGENDIAN
+#if MIN_VERSION_base(4,16,0)
+word16ToLE# w = wordToWord16# (byteSwap16# (word16ToWord# w))
+#else
word16ToLE# = byteSwap16#
+#endif
#else
word16ToLE# w# = w#
#endif

View File

@ -107,6 +107,9 @@ Patch40: cabal-add-riscv64.patch
# Upstream in >= 9.9.
Patch41: https://gitlab.haskell.org/ghc/ghc/-/commit/dd38aca95ac25adc9888083669b32ff551151259.patch
# libraries
Patch100: https://github.com/haskell/os-string/commit/bafe87d871399b58ce4a50592b980c990a3eac39.patch
# https://gitlab.haskell.org/ghc/ghc/-/wikis/platforms
# fedora ghc has been bootstrapped on
@ -433,6 +436,11 @@ rm libffi-tarballs/libffi-*.tar.gz
%patch -P41 -p1 -b .orig
%endif
(
cd libraries/os-string
%patch -P100 -p1 -b .orig
)
# https://github.com/haskell/directory/pull/184
rm libraries/directory/directory.buildinfo