diff --git a/12885.patch b/12885.patch new file mode 100644 index 0000000..fbb1da1 --- /dev/null +++ b/12885.patch @@ -0,0 +1,25 @@ +From 3f128c7d6c145985e3e12fda173e7e9a5a9c03f7 Mon Sep 17 00:00:00 2001 +From: Peter Trommler +Date: Sat, 15 Jun 2024 08:55:30 +0200 +Subject: [PATCH 4/4] PPC NCG: Fix sign hints in C calls + +--- + compiler/GHC/CmmToAsm/PPC/CodeGen.hs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/compiler/GHC/CmmToAsm/PPC/CodeGen.hs b/compiler/GHC/CmmToAsm/PPC/CodeGen.hs +index cca47f7bac2..060bd7159eb 100644 +--- a/compiler/GHC/CmmToAsm/PPC/CodeGen.hs ++++ b/compiler/GHC/CmmToAsm/PPC/CodeGen.hs +@@ -1770,7 +1770,7 @@ genCCall' config gcp target dest_regs args + _ -> panic "genCall': unknown calling conv." + + argReps = map (cmmExprType platform) args +- (argHints, _) = foreignTargetHints target ++ (_, argHints) = foreignTargetHints target + + roundTo a x | x `mod` a == 0 = x + | otherwise = x + a - (x `mod` a) +-- +GitLab + diff --git a/ghc9.10.spec b/ghc9.10.spec index 1dce99e..59f907b 100644 --- a/ghc9.10.spec +++ b/ghc9.10.spec @@ -2,8 +2,8 @@ # all *bcond_without* for production builds: # - performance build (disable for quick build) %bcond_without perfbuild -%bcond_without manual %bcond_without build_hadrian +%bcond_without manual # End: prod settings # not for production builds @@ -37,6 +37,9 @@ # no longer build testsuite (takes time and not really being used) %bcond_with testsuite +# use system default ld.bfd +%bcond ld_gold 0 + # 9.8 needs llvm 11-15 # rhel9 binutils too old for llvm13: # https://bugzilla.redhat.com/show_bug.cgi?id=2141054 @@ -46,7 +49,7 @@ %else %global llvm_major 15 %endif -%global ghc_llvm_archs armv7hl s390x riscv64 +%global ghc_llvm_archs s390x riscv64 %global ghc_unregisterized_arches s390 %{mips} Name: %{ghc_name} @@ -68,9 +71,6 @@ Source5: ghc-pkg.man Source6: haddock.man Source7: runghc.man -# https://bugzilla.redhat.com/show_bug.cgi?id=2083103 -ExcludeArch: armv7hl - # absolute haddock path (was for html/libraries -> libraries) Patch1: ghc-gen_contents_index-haddock-path.patch Patch2: ghc-Cabal-install-PATH-warning.patch @@ -92,6 +92,10 @@ Patch20: hadrian-9.10-deps.patch Patch26: no-missing-haddock-file-warning.patch Patch27: haddock-remove-googleapis-fonts.patch +# ppc64le FFI miscompilation +# https://gitlab.haskell.org/ghc/ghc/-/issues/23034 +Patch35: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12885.patch + # RISCV64 added to Cabal # See: https://github.com/haskell/cabal/pull/9062 Patch40: cabal-add-riscv64.patch @@ -103,7 +107,8 @@ Patch41: https://gitlab.haskell.org/ghc/ghc/-/commit/dd38aca95ac25adc9888083669b # https://gitlab.haskell.org/ghc/ghc/-/wikis/platforms # fedora ghc has been bootstrapped on -# %%{ix86} x86_64 ppc ppc64 armv7hl s390 s390x ppc64le aarch64 +# %%{ix86} x86_64 s390x ppc64le aarch64 riscv64 +# and previously: alpha sparcv9 armv5tel ppc ppc64 s390 armv7hl # see also deprecated ghc_arches defined in ghc-srpm-macros # /usr/lib/rpm/macros.d/macros.ghc-srpm @@ -129,10 +134,9 @@ BuildRequires: %{ghcboot}-text-devel BuildRequires: %{ghcboot}-time-devel BuildRequires: %{ghcboot}-transformers-devel BuildRequires: %{ghcboot}-unix-devel -BuildRequires: alex +BuildRequires: binutils%{?with_ld_gold:-gold} BuildRequires: gmp-devel BuildRequires: gcc-c++ -BuildRequires: happy BuildRequires: libdwarf-devel BuildRequires: libffi-devel BuildRequires: libzstd-devel @@ -233,6 +237,7 @@ Obsoletes: %{name}-xhtml-prof < %{xhtml_ver}-%{release} %if %{without manual} Obsoletes: %{name}-manual < %{version}-%{release} %endif +Requires: binutils%{?with_ld_gold:-gold} %ifarch %{ghc_llvm_archs} Requires: llvm%{llvm_major} %endif @@ -410,6 +415,10 @@ rm libffi-tarballs/libffi-*.tar.gz %patch -P26 -p1 -b .orig %patch -P27 -p1 -b .orig +%ifarch ppc64le +%patch -P 35 -p1 -b .orig +%endif + %ifarch riscv64 #RISCV64 cabal support %patch -P40 -p1 -b .orig @@ -424,16 +433,17 @@ autoupdate %ghc_set_gcc_flags export CC=%{_bindir}/gcc -# note lld breaks build-id -# /usr/bin/debugedit: Cannot handle 8-byte build ID -# https://bugzilla.redhat.com/show_bug.cgi?id=2116508 -# https://gitlab.haskell.org/ghc/ghc/-/issues/22195 -%if 0%{fedora} < 40 +%if %{with ld_gold} export LD=%{_bindir}/ld.gold %endif export GHC=%{_bindir}/ghc%{?ghcboot_major:-%{ghcboot_major}} +# note lld breaks build-id +# /usr/bin/debugedit: Cannot handle 8-byte build ID +# https://bugzilla.redhat.com/show_bug.cgi?id=2116508 +# https://gitlab.haskell.org/ghc/ghc/-/issues/22195 + # * %%configure induces cross-build due to different target/host/build platform names ./configure --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} \ --bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} \ @@ -442,7 +452,7 @@ export GHC=%{_bindir}/ghc%{?ghcboot_major:-%{ghcboot_major}} --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} \ --docdir=%{_docdir}/%{name} \ --with-system-libffi \ -%if 0%{fedora} >= 40 +%if %{without ld_gold} --disable-ld-override \ %endif %ifarch %{ghc_unregisterized_arches} @@ -500,7 +510,7 @@ cp -p LICENSE ../LICENSE.hadrian ( cd _build/bindist/ghc-%{version}-* ./configure --prefix=%{buildroot}%{ghclibdir} --bindir=%{buildroot}%{_bindir} --libdir=%{buildroot}%{_libdir} --mandir=%{buildroot}%{_mandir} --docdir=%{buildroot}%{_docdir}/%{name} \ -%if 0%{fedora} >= 40 +%if %{without ld_gold} --disable-ld-override %endif %{nil} @@ -597,25 +607,20 @@ ls %{buildroot}%{ghcliblib}/bin/ghc-iserv-prof >> %{name}-base-prof.files sed -i -e "s|^%{buildroot}||g" %{name}-base*.files sed -i -e "s|%{buildroot}||g" %{buildroot}%{_bindir}/* -%if %{with haddock} -rm %{buildroot}%{_pkgdocdir}/archives/libraries.html.tar.xz -%endif - mkdir -p %{buildroot}%{_mandir}/man1 install -p -m 0644 %{SOURCE5} %{buildroot}%{_mandir}/man1/ghc-pkg.1 install -p -m 0644 %{SOURCE6} %{buildroot}%{_mandir}/man1/haddock.1 install -p -m 0644 %{SOURCE7} %{buildroot}%{_mandir}/man1/runghc.1 +%if %{with haddock} +rm %{buildroot}%{_pkgdocdir}/archives/libraries.html.tar.xz +%endif %if %{with manual} rm %{buildroot}%{_pkgdocdir}/archives/Haddock.html.tar.xz rm %{buildroot}%{_pkgdocdir}/archives/users_guide.html.tar.xz mv %{buildroot}%{_mandir}/man1/ghc{,-%{ghc_major}}.1 %endif -%ifarch armv7hl -export RPM_BUILD_NCPUS=1 -%endif - %if %{with build_hadrian} mv %{buildroot}%{_bindir}/hadrian{,-%{ghc_major}} %endif @@ -847,6 +852,11 @@ make test %changelog +* Sun Jul 14 2024 Jens Petersen +- use ld.bfd +- remove remaining mentions of armv7hl +- sync other changes from ghc9.8 + * Mon May 13 2024 Jens Petersen - 9.10.1-1 - https://downloads.haskell.org/~ghc/9.10.1/docs/users_guide/9.10.1-notes.html