diff --git a/ghc-modern-c-fix.txt b/ghc-modern-c-fix.txt new file mode 100644 index 0000000..70f31ca --- /dev/null +++ b/ghc-modern-c-fix.txt @@ -0,0 +1,11 @@ +--- a/compiler/GHC/HsToCore/Foreign/Decl.hs ++++ b/compiler/GHC/HsToCore/Foreign/Decl.hs +@@ -560,7 +560,7 @@ mkFExportCBits dflags c_nm maybe_target arg_htys res_hty is_IO_res_ty cc + , 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 + ] diff --git a/ghc.spec b/ghc.spec index d4590ab..4eb9afc 100644 --- a/ghc.spec +++ b/ghc.spec @@ -87,7 +87,7 @@ Version: 9.4.5 # - 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: 139%{?dist} +Release: 140%{?dist} Summary: Glasgow Haskell Compiler License: BSD-3-Clause AND HaskellReport @@ -153,6 +153,10 @@ Patch40: cabal-add-riscv64.patch # Upstream in >= 9.9. Patch41: https://gitlab.haskell.org/ghc/ghc/-/commit/dd38aca95ac25adc9888083669b32ff551151259.patch +# https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/SKVM4NSFZRWUT5MJKBS6IRUXCG3SCD34/ +# https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12079 +Patch42: ghc-modern-c-fix.txt + # https://gitlab.haskell.org/ghc/ghc/-/wikis/platforms # fedora ghc has been bootstrapped on @@ -486,6 +490,9 @@ rm libffi-tarballs/libffi-*.tar.gz %patch -P41 -p1 -b .orig %endif +#Modern C fix +%patch -P42 -p1 -b .orig + %if %{with haddock} && %{without hadrian} %global gen_contents_index gen_contents_index.orig if [ ! -f "libraries/%{gen_contents_index}" ]; then @@ -1029,6 +1036,9 @@ env -C %{ghc_html_libraries_dir} ./gen_contents_index %changelog +* Thu Feb 15 2024 Richard W.M. Jones - 9.4.5-140 +- Fix generated C for Modern C Initiative + * Wed Jan 24 2024 Fedora Release Engineering - 9.4.5-139 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild