[Git][haskell-team/DHG_packages][master] ghc: Backport upstream patch to fix compilation with GCC 14

Ilias Tsitsimpis (@iliastsi) gitlab at salsa.debian.org
Sat Apr 6 08:38:42 BST 2024



Ilias Tsitsimpis pushed to branch master at Debian Haskell Group / DHG_packages


Commits:
7ee8bc6c by Ilias Tsitsimpis at 2024-04-06T10:34:59+03:00
ghc: Backport upstream patch to fix compilation with GCC 14

- - - - -


4 changed files:

- p/ghc/debian/changelog
- p/ghc/debian/patches/dfe1c3540e4b519b62b862b5966dfec5cae9ece1.patch
- + p/ghc/debian/patches/fix-gcc14-ffi_arg
- p/ghc/debian/patches/series


Changes:

=====================================
p/ghc/debian/changelog
=====================================
@@ -1,3 +1,9 @@
+ghc (9.4.7-4) unstable; urgency=medium
+
+  * Backport upstream patch to fix compilation with GCC 14 (Closes: #1068179)
+
+ -- Ilias Tsitsimpis <iliastsi at debian.org>  Sat, 06 Apr 2024 10:34:53 +0300
+
 ghc (9.4.7-3) unstable; urgency=medium
 
   * debian/patches/dfe1c3540e4b519b62b862b5966dfec5cae9ece1.patch:


=====================================
p/ghc/debian/patches/dfe1c3540e4b519b62b862b5966dfec5cae9ece1.patch
=====================================
@@ -14,11 +14,11 @@ 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
+Index: b/compiler/GHC/CmmToLlvm/Data.hs
+===================================================================
 --- a/compiler/GHC/CmmToLlvm/Data.hs
 +++ b/compiler/GHC/CmmToLlvm/Data.hs
-@@ -89,6 +89,7 @@ genLlvmData (sec, CmmStaticsRaw lbl xs) = do
+@@ -89,6 +89,7 @@ genLlvmData (sec, CmmStaticsRaw lbl xs)
          align          = case sec of
                              Section CString _ -> if (platformArch platform == ArchS390X)
                                                      then Just 2 else Just 1
@@ -26,6 +26,3 @@ index caac121413c..5e8912e3bc7 100644
                              _                 -> Nothing
          const          = if sectionProtection sec == ReadOnlySection
                              then Constant else Global
--- 
-GitLab
-


=====================================
p/ghc/debian/patches/fix-gcc14-ffi_arg
=====================================
@@ -0,0 +1,33 @@
+commit 1f534c2e7388273e70534680212c1357614c11ed
+Author: Florian Weimer <fweimer at redhat.com>
+Date:   Thu Feb 15 15:19:52 2024 +0000
+
+    Fix C output for modern C initiative
+    
+    GCC 14 on aarch64 rejects the C code written by GHC with this kind of
+    error:
+    
+       error: assignment to ‘ffi_arg’ {aka ‘long unsigned int’} from ‘HsPtr’ {aka ‘void *’} makes integer from pointer without a cast [-Wint-conversion]
+             68 | *(ffi_arg*)resp = cret;
+                |                 ^
+    
+    Add the correct cast.
+    
+    For more information on this see:
+    https://fedoraproject.org/wiki/Changes/PortingToModernC
+    
+    Tested-by: Richard W.M. Jones <rjones at redhat.com>
+
+Index: b/compiler/GHC/HsToCore/Foreign/Decl.hs
+===================================================================
+--- a/compiler/GHC/HsToCore/Foreign/Decl.hs
++++ b/compiler/GHC/HsToCore/Foreign/Decl.hs
+@@ -681,7 +681,7 @@ mkFExportCBits dflags c_nm maybe_target
+      ,   ppUnless res_hty_is_unit $
+          if libffi
+                   then char '*' <> parens (ffi_cResType <> char '*') <>
+-                       text "resp = cret;"
++                       text "resp = " <> parens ffi_cResType <> text "cret;"
+                   else text "return cret;"
+      , rbrace
+      ]


=====================================
p/ghc/debian/patches/series
=====================================
@@ -23,3 +23,4 @@ hadrian-enable-interpreter
 use-modern-atomics
 ppc64el-fix-clrri
 dfe1c3540e4b519b62b862b5966dfec5cae9ece1.patch
+fix-gcc14-ffi_arg



View it on GitLab: https://salsa.debian.org/haskell-team/DHG_packages/-/commit/7ee8bc6c217bf5b539858f9d47f651ed081a0e75

-- 
View it on GitLab: https://salsa.debian.org/haskell-team/DHG_packages/-/commit/7ee8bc6c217bf5b539858f9d47f651ed081a0e75
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-haskell-commits/attachments/20240406/e50ddb35/attachment-0001.htm>


More information about the Pkg-haskell-commits mailing list