From 5fb28d50744dd19042a46aa5eae7ec854aa7f2eb60043f715d759bc303416d0e Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Thu, 2 Feb 2023 13:42:05 +0000 Subject: [PATCH 1/9] osc copypac from project:devel:languages:haskell:ghc-9.4.x package:ghc revision:13, using keep-link OBS-URL: https://build.opensuse.org/package/show/devel:languages:haskell/ghc?expand=0&rev=374 --- _constraints | 4 +- buildpath-abi-stability.patch | 23 - execstack.patch | 50 ++ fix-build-using-unregisterized-v8.4.patch | 58 ++ fix-unregisterised-v8.4-8.6.patch | 17 + fix_extlinks.patch | 22 +- ghc-8.0.2-Cabal-dynlibdir.patch | 6 +- ghc-8.10.7-src.tar.xz | 3 - ghc-8.10.7-src.tar.xz.sig | Bin 438 -> 0 bytes ghc-8.6.3-sphinx-1.8.patch | 37 + ghc-9.4.4-src.tar.xz | 3 + ghc-9.4.4-src.tar.xz.sig | Bin 0 -> 586 bytes ghc-Cabal-install-PATH-warning.patch | 14 + ghc-armv7-VFPv3D16--NEON.patch | 11 - ghc-gen_contents_index-haddock-path.patch | 13 + ghc-pie.patch | 10 +- ghc-warnings.mk-CC-Wall.patch | 11 + ghc.changes | 139 +--- ghc.spec | 264 ++++---- libatomic.patch | 24 + riscv-tntc.patch | 74 ++ riscv.patch | 778 ++++++++++++++++++++++ 22 files changed, 1278 insertions(+), 283 deletions(-) delete mode 100644 buildpath-abi-stability.patch create mode 100644 execstack.patch create mode 100644 fix-build-using-unregisterized-v8.4.patch create mode 100644 fix-unregisterised-v8.4-8.6.patch delete mode 100644 ghc-8.10.7-src.tar.xz delete mode 100644 ghc-8.10.7-src.tar.xz.sig create mode 100644 ghc-8.6.3-sphinx-1.8.patch create mode 100644 ghc-9.4.4-src.tar.xz create mode 100644 ghc-9.4.4-src.tar.xz.sig create mode 100644 ghc-Cabal-install-PATH-warning.patch delete mode 100644 ghc-armv7-VFPv3D16--NEON.patch create mode 100644 ghc-gen_contents_index-haddock-path.patch create mode 100644 ghc-warnings.mk-CC-Wall.patch create mode 100644 libatomic.patch create mode 100644 riscv-tntc.patch create mode 100644 riscv.patch diff --git a/_constraints b/_constraints index 2b5c1aa..09ad4fc 100644 --- a/_constraints +++ b/_constraints @@ -1,7 +1,7 @@ - 12 + 16 4 @@ -24,7 +24,7 @@ - 20 + 32 diff --git a/buildpath-abi-stability.patch b/buildpath-abi-stability.patch deleted file mode 100644 index d516980..0000000 --- a/buildpath-abi-stability.patch +++ /dev/null @@ -1,23 +0,0 @@ -Index: ghc-8.10.0.20191210/compiler/iface/MkIface.hs -=================================================================== ---- ghc-8.10.0.20191210.orig/compiler/iface/MkIface.hs -+++ ghc-8.10.0.20191210/compiler/iface/MkIface.hs -@@ -679,7 +679,7 @@ addFingerprints hsc_env iface0 - iface_hash <- computeFingerprint putNameLiterally - (mod_hash, - ann_fn (mkVarOcc "module"), -- See mkIfaceAnnCache -- mi_usages iface0, -+ usages, - sorted_deps, - mi_hpc iface0) - -@@ -714,6 +714,9 @@ addFingerprints hsc_env iface0 - (non_orph_rules, orph_rules) = mkOrphMap ifRuleOrph (mi_rules iface0) - (non_orph_fis, orph_fis) = mkOrphMap ifFamInstOrph (mi_fam_insts iface0) - ann_fn = mkIfaceAnnCache (mi_anns iface0) -+ -- Do not allow filenames to affect the interface -+ usages = [ case u of UsageFile _ fp -> UsageFile "" fp; _ -> u | u <- mi_usages iface0 ] -+ - - -- | Retrieve the orphan hashes 'mi_orphan_hash' for a list of modules - -- (in particular, the orphan modules which are transitively imported by the diff --git a/execstack.patch b/execstack.patch new file mode 100644 index 0000000..c3d8f42 --- /dev/null +++ b/execstack.patch @@ -0,0 +1,50 @@ +From 3739e565f8fa09b3a31ba8f563c518480585f6f9 Mon Sep 17 00:00:00 2001 +From: Andreas Schwab +Date: Sat, 11 Jun 2022 23:29:24 +0200 +Subject: [PATCH] RTS: Add stack marker to StgCRunAsm.S + +Every object file must be properly marked for non-executable stack, even if it +contains no code. +--- + rts/StgCRunAsm.S | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +diff --git a/rts/StgCRunAsm.S b/rts/StgCRunAsm.S +index aed3241d12..9216e6c759 100644 +--- a/rts/StgCRunAsm.S ++++ b/rts/StgCRunAsm.S +@@ -66,8 +66,6 @@ StgReturn: + addi 12,1,-(8*18) + bl _restgpr1_14 + b _restfpr_14 +- +- .section .note.GNU-stack,"",@progbits + # else // linux_HOST_OS + # error Only Linux support for power64 little endian right now. + # endif +@@ -231,8 +229,6 @@ StgReturn: + .cfi_endproc + .size StgReturn, .-StgReturn + +- .section .note.GNU-stack,"",@progbits +- + #elif defined(riscv64_HOST_ARCH) + # define STACK_FRAME_SIZE (RESERVED_C_STACK_BYTES+208) + .text +@@ -374,8 +370,11 @@ StgReturn: + ret + .cfi_endproc + .size StgReturn, .-StgReturn +- +- .section .note.GNU-stack,"",@progbits + #endif + + #endif /* !USE_MINIINTERPRETER */ ++ ++/* mark stack as nonexecutable */ ++#if defined(__linux__) && defined(__ELF__) ++.section .note.GNU-stack,"",@progbits ++#endif +-- +2.37.0 + diff --git a/fix-build-using-unregisterized-v8.4.patch b/fix-build-using-unregisterized-v8.4.patch new file mode 100644 index 0000000..1cc9604 --- /dev/null +++ b/fix-build-using-unregisterized-v8.4.patch @@ -0,0 +1,58 @@ +Description: Allow unregisterised ghc-8.4 to build newer GHC + Commit 4075656e8bb introduced a regression stopping existing unregisteristed + compilers from being able to compile newer versions of GHC. The problem is + that the bootstrap compiler uses the newer `rts/storage/ClosureTypes.h` file + where some defines have been renamed, resulting in the following error: +. + error: ‘stg_MUT_ARR_PTRS_FROZEN0_info’ undeclared (first use in this function); did you mean ‘stg_MUT_ARR_PTRS_FROZEN_DIRTY_info’? +. + For more information, see https://gitlab.haskell.org/ghc/ghc/issues/15913. +. + This patch can be removed, once ghc-8.4 is no longer the bootstrap compiler. +Author: Ilias Tsitsimpis +Bug: https://gitlab.haskell.org/ghc/ghc/issues/15913 +Bug-Debian: https://bugs.debian.org/932941 + +Index: b/includes/rts/storage/ClosureTypes.h +=================================================================== +--- a/includes/rts/storage/ClosureTypes.h ++++ b/includes/rts/storage/ClosureTypes.h +@@ -82,5 +82,11 @@ + #define SMALL_MUT_ARR_PTRS_DIRTY 60 + #define SMALL_MUT_ARR_PTRS_FROZEN_DIRTY 61 + #define SMALL_MUT_ARR_PTRS_FROZEN_CLEAN 62 ++#if __GLASGOW_HASKELL__ < 806 ++#define SMALL_MUT_ARR_PTRS_FROZEN0 SMALL_MUT_ARR_PTRS_FROZEN_DIRTY ++#define SMALL_MUT_ARR_PTRS_FROZEN SMALL_MUT_ARR_PTRS_FROZEN_CLEAN ++#define MUT_ARR_PTRS_FROZEN0 MUT_ARR_PTRS_FROZEN_DIRTY ++#define MUT_ARR_PTRS_FROZEN MUT_ARR_PTRS_FROZEN_CLEAN ++#endif + #define COMPACT_NFDATA 63 + #define N_CLOSURE_TYPES 64 +Index: b/includes/stg/MiscClosures.h +=================================================================== +--- a/includes/stg/MiscClosures.h ++++ b/includes/stg/MiscClosures.h +@@ -116,12 +116,22 @@ RTS_ENTRY(stg_ARR_WORDS); + RTS_ENTRY(stg_MUT_ARR_WORDS); + RTS_ENTRY(stg_MUT_ARR_PTRS_CLEAN); + RTS_ENTRY(stg_MUT_ARR_PTRS_DIRTY); ++#if __GLASGOW_HASKELL__ < 806 ++RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN); ++RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN0); ++#else + RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN_CLEAN); + RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN_DIRTY); ++#endif + RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_CLEAN); + RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_DIRTY); ++#if __GLASGOW_HASKELL__ < 806 ++RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_FROZEN); ++RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_FROZEN0); ++#else + RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_FROZEN_CLEAN); + RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_FROZEN_DIRTY); ++#endif + RTS_ENTRY(stg_MUT_VAR_CLEAN); + RTS_ENTRY(stg_MUT_VAR_DIRTY); + RTS_ENTRY(stg_END_TSO_QUEUE); diff --git a/fix-unregisterised-v8.4-8.6.patch b/fix-unregisterised-v8.4-8.6.patch new file mode 100644 index 0000000..1d81893 --- /dev/null +++ b/fix-unregisterised-v8.4-8.6.patch @@ -0,0 +1,17 @@ +Index: ghc-8.10.0.20200123/includes/stg/MiscClosures.h +=================================================================== +--- ghc-8.10.0.20200123.orig/includes/stg/MiscClosures.h ++++ ghc-8.10.0.20200123/includes/stg/MiscClosures.h +@@ -401,8 +401,12 @@ RTS_FUN_DECL(stg_copySmallMutableArrayzh + RTS_FUN_DECL(stg_casSmallArrayzh); + + RTS_FUN_DECL(stg_newMutVarzh); ++#if __GLASGOW_HASKELL__ < 808 ++RTS_FUN_DECL(stg_atomicModifyMutVarzh); ++#else + RTS_FUN_DECL(stg_atomicModifyMutVar2zh); + RTS_FUN_DECL(stg_atomicModifyMutVarzuzh); ++#endif + RTS_FUN_DECL(stg_casMutVarzh); + + RTS_FUN_DECL(stg_isEmptyMVarzh); diff --git a/fix_extlinks.patch b/fix_extlinks.patch index dcd5315..26ea155 100644 --- a/fix_extlinks.patch +++ b/fix_extlinks.patch @@ -1,7 +1,7 @@ -Index: ghc-8.10.7/docs/users_guide/ghc_config.py.in +Index: ghc-9.4.4/docs/users_guide/ghc_config.py.in =================================================================== ---- ghc-8.10.7.orig/docs/users_guide/ghc_config.py.in -+++ ghc-8.10.7/docs/users_guide/ghc_config.py.in +--- ghc-9.4.4.orig/docs/users_guide/ghc_config.py.in 2022-12-23 16:19:02.000000000 +0000 ++++ ghc-9.4.4/docs/users_guide/ghc_config.py.in 2023-01-30 21:30:24.105048683 +0000 @@ -1,6 +1,6 @@ extlinks = { - 'ghc-ticket': ('https://gitlab.haskell.org/ghc/ghc/issues/%s', '#'), @@ -11,21 +11,21 @@ Index: ghc-8.10.7/docs/users_guide/ghc_config.py.in } libs_base_uri = '../libraries' -Index: ghc-8.10.7/libraries/Cabal/Cabal/doc/conf.py +Index: ghc-9.4.4/libraries/Cabal/doc/conf.py =================================================================== ---- ghc-8.10.7.orig/libraries/Cabal/Cabal/doc/conf.py -+++ ghc-8.10.7/libraries/Cabal/Cabal/doc/conf.py -@@ -24,12 +24,12 @@ master_doc = 'index' +--- ghc-9.4.4.orig/libraries/Cabal/doc/conf.py 2022-12-23 16:19:53.000000000 +0000 ++++ ghc-9.4.4/libraries/Cabal/doc/conf.py 2023-01-30 21:30:53.908929483 +0000 +@@ -28,12 +28,12 @@ master_doc = 'index' # extlinks -- see http://www.sphinx-doc.org/en/stable/ext/extlinks.html extlinks = { - 'issue': ('https://github.com/haskell/cabal/issues/%s', '#'), + 'issue': ('https://github.com/haskell/cabal/issues/%s', '#%s'), -- 'ghc-wiki': ('http://ghc.haskell.org/trac/ghc/wiki/%s', ''), -- 'ghc-ticket': ('http://ghc.haskell.org/trac/ghc/ticket/%s', 'GHC #'), -+ 'ghc-wiki': ('http://ghc.haskell.org/trac/ghc/wiki/%s', None), -+ 'ghc-ticket': ('http://ghc.haskell.org/trac/ghc/ticket/%s', 'GHC #%s'), +- 'ghc-wiki': ('https://gitlab.haskell.org/ghc/ghc/-/wikis/%s', ''), +- 'ghc-ticket': ('https://gitlab.haskell.org/ghc/ghc/-/issues/%s', 'GHC #'), ++ 'ghc-wiki': ('https://gitlab.haskell.org/ghc/ghc/-/wikis/%s', None), ++ 'ghc-ticket': ('https://gitlab.haskell.org/ghc/ghc/-/issues/%s', 'GHC #%s'), - 'hackage-pkg': ('http://hackage.haskell.org/package/%s', ''), + 'hackage-pkg': ('http://hackage.haskell.org/package/%s', None), diff --git a/ghc-8.0.2-Cabal-dynlibdir.patch b/ghc-8.0.2-Cabal-dynlibdir.patch index ae7cc51..214241c 100644 --- a/ghc-8.0.2-Cabal-dynlibdir.patch +++ b/ghc-8.0.2-Cabal-dynlibdir.patch @@ -1,7 +1,7 @@ -Index: ghc-8.10.0.20200123/libraries/Cabal/Cabal/Distribution/Simple/InstallDirs.hs +Index: ghc-8.10.0.20200123/libraries/Cabal/Cabal/src/Distribution/Simple/InstallDirs.hs =================================================================== ---- ghc-8.10.0.20200123.orig/libraries/Cabal/Cabal/Distribution/Simple/InstallDirs.hs -+++ ghc-8.10.0.20200123/libraries/Cabal/Cabal/Distribution/Simple/InstallDirs.hs +--- ghc-8.10.0.20200123.orig/libraries/Cabal/Cabal/src/Distribution/Simple/InstallDirs.hs ++++ ghc-8.10.0.20200123/libraries/Cabal/Cabal/src/Distribution/Simple/InstallDirs.hs @@ -207,7 +207,7 @@ defaultInstallDirs' False comp userInsta _other -> "$abi" "$libname", dynlibdir = "$libdir" case comp of diff --git a/ghc-8.10.7-src.tar.xz b/ghc-8.10.7-src.tar.xz deleted file mode 100644 index 0cb8bc8..0000000 --- a/ghc-8.10.7-src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e3eef6229ce9908dfe1ea41436befb0455fefb1932559e860ad4c606b0d03c9d -size 19932668 diff --git a/ghc-8.10.7-src.tar.xz.sig b/ghc-8.10.7-src.tar.xz.sig deleted file mode 100644 index b0404f75c5a6d6bf10f3cb6bd0fcf7e6671545af603bef3d9251770e8fa1330e..0000000000000000000000000000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 438 zcmV;n0ZIOe0kZ@E0SEvc79j+PwSUijwL49-zofBPhh+QWEg8fG0%0fLh5!l)5Lky~ z`{FGb#3$Jd0JYt-!0erFO3s^SO2z9=TP_MNmDA|c3V*8Fa3}UD_*QH*4!`Yp_PI^@#(uAwvufhWrKnSqECuJTRsAcG5w zS4V!1`3(3u6@M~K&=ZKvG`)ZABu}Ds078oQ5`31jd2eIFs32N1H{nzgn@deFR4=e( z*0<_elze)3wz`!Qn7gcI!UiEeVfSwI#Z{<-R&ub@D-^C+6!xW1$5-0N4wo`3%9dyc zS6hEBIq7J1C9cc~%t>jicP>WbTk;e+zG9lRwS}= LooseVersion('1.8') else {} + ++ # Yuck: We can't use app.add_object_type since we need to provide the ++ # Directive instance ourselves. ++ std_object_types = app.registry.domain_object_types.setdefault('std', {}) ++ + # Add ghc-flag directive, and override the class with our own +- app.add_object_type('ghc-flag', 'ghc-flag') + app.add_directive_to_domain('std', 'ghc-flag', Flag, **override_arg) ++ app.add_role_to_domain('std', 'ghc-flag', XRefRole()) ++ std_object_types['ghc-flag'] = ObjType('ghc-flag', 'ghc-flag') + + # Add extension directive, and override the class with our own +- app.add_object_type('extension', 'extension') + app.add_directive_to_domain('std', 'extension', LanguageExtension, + **override_arg) ++ app.add_role_to_domain('std', 'extension', XRefRole()) ++ std_object_types['extension'] = ObjType('ghc-flag', 'ghc-flag') ++ + # NB: language-extension would be misinterpreted by sphinx, and produce + # lang="extensions" XML attributes + diff --git a/ghc-9.4.4-src.tar.xz b/ghc-9.4.4-src.tar.xz new file mode 100644 index 0000000..539165d --- /dev/null +++ b/ghc-9.4.4-src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e8cef25a6ded1531cda7a90488d0cfb6d780657d16636daa59430be030cd67e2 +size 28564104 diff --git a/ghc-9.4.4-src.tar.xz.sig b/ghc-9.4.4-src.tar.xz.sig new file mode 100644 index 0000000000000000000000000000000000000000000000000000000000000000..9513a3c7f5903f92a6c1b716c54391966a17d4235de7f10d24dcd6ecfc023348 GIT binary patch literal 586 zcmV-Q0=4~#0!IV@0SEvw79j-x>wM@Q7NcuEE$weD;7v}K+hnZ;0%NBpSrZ&$Wo|%s zWo&FMba`-PWG-WGZ2$@h5G~+MPM6zctye1$0Ht1tq8czEJCo&Uu?c>Md+pPsfoZT2 ztQ)iq60HqRrYXJvnqP6`ztAyN$B0Zd-F7u+`}4>Jo#+)Z(|>zQS=8OO7dH|_ka}>B zzNMa<^Ns%4{Np_)p=|d-+3xL7!<>fDHvdSX9TuNUl_loa3w@dM!b{HT&6Ee{CSh=< zz;=(?6^sodC;|m#=by+T+)k+dJrkLWU9Kvt!IDHBGbp|m; z`g({6a9G2QvI4$ZzY@v<8?--1aURPb_t7%iA3n@ug??S3omB+#iV@B=RX{%M=JNs)0gOQnO7|)iccvoX&U2Z|^E(-zV2%?L(TsC1hUrjgHfu6z!G^W4tlp4Kaird}{zRl41znm#304T(0Ogbx= z5I(qZDCX0!TyaqRO6)^CLKz)8CQ|RY2U~zWOfCS GHC.installExe verbosity lbi binPref buildPref progFix pkg_descr exe + GHCJS -> GHCJS.installExe verbosity lbi binPref buildPref progFix pkg_descr exe diff --git a/ghc-armv7-VFPv3D16--NEON.patch b/ghc-armv7-VFPv3D16--NEON.patch deleted file mode 100644 index bc1255b..0000000 --- a/ghc-armv7-VFPv3D16--NEON.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ghc-8.10.7/aclocal.m4 -+++ ghc-8.10.7/aclocal.m4 -@@ -408,7 +408,7 @@ - )], - [changequote(, )dnl - ARM_ISA=ARMv7 -- ARM_ISA_EXT="[VFPv3,NEON]" -+ ARM_ISA_EXT="[VFPv3D16]" - changequote([, ])dnl - ]) - ]) diff --git a/ghc-gen_contents_index-haddock-path.patch b/ghc-gen_contents_index-haddock-path.patch new file mode 100644 index 0000000..f940fcc --- /dev/null +++ b/ghc-gen_contents_index-haddock-path.patch @@ -0,0 +1,13 @@ +Index: ghc-9.2.0.20210331/libraries/gen_contents_index +=================================================================== +--- ghc-9.2.0.20210331.orig/libraries/gen_contents_index ++++ ghc-9.2.0.20210331/libraries/gen_contents_index +@@ -47,7 +47,7 @@ then + HADDOCK_ARGS="$HADDOCK_ARGS $HADDOCK_ARG" + done + else +- HADDOCK=../../../../../bin/haddock ++ HADDOCK=/usr/bin/haddock + # We don't want the GHC API to swamp the index + HADDOCK_FILES=`ls -1 */*.haddock | grep -v '/ghc\.haddock' | sort` + HADDOCK_ARGS="-p prologue.txt" diff --git a/ghc-pie.patch b/ghc-pie.patch index e9ca4ae..5b4e4b3 100644 --- a/ghc-pie.patch +++ b/ghc-pie.patch @@ -1,11 +1,11 @@ -Index: ghc-8.10.7/compiler/main/DynFlags.hs +Index: ghc-9.2.3/compiler/GHC/Driver/Session.hs =================================================================== ---- ghc-8.10.7.orig/compiler/main/DynFlags.hs -+++ ghc-8.10.7/compiler/main/DynFlags.hs -@@ -4659,6 +4659,7 @@ default_PIC platform = +--- ghc-9.2.3.orig/compiler/GHC/Driver/Session.hs ++++ ghc-9.2.3/compiler/GHC/Driver/Session.hs +@@ -3756,6 +3756,7 @@ default_PIC platform = + -- This requires PIC on AArch64, and ExternalDynamicRefs on Linux as on top -- of that. Subsequently we expect all code on aarch64/linux (and macOS) to -- be built with -fPIC. - -- See #15275, #18892 + (OSLinux, ArchX86_64) -> [Opt_PIC] (OSDarwin, ArchAArch64) -> [Opt_PIC] (OSLinux, ArchAArch64) -> [Opt_PIC, Opt_ExternalDynamicRefs] diff --git a/ghc-warnings.mk-CC-Wall.patch b/ghc-warnings.mk-CC-Wall.patch new file mode 100644 index 0000000..b4eece7 --- /dev/null +++ b/ghc-warnings.mk-CC-Wall.patch @@ -0,0 +1,11 @@ +Index: ghc-9.2.3/mk/warnings.mk +=================================================================== +--- ghc-9.2.3.orig/mk/warnings.mk ++++ ghc-9.2.3/mk/warnings.mk +@@ -1,5 +1,5 @@ + # See Note [Order of warning flags]. +-SRC_CC_OPTS += -Wall $(WERROR) ++#SRC_CC_OPTS += -Wall $(WERROR) + SRC_HC_OPTS += -Wall + # Don't add -Werror to SRC_HC_OPTS_STAGE0 (or SRC_HC_OPTS), because otherwise + # validate may unnecessarily fail when booting with an older compiler. diff --git a/ghc.changes b/ghc.changes index d77b3a8..f71922c 100644 --- a/ghc.changes +++ b/ghc.changes @@ -1,122 +1,37 @@ ------------------------------------------------------------------- -Thu Jan 19 12:39:27 UTC 2023 - Guillaume GARDET +Tue Jan 31 09:37:15 UTC 2023 - Peter Simons -- Do not require unversionned llvm since ghc needs a specific - llvm version. [boo#1207265] +- Update to GHC version 9.4.4. + + * %{buildroot}%{ghclibdir}/include is apparently no longer used by + the RTS package. Those files now live in /usr/lib64/ghc-9.4.4/rts/include. + + * find %{buildroot}%{ghc_html_libraries_dir} -name LICENSE -exec rm '{}' ';' + no longer works because the directory doesn't exist at the time + that command is run. + + * The user manual and Haddock documentation is installed into a + different location. For now, we just list the catchall + %{_docdir}/packages/ghc to accept anything. + + * The LICENSE file for Cabal-syntax lives at libraries/Cabal/Cabal-syntax + instead of the expected place libraries/Cabal-syntax. + + * The package system-cxx-std-lib has no LICENSE file. It's not + even a proper package, it's just a configuration file that lists + some compiler and linker flags. To work around the build error + that causes, we just copy some random LICENSE file into the + place where our build would expect it. ------------------------------------------------------------------- -Tue Jan 17 11:45:32 UTC 2023 - Peter Simons +Fri Jul 8 11:48:57 UTC 2022 - Andreas Schwab -- Apply "fix_extlinks.patch" to work around a bug in Sphinx 6.1.x - that broke our documentation build. Remove this patch once Sphinx - is fixed. This patch is a variant of the ghc-9.4.4 patch from - https://gitlab.haskell.org/ghc/ghc/-/issues/22766. Upstream's - https://github.com/sphinx-doc/sphinx/issues/11094 has further - details. [boo#1207214] +- execstack.patch: add missing stack note ------------------------------------------------------------------- -Mon Jun 27 17:04:51 UTC 2022 - Dirk Müller +Wed Feb 9 13:50:45 UTC 2022 - Peter Simons -- add ghc.keyring to have source validation enabled -- limit to use llvm12 for Factory as newer versions are not supported - -------------------------------------------------------------------- -Fri Apr 29 13:49:29 UTC 2022 - Martin Liška - -- Remove dependency on binutils-gold as the package will be removed - in the future. Gold linker is unmaintained by the upstream project. - -------------------------------------------------------------------- -Tue Mar 8 22:35:07 UTC 2022 - Dirk Müller - -- add ghc-armv7-VFPv3D16--NEON.patch to use vfpv3-d16 on armv7hl - -------------------------------------------------------------------- -Fri Sep 3 20:57:29 UTC 2021 - Ondřej Súkup - -- update to 8.10.7 -- drop 4134.patch and refresh ghc-pie.patch - * portabilit yfixes - * Export some RTS symbols required for static builds of GHC - * Fix LLVM version checking logic so it no longer complains - about supported LLVM versions. - * Fix some RTS crashes on Darwin due to mixing up the closure - sizes of the aarch64 and x86-64 backends. - * Fix a crash on the non-moving GC due to incorrect logic - for calculating the header size for array write barries - * Fix a bug in base leading to a high likelihood of space - leaks when using lazy bytestrings - * Fix some timer races in the RTS possibly manifesting in #18033 and #20132 - * Fix a number of bugs affecting the RTS m32 allocator - * Fix a bug where code may be unloaded prematurely - when using the parallel garbage collector - * Fix a bug where the linker may during shutdown unload code before - libraries’ atexit handlers have a chance to run - * Improve code layout by distiguishing conditional and unconditional branches - * Add hs-boot file support for -ddump-minimal-imports - * Ensure hs-boot files are built before source files in GHCs -M mode - * Fix a long standing GHC API bug affecting clients like HLS where - async exceptions used to cancel threads during typechecking would be - caught by the Template Haskell evaluator and reported as compile errors - * Improve error messages when looking up packages fails - * Fix a number of quirks in GC accounting - * Fix a code generation bug which could result in entry of unlifted - objects in some programs using unboxed sums - * Ensure that POSIX signals are not delivered to the ticker thread - when using the pthread itimer implementation. - * Fix a specialiser bug which could result in the construction - of recursive dictionaries in some programs - * Bump containers to 0.6.4.1 - * Do not treat -Winferred-safe-imports warnings as errors. - * Fix a bug where typechecker plugins could be run with - an inconsistent typechecker environment - * Fix a simplifier bug which lead to an exponential - blow up and excessive memory usage in certain cases - -------------------------------------------------------------------- -Fri Jun 25 10:02:25 UTC 2021 - Ondřej Súkup - -- add 4134.patch to fix build with Sphinx4 - -------------------------------------------------------------------- -Mon Mar 15 20:33:24 UTC 2021 - Dirk Müller - -- always build against llvm9, also on SLE15 (suse_version == 1500) - otherwise the resulting build is not working (llvm is 7.x there) (bsc#1181571) - -------------------------------------------------------------------- -Tue Feb 9 01:29:46 UTC 2021 - Ondřej Súkup - -- update to 8.10.4 - * Fix a crash caused by inappropriate garbage of heap-allocated data - reachable from foreign exports - -------------------------------------------------------------------- -Sun Dec 20 00:29:27 UTC 2020 - Ondřej Súkup - -- update to 8.10.3 - * More robust support for architectures with weak memory ordering - guarantees (e.g. modern ARM hardware). - * GHC can now split dynamic objects to accomodate macOS' RPATH size - limitation when building large projects (#14444) - * Several correctness bugs in the new low-latency garbage collector - * Many, many other bug-fixes)) - -------------------------------------------------------------------- -Thu Dec 17 12:20:00 UTC 2020 - Ondřej Súkup - -- disable %{ix86} build - -------------------------------------------------------------------- -Wed Oct 14 12:20:00 UTC 2020 - Ondřej Súkup - -- force multiversion for subpackages - -------------------------------------------------------------------- -Sat Oct 3 15:58:52 UTC 2020 - Ondřej Súkup - -- add --enable-unregistered to configure phase on unregistered - architectures +- add environ.patch to fix build errors with recent gcc ------------------------------------------------------------------- Sun Aug 9 11:27:32 UTC 2020 - Ondřej Súkup @@ -138,7 +53,7 @@ Sun May 31 18:47:18 UTC 2020 - Ondřej Súkup - cleanup specfile from Leap 42 and older remrants - drop fix-unregisterised-v8.4-8.6.patch -- drop fix-build-using-unregisterized-v8.4.patch +- drop fix-build-using-unregisterized-v8.4.patch ------------------------------------------------------------------- Thu May 7 07:44:47 UTC 2020 - Peter Simons diff --git a/ghc.spec b/ghc.spec index e5404b1..01f25a1 100644 --- a/ghc.spec +++ b/ghc.spec @@ -1,7 +1,7 @@ # # spec file for package ghc # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,6 +16,9 @@ # +%define full_version 9.4.4 +%define short_version 9.4.4 + %ifnarch %{arm} s390x %define with_libnuma 1 %else @@ -29,23 +32,43 @@ %else %global llvm_major 9 %endif -%define full_version 8.10.7 Name: ghc -Version: 8.10.7 +Version: %{short_version} Release: 0 +Summary: The Glorious Glasgow Haskell Compiler +License: BSD-3-Clause URL: https://www.haskell.org/ghc/ Source: https://downloads.haskell.org/~ghc/%{full_version}/ghc-%{version}-src.tar.xz Source1: https://downloads.haskell.org/~ghc/%{full_version}/ghc-%{version}-src.tar.xz.sig Source2: ghc-rpmlintrc Source9: ghc.keyring -Summary: The Glorious Glasgow Haskell Compiler -License: BSD-3-Clause -Group: Development/Languages/Other -ExclusiveArch: aarch64 %{arm} x86_64 ppc64 ppc64le riscv64 s390x +Patch1: ghc-gen_contents_index-haddock-path.patch +# for unregisterized (s390x) +# https://ghc.haskell.org/trac/ghc/ticket/15689 +Patch2: ghc-Cabal-install-PATH-warning.patch +# PATCH-FIX-UPSTREAM Disable-unboxed-arrays.patch ptrommler@icloud.com -- Do not use unboxed arrays on big-endian platforms. See Haskell Trac #15411. +Patch3: Disable-unboxed-arrays.patch +# https://phabricator.haskell.org/rGHC4eebc8016f68719e1ccdf460754a97d1f4d6ef05 +Patch6: ghc-8.6.3-sphinx-1.8.patch +# PATCH-FIX-UPSTREAM execstack.patch -- RTS: Add stack marker to StgCRunAsm.S +Patch7: execstack.patch +# Work around a bug in Sphinx 6.1.x to fix the documentation build. Remove this patch ASAP. +Patch8: fix_extlinks.patch +# unregisterized +# PATCH-FIX-UPSTREAM ghc-pie.patch - set linux as default PIE platform +Patch35: ghc-pie.patch +# PATCH-FIX-OPENSUSE ghc-8.0.2-Cabal-dynlibdir.patch -- Fix shared library directory location. +Patch100: ghc-8.0.2-Cabal-dynlibdir.patch + +Patch120: libatomic.patch +Patch130: riscv-tntc.patch + + BuildRequires: binutils-devel -BuildRequires: gcc -BuildRequires: ghc-bootstrap >= 8.6 +BuildRequires: gcc-PIE +BuildRequires: ghc-bootstrap >= 8.10.7 +BuildRequires: ghc-bootstrap-helpers >= 1.3 BuildRequires: ghc-rpm-macros-extra BuildRequires: glibc-devel BuildRequires: gmp-devel @@ -56,37 +79,25 @@ BuildRequires: libtool BuildRequires: memory-constraints BuildRequires: ncurses-devel BuildRequires: pkg-config +BuildRequires: python3 BuildRequires: xz -%ifarch aarch64 %{arm} -BuildRequires: clang%{llvm_major} +Requires: ghc-compiler = %{version}-%{release} +Requires: ghc-ghc-devel = %{version}-%{release} +Requires: ghc-devel = %{version}-%{release} +# FIXME: use proper Requires(pre/post/preun/...) +PreReq: update-alternatives +ExclusiveArch: aarch64 x86_64 ppc64 ppc64le riscv64 s390x +# %ifarch riscv64 s390x BuildRequires: llvm%{llvm_major} BuildRequires: llvm%{llvm_major}-devel -%endif +BuildRequires: clang%{llvm_major} +# %endif %if %{undefined without_manual} BuildRequires: python3-Sphinx %endif -%if %with_libnuma +%if %{with_libnuma} BuildRequires: libnuma-devel %endif -BuildRequires: ghc-bootstrap-helpers - -PreReq: update-alternatives - -Requires: ghc-compiler = %{version}-%{release} -Requires: ghc-ghc-devel = %{version}-%{release} -Requires: ghc-libraries = %{version}-%{release} -# Work around a bug in Sphinx 6.1.x to fix the documentation build. Remove this patch ASAP. -Patch1: fix_extlinks.patch -# PATCH-FIX-OPENSUSE: use vfpv3-d16 and disable NEON -Patch2: ghc-armv7-VFPv3D16--NEON.patch -# PATCH-FIX-UPSTREAM Disable-unboxed-arrays.patch ptrommler@icloud.com -- Do not use unboxed arrays on big-endian platforms. See Haskell Trac #15411. -Patch3: Disable-unboxed-arrays.patch -# PATCH-FIX-UPSTREAM ghc-pie.patch - set linux as default PIE platform -Patch35: ghc-pie.patch -# PATCH-FIX-OPENSUSE ghc-8.0.2-Cabal-dynlibdir.patch -- Fix shared library directory location. -Patch100: ghc-8.0.2-Cabal-dynlibdir.patch -# PATCH-FIX-UPSTREAM buildpath-abi-stability.patch -- debian patch for more stable abi-1 -Patch110: buildpath-abi-stability.patch %description Haskell is the standard purely functional programming language; the @@ -107,20 +118,13 @@ Haskell home page at . %package compiler Summary: GHC compiler and utilities -Group: Development/Languages/Other Requires: gcc Requires: ghc-base-devel Requires(post): update-alternatives -Requires(postun):update-alternatives -%ifarch aarch64 %{arm} -Requires: binutils-gold -%endif -%ifarch aarch64 %{arm} +Requires(postun): update-alternatives +%ifarch riscv64 s390x Requires: clang%{llvm_major} Requires: llvm%{llvm_major} -%else -Suggests: clang%{llvm_major} -Suggests: llvm%{llvm_major} %endif %description compiler @@ -130,10 +134,9 @@ The GHC libraries are provided by ghc-devel. To install all of GHC install package ghc. %global ghc_version_override %{version} - %global ghc_pkg_c_deps ghc-compiler = %{ghc_version_override}-%{release} -%if %with_libnuma +%if %{with_libnuma} %define libnuma_dep ,libnuma-devel %else %define libnuma_dep %{nil} @@ -141,52 +144,55 @@ To install all of GHC install package ghc. %if %{defined ghclibdir} #!ForceMultiversion -%ghc_lib_subpackage -d Cabal-3.2.1.0 +%ghc_lib_subpackage -d Cabal-3.8.1.0 +%ghc_lib_subpackage -d Cabal-syntax-3.8.1.0 %ghc_lib_subpackage -d array-0.5.4.0 -%ghc_lib_subpackage -d -c gmp-devel,libffi-devel,libdw-devel,libelf-devel%{libnuma_dep} base-4.14.3.0 -%ghc_lib_subpackage -d binary-0.8.8.0 -%ghc_lib_subpackage -d bytestring-0.10.12.0 -%ghc_lib_subpackage -d containers-0.6.5.1 -%ghc_lib_subpackage -d deepseq-1.4.4.0 -%ghc_lib_subpackage -d directory-1.3.6.0 -%ghc_lib_subpackage -d exceptions-0.10.4 -%ghc_lib_subpackage -d filepath-1.4.2.1 +%ghc_lib_subpackage -d -c gmp-devel,libffi-devel,libdw-devel,libelf-devel%{libnuma_dep} base-4.17.0.0 +%ghc_lib_subpackage -d binary-0.8.9.1 +%ghc_lib_subpackage -d bytestring-0.11.3.1 +%ghc_lib_subpackage -d containers-0.6.6 +%ghc_lib_subpackage -d deepseq-1.4.8.0 +%ghc_lib_subpackage -d directory-1.3.7.1 +%ghc_lib_subpackage -d exceptions-0.10.5 +%ghc_lib_subpackage -d filepath-1.4.2.2 %ghc_lib_subpackage -d -x ghc-%{ghc_version_override} -%ghc_lib_subpackage -d ghc-boot-%{ghc_version_override} +%ghc_lib_subpackage -d -x ghc-boot-%{ghc_version_override} %ghc_lib_subpackage -d ghc-boot-th-%{ghc_version_override} -%ghc_lib_subpackage -d ghc-compact-0.1.0.0 -%ghc_lib_subpackage -d ghc-heap-%{ghc_version_override} +%ghc_lib_subpackage -d ghc-bignum-1.3 +%ghc_lib_subpackage -d -x ghc-compact-0.1.0.0 +%ghc_lib_subpackage -d -x ghc-heap-%{ghc_version_override} %ghc_lib_subpackage -d -x ghci-%{ghc_version_override} %ghc_lib_subpackage -d haskeline-0.8.2 -%ghc_lib_subpackage -d hpc-0.6.1.0 -%ghc_lib_subpackage -d libiserv-%{ghc_version_override} +%ghc_lib_subpackage -d -x hpc-0.6.1.0 +%ghc_lib_subpackage -d -x libiserv-%{ghc_version_override} %ghc_lib_subpackage -d mtl-2.2.2 -%ghc_lib_subpackage -d parsec-3.1.14.0 +%ghc_lib_subpackage -d parsec-3.1.15.0 %ghc_lib_subpackage -d pretty-1.1.3.6 -%ghc_lib_subpackage -d process-1.6.13.2 -%ghc_lib_subpackage -d stm-2.5.0.1 -%ghc_lib_subpackage -d template-haskell-2.16.0.0 -%ghc_lib_subpackage -d -c ncurses-devel terminfo-0.4.1.4 -%ghc_lib_subpackage -d text-1.2.4.1 -%ghc_lib_subpackage -d time-1.9.3 +%ghc_lib_subpackage -d process-1.6.16.0 +%ghc_lib_subpackage -d stm-2.5.1.0 +%ghc_lib_subpackage -d -c libstdc++-devel system-cxx-std-lib-1.0 +%ghc_lib_subpackage -d template-haskell-2.19.0.0 +%ghc_lib_subpackage -d -c ncurses-devel terminfo-0.4.1.5 +%ghc_lib_subpackage -d text-2.0.1 +%ghc_lib_subpackage -d time-1.12.2 %ghc_lib_subpackage -d transformers-0.5.6.2 -%ghc_lib_subpackage -d unix-2.7.2.2 +%ghc_lib_subpackage -d unix-2.7.3 %ghc_lib_subpackage -d xhtml-3000.2.2.1 %endif + %global version %{ghc_version_override} -%package libraries +%package devel +%{?ghc_packages_list:Requires: %(echo %{ghc_packages_list} | sed -e "s/\([^ ]*\)-\([^ ]*\)/ghc-\1-devel = \2-%{release},/g")} Summary: GHC development libraries meta package -Group: Development/Libraries/Other Requires: ghc-compiler = %{version}-%{release} -Obsoletes: ghc-devel < %{version}-%{release} -Provides: ghc-devel = %{version}-%{release} +Obsoletes: ghc-libraries < %{version}-%{release} +Provides: ghc-libraries = %{version}-%{release} Obsoletes: ghc-prof < %{version}-%{release} Provides: ghc-prof = %{version}-%{release} -%{?ghc_packages_list:Requires: %(echo %{ghc_packages_list} | sed -e "s/\([^ ]*\)-\([^ ]*\)/ghc-\1-devel = \2-%{release},/g")} -%description libraries +%description devel This is a meta-package for all the development library packages in GHC except the ghc library, which is installed by the toplevel ghc metapackage. @@ -194,16 +200,20 @@ except the ghc library, which is installed by the toplevel ghc metapackage. %setup -q %patch1 -p1 %patch2 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 %ifarch ppc64 s390 s390x %patch3 -p1 %endif %patch35 -p1 %patch100 -p1 -%patch110 -p1 +%patch120 -p1 +# %patch130 -p1 %build -cat > mk/build.mk < mk/build.mk << EOF +%ifarch s390x riscv64 BuildFlavour = perf-llvm %else BuildFlavour = perf @@ -232,6 +242,9 @@ SRC_CC_OPTS += -fno-builtin -Wno-return-type %endif %if %{defined without_haddock} HADDOCK_DOCS = NO +%else +HADDOCK_DOCS = YES +EXTRA_HADDOCK_OPTS += --hyperlinked-source --hoogle --quickjump %endif BUILD_SPHINX_PS = NO %if %{defined without_manual} @@ -243,19 +256,32 @@ HSCOLOUR_SRCS = NO %endif EOF -export CFLAGS="${CFLAGS:-%optflags}" -./configure --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} \ +%ifnarch s390x riscv64 +export CC=%{_bindir}/gcc +%else +export CC=%{_bindir}/clang +%endif + +%{ghc_set_gcc_flags} +export LANG=C.utf8 +./boot.source +sed -i -e 's/MinBootGhcVersion="9.0"/MinBootGhcVersion="8.10"/' configure +# FIXME: you should use the %%configure macro +./configure --prefix=%{_prefix} --exec-prefix=%{_prefix} \ --bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} \ --datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} \ --libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} \ --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} \ -%ifarch %{unregisterised_archs} + --docdir=%{_docdir}/ghc \ +%ifarch %{unregisterized_archs} --enable-unregisterised \ %endif --with-system-libffi +%{nil} + %if 0%{?suse_version} >= 1500 -%ifarch %{unregisterised_archs} +%ifarch %{unregisterised_archs} riscv64 %if 0%{?qemu_user_space_build} %limit_build -m 15000 %else @@ -264,35 +290,45 @@ export CFLAGS="${CFLAGS:-%optflags}" %else %limit_build -m 2000 %endif -make %{?_smp_mflags} +%make_build %else -make -j 2 +%make_build -j 2 %endif + %install -%makeinstall +%make_install +cp -p libraries/containers/containers/LICENSE libraries/containers/LICENSE +install -D -m 644 libraries/Cabal/Cabal-syntax/LICENSE libraries/Cabal-syntax/LICENSE +install -D -m 644 libraries/Cabal/Cabal-syntax/LICENSE libraries/system-cxx-std-lib/LICENSE + for i in %{ghc_packages_list}; do name=$(echo $i | sed -e "s/\(.*\)-.*/\1/") ver=$(echo $i | sed -e "s/.*-\(.*\)/\1/") %ghc_gen_filelists $name $ver -# TODO: containers have license in $name/$name -#echo "%%doc libraries/$name/LICENSE" >> ghc-$name.files +echo "%%doc libraries/$name/LICENSE" >> ghc-$name.files done # ghc-base should own ghclibdir echo "%dir %{ghclibdir}" >> ghc-base.files + %ghc_gen_filelists ghc %{ghc_version_override} +%ghc_gen_filelists ghc-boot %{ghc_version_override} +%ghc_gen_filelists ghc-compact 0.1.0.0 +%ghc_gen_filelists ghc-heap %{ghc_version_override} %ghc_gen_filelists ghci %{ghc_version_override} -%ghc_gen_filelists ghc-prim 0.6.1 -%ghc_gen_filelists integer-gmp 1.0.3.0 +%ghc_gen_filelists hpc 0.6.1.0 +%ghc_gen_filelists libiserv %{ghc_version_override} +%ghc_gen_filelists ghc-prim 0.9.0 +%ghc_gen_filelists integer-gmp 1.1 %define merge_filelist()\ -cat ghc-%1.files >> ghc-%2.files\ -cat ghc-%1-devel.files >> ghc-%2-devel.files\ -cp -p libraries/%1/LICENSE libraries/LICENSE.%1\ -echo "%doc libraries/LICENSE.%1" >> ghc-%2.files +cat ghc-%{1}.files >> ghc-%{2}.files\ +cat ghc-%{1}-devel.files >> ghc-%{2}-devel.files\ +cp -p libraries/%{1}/LICENSE libraries/LICENSE.%{1}\ +echo "%doc libraries/LICENSE.%{1}" >> ghc-%{2}.files %merge_filelist integer-gmp base %merge_filelist ghc-prim base @@ -303,7 +339,7 @@ ls %{buildroot}%{ghclibdir}/rts/libHS*.so >> ghc-base.files sed -i -e "s|^%{buildroot}||g" ghc-base.files %endif echo %%dir %{ghclibdir}/rts >> ghc-base-devel.files -ls -d %{buildroot}%{ghclibdir}/rts/libHS*.a %{buildroot}%{ghclibdir}/package.conf.d/rts.conf %{buildroot}%{ghclibdir}/include >> ghc-base-devel.files +ls -d %{buildroot}%{ghclibdir}/rts/libHS*.a %{buildroot}%{ghclibdir}/package.conf.d/rts.conf >> ghc-base-devel.files sed -i -e "s|^%{buildroot}||g" ghc-base-devel.files # these are handled as alternatives @@ -318,7 +354,9 @@ for i in hsc2hs runhaskell; do touch %{buildroot}%{_sysconfdir}/alternatives/$i done -find %{buildroot}%{ghclibdocdir} -name LICENSE -exec rm '{}' ';' +# Fails with find: '/home/abuild/rpmbuild/BUILDROOT/ghc-9.4.4-0.x86_64/usr/share/doc/ghc-9.4.4/html/libraries': No such file or directory +# find %{buildroot}%{ghc_html_libraries_dir} -name LICENSE -exec rm '{}' ';' +mkdir -p %{buildroot}%{ghc_html_libraries_dir} %check # Actually, I took this from Jens Petersen's Fedora package @@ -387,6 +425,8 @@ fi %{_bindir}/runhaskell-ghc %dir %{ghclibdir} %{ghclibdir}/settings +%{ghclibdir}/llvm-passes +%{ghclibdir}/llvm-targets %dir %{ghclibdir}/bin %{ghclibdir}/bin/ghc %{ghclibdir}/bin/ghc-pkg @@ -401,13 +441,11 @@ fi %dir %{ghclibdir}/package.conf.d %ghost %{ghclibdir}/package.conf.d/package.cache %ghost %{ghclibdir}/package.conf.d/package.cache.lock -%{ghclibdir}/platformConstants +#%%{ghclibdir}/platformConstants %{ghclibdir}/bin/runghc %{ghclibdir}/template-hsc.h %{ghclibdir}/bin/unlit -%dir %{_datadir}/doc/ghc-%{version} -%dir %{ghcdocbasedir} -%dir %{ghcdocbasedir}/libraries +%dir %{_docdir}/ghc %if %{undefined without_manual} %{_mandir}/man1/ghc.* %endif @@ -416,27 +454,27 @@ fi %{_bindir}/haddock-ghc-%{version} %{ghclibdir}/html %{ghclibdir}/latex -%{ghclibdir}/llvm-passes -%{ghclibdir}/llvm-targets %{ghclibdir}/bin/haddock -%if %{undefined without_manual} -%{ghcdocbasedir}/haddock -%{ghcdocbasedir}/users_guide -%endif -%{ghcdocbasedir}/libraries/gen_contents_index -%{ghcdocbasedir}/libraries/*.css -%{ghcdocbasedir}/libraries/prologue.txt -%{ghcdocbasedir}/libraries/synopsis.png -%{ghcdocbasedir}/index.html -%ghost %{ghcdocbasedir}/libraries/doc-index*.html -%ghost %{ghcdocbasedir}/libraries/haddock-bundle.min.js -%ghost %{ghcdocbasedir}/libraries/haddock-util.js -%ghost %{ghcdocbasedir}/libraries/index*.html -%ghost %{ghcdocbasedir}/libraries/minus.gif -%ghost %{ghcdocbasedir}/libraries/plus.gif +%ghost %{ghc_html_dir}/libraries/doc-index*.html +%ghost %{ghc_html_dir}/libraries/haddock-bundle.min.js +%ghost %{ghc_html_dir}/libraries/haddock-util.js +%ghost %{ghc_html_dir}/libraries/index*.html +%ghost %{ghc_html_dir}/libraries/minus.gif +%ghost %{ghc_html_dir}/libraries/plus.gif %endif -%files libraries +# ghc-compiler-9.4.4-0.x86_64.rpm: directories not owned by a package: +%dir /usr/share/doc/ghc-9.4.4 +%dir /usr/share/doc/ghc-9.4.4/html +%dir /usr/share/doc/ghc-9.4.4/html/libraries + +# Just accept all documentation. +/usr/share/doc/packages/ghc + +# The RTS include files have moved. +/usr/lib64/ghc-%{short_version}/rts/include + +%files devel %license LICENSE %changelog diff --git a/libatomic.patch b/libatomic.patch new file mode 100644 index 0000000..ca5d2fc --- /dev/null +++ b/libatomic.patch @@ -0,0 +1,24 @@ +Index: ghc-9.2.3/rts/package.conf.in +=================================================================== +--- ghc-9.2.3.orig/rts/package.conf.in ++++ ghc-9.2.3/rts/package.conf.in +@@ -66,6 +66,7 @@ extra-libraries: + #if NEED_ATOMIC_LIB + , "atomic" + #endif ++ , "atomic" + + #if defined(INSTALLING) + include-dirs: INCLUDE_DIR FFI_INCLUDE_DIR +Index: ghc-9.2.3/rts/rts.cabal.in +=================================================================== +--- ghc-9.2.3.orig/rts/rts.cabal.in ++++ ghc-9.2.3/rts/rts.cabal.in +@@ -144,6 +144,7 @@ library + extra-libraries: elf dw + if flag(libnuma) + extra-libraries: numa ++ extra-libraries: atomic + if !flag(smp) + cpp-options: -DNOSMP + diff --git a/riscv-tntc.patch b/riscv-tntc.patch new file mode 100644 index 0000000..70c7bb8 --- /dev/null +++ b/riscv-tntc.patch @@ -0,0 +1,74 @@ +Index: ghc-9.2.1/compiler/GHC/CmmToLlvm/Mangler.hs +=================================================================== +--- ghc-9.2.1.orig/compiler/GHC/CmmToLlvm/Mangler.hs ++++ ghc-9.2.1/compiler/GHC/CmmToLlvm/Mangler.hs +@@ -43,7 +43,7 @@ llvmFixupAsm logger dflags f1 f2 = {-# S + + -- | These are the rewrites that the mangler will perform + rewrites :: [Rewrite] +-rewrites = [rewriteSymType, rewriteAVX] ++rewrites = [rewriteSymType, rewriteAVX, rewriteCall] + + type Rewrite = DynFlags -> B.ByteString -> Maybe B.ByteString + +@@ -107,6 +107,27 @@ rewriteAVX dflags s + isVmovdqa = B.isPrefixOf (B.pack "vmovdqa") + isVmovap = B.isPrefixOf (B.pack "vmovap") + ++-- | This rewrites (tail) calls to avoid creating PLT entries for ++-- functions on riscv64. The replacement will load the address from the ++-- GOT, which is resolved to point to the real address of the function. ++rewriteCall :: Rewrite ++rewriteCall dflags l ++ | not isRISCV64 = Nothing ++ | isCall l = Just $ replaceCall "call" "jalr" "ra" l ++ | isTail l = Just $ replaceCall "tail" "jr" "t1" l ++ | otherwise = Nothing ++ where ++ isRISCV64 = platformArch (targetPlatform dflags) == ArchRISCV64 ++ isCall = B.isPrefixOf (B.pack "call\t") ++ isTail = B.isPrefixOf (B.pack "tail\t") ++ ++ replaceCall call jump reg l = ++ appendInsn (jump ++ "\t" ++ reg) $ removePlt $ ++ replaceOnce (B.pack call) (B.pack ("la\t" ++ reg ++ ",")) l ++ where ++ removePlt = replaceOnce (B.pack "@plt") (B.pack "") ++ appendInsn i = (`B.append` B.pack ("\n\t" ++ i)) ++ + -- | @replaceOnce match replace bs@ replaces the first occurrence of the + -- substring @match@ in @bs@ with @replace@. + replaceOnce :: B.ByteString -> B.ByteString -> B.ByteString -> B.ByteString +Index: ghc-9.2.1/configure.ac +=================================================================== +--- ghc-9.2.1.orig/configure.ac ++++ ghc-9.2.1/configure.ac +@@ -322,7 +322,7 @@ AC_MSG_CHECKING(whether target supports + case "$Unregisterised" in + NO) + case "$TargetArch" in +- ia64|powerpc64|powerpc64le|s390x|riscv64) ++ ia64|powerpc64|powerpc64le|s390x) + TablesNextToCodeDefault=NO + AC_MSG_RESULT([no]) + ;; +Index: ghc-9.2.1/libraries/ghci/GHCi/InfoTable.hsc +=================================================================== +--- ghc-9.2.1.orig/libraries/ghci/GHCi/InfoTable.hsc ++++ ghc-9.2.1/libraries/ghci/GHCi/InfoTable.hsc +@@ -241,6 +241,15 @@ mkJumpToAddr a = case hostPlatformArch o + 0xC0, 0x19, byte3 w64, byte2 w64, byte1 w64, byte0 w64, + 0x07, 0xF1 ] + ++ ArchRISCV64 -> pure $ ++ let w64 = fromIntegral (funPtrToInt a) :: Word64 ++ in Right [ 0x00000297 -- auipc t0,0 ++ , 0x01053283 -- ld t0,16(t0) ++ , 0x00028067 -- jr t0 ++ , 0x00000013 -- nop ++ , fromIntegral w64 ++ , fromIntegral (w64 `shiftR` 32) ] ++ + arch -> + -- The arch isn't supported. You either need to add your architecture as a + -- distinct case, or use non-TABLES_NEXT_TO_CODE mode. diff --git a/riscv.patch b/riscv.patch new file mode 100644 index 0000000..7c67b5c --- /dev/null +++ b/riscv.patch @@ -0,0 +1,778 @@ +Index: ghc-8.10.7/aclocal.m4 +=================================================================== +--- ghc-8.10.7.orig/aclocal.m4 ++++ ghc-8.10.7/aclocal.m4 +@@ -231,7 +231,10 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_V + mipsel) + test -z "[$]2" || eval "[$]2=ArchMipsel" + ;; +- hppa|hppa1_1|ia64|m68k|nios2|riscv32|riscv64|rs6000|s390|sh4|vax) ++ riscv64) ++ test -z "[$]2" || eval "[$]2=ArchRISCV64" ++ ;; ++ hppa|hppa1_1|ia64|m68k|nios2|riscv32|rs6000|s390|sh4|vax) + test -z "[$]2" || eval "[$]2=ArchUnknown" + ;; + *) +Index: ghc-8.10.7/compiler/GHC/Platform/RISCV64.hs +=================================================================== +--- /dev/null ++++ ghc-8.10.7/compiler/GHC/Platform/RISCV64.hs +@@ -0,0 +1,10 @@ ++{-# LANGUAGE CPP #-} ++ ++module GHC.Platform.RISCV64 where ++ ++import GhcPrelude ++ ++#define MACHREGS_NO_REGS 0 ++#define MACHREGS_riscv64 1 ++#include "../../../includes/CodeGen.Platform.hs" ++ +Index: ghc-8.10.7/compiler/GHC/Platform/Regs.hs +=================================================================== +--- ghc-8.10.7.orig/compiler/GHC/Platform/Regs.hs ++++ ghc-8.10.7/compiler/GHC/Platform/Regs.hs +@@ -15,6 +15,7 @@ import qualified GHC.Platform.S390X + import qualified GHC.Platform.SPARC as SPARC + import qualified GHC.Platform.X86 as X86 + import qualified GHC.Platform.X86_64 as X86_64 ++import qualified GHC.Platform.RISCV64 as RISCV64 + import qualified GHC.Platform.NoRegs as NoRegs + + -- | Returns 'True' if this global register is stored in a caller-saves +@@ -31,6 +32,7 @@ callerSaves platform + ArchSPARC -> SPARC.callerSaves + ArchARM {} -> ARM.callerSaves + ArchAArch64 -> AArch64.callerSaves ++ ArchRISCV64 -> RISCV64.callerSaves + arch + | arch `elem` [ArchPPC, ArchPPC_64 ELF_V1, ArchPPC_64 ELF_V2] -> + PPC.callerSaves +@@ -53,6 +55,7 @@ activeStgRegs platform + ArchSPARC -> SPARC.activeStgRegs + ArchARM {} -> ARM.activeStgRegs + ArchAArch64 -> AArch64.activeStgRegs ++ ArchRISCV64 -> RISCV64.activeStgRegs + arch + | arch `elem` [ArchPPC, ArchPPC_64 ELF_V1, ArchPPC_64 ELF_V2] -> + PPC.activeStgRegs +@@ -70,6 +73,7 @@ haveRegBase platform + ArchSPARC -> SPARC.haveRegBase + ArchARM {} -> ARM.haveRegBase + ArchAArch64 -> AArch64.haveRegBase ++ ArchRISCV64 -> RISCV64.haveRegBase + arch + | arch `elem` [ArchPPC, ArchPPC_64 ELF_V1, ArchPPC_64 ELF_V2] -> + PPC.haveRegBase +@@ -87,6 +91,7 @@ globalRegMaybe platform + ArchSPARC -> SPARC.globalRegMaybe + ArchARM {} -> ARM.globalRegMaybe + ArchAArch64 -> AArch64.globalRegMaybe ++ ArchRISCV64 -> RISCV64.globalRegMaybe + arch + | arch `elem` [ArchPPC, ArchPPC_64 ELF_V1, ArchPPC_64 ELF_V2] -> + PPC.globalRegMaybe +@@ -104,6 +109,7 @@ freeReg platform + ArchSPARC -> SPARC.freeReg + ArchARM {} -> ARM.freeReg + ArchAArch64 -> AArch64.freeReg ++ ArchRISCV64 -> RISCV64.freeReg + arch + | arch `elem` [ArchPPC, ArchPPC_64 ELF_V1, ArchPPC_64 ELF_V2] -> + PPC.freeReg +Index: ghc-8.10.7/compiler/ghc.cabal.in +=================================================================== +--- ghc-8.10.7.orig/compiler/ghc.cabal.in ++++ ghc-8.10.7/compiler/ghc.cabal.in +@@ -294,6 +294,7 @@ Library + GHC.Platform.AArch64 + GHC.Platform.NoRegs + GHC.Platform.PPC ++ GHC.Platform.RISCV64 + GHC.Platform.S390X + GHC.Platform.SPARC + GHC.Platform.X86 +Index: ghc-8.10.7/compiler/main/DriverPipeline.hs +=================================================================== +--- ghc-8.10.7.orig/compiler/main/DriverPipeline.hs ++++ ghc-8.10.7/compiler/main/DriverPipeline.hs +@@ -937,6 +937,7 @@ llvmOptions dflags = + ++ [("", "-mcpu=" ++ mcpu) | not (null mcpu) + , not (any (isInfixOf "-mcpu") (getOpts dflags opt_lc)) ] + ++ [("", "-mattr=" ++ attrs) | not (null attrs) ] ++ ++ [("", "-target-abi=" ++ abi) | not (null abi) ] + + where target = platformMisc_llvmTarget $ platformMisc dflags + Just (LlvmTarget _ mcpu mattr) = lookup target (llvmTargets $ llvmConfig dflags) +@@ -966,6 +967,11 @@ llvmOptions dflags = + ++ ["+bmi" | isBmiEnabled dflags ] + ++ ["+bmi2" | isBmi2Enabled dflags ] + ++ abi :: String ++ abi = case platformArch (targetPlatform dflags) of ++ ArchRISCV64 -> "lp64d" ++ _ -> "" ++ + -- ----------------------------------------------------------------------------- + -- | Each phase in the pipeline returns the next phase to execute, and the + -- name of the file in which the output was placed. +Index: ghc-8.10.7/compiler/nativeGen/AsmCodeGen.hs +=================================================================== +--- ghc-8.10.7.orig/compiler/nativeGen/AsmCodeGen.hs ++++ ghc-8.10.7/compiler/nativeGen/AsmCodeGen.hs +@@ -177,6 +177,7 @@ nativeCodeGen dflags this_mod modLoc h u + ArchAlpha -> panic "nativeCodeGen: No NCG for Alpha" + ArchMipseb -> panic "nativeCodeGen: No NCG for mipseb" + ArchMipsel -> panic "nativeCodeGen: No NCG for mipsel" ++ ArchRISCV64 -> panic "nativeCodeGen: No NCG for RISCV64" + ArchUnknown -> panic "nativeCodeGen: No NCG for unknown arch" + ArchJavaScript-> panic "nativeCodeGen: No NCG for JavaScript" + +Index: ghc-8.10.7/compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs +=================================================================== +--- ghc-8.10.7.orig/compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs ++++ ghc-8.10.7/compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs +@@ -120,6 +120,7 @@ trivColorable platform virtualRegSqueeze + ArchMipseb -> panic "trivColorable ArchMipseb" + ArchMipsel -> panic "trivColorable ArchMipsel" + ArchS390X -> panic "trivColorable ArchS390X" ++ ArchRISCV64 -> panic "trivColorable ArchRISCV64" + ArchJavaScript-> panic "trivColorable ArchJavaScript" + ArchUnknown -> panic "trivColorable ArchUnknown") + , count2 <- accSqueeze 0 cALLOCATABLE_REGS_INTEGER +@@ -151,6 +152,7 @@ trivColorable platform virtualRegSqueeze + ArchMipseb -> panic "trivColorable ArchMipseb" + ArchMipsel -> panic "trivColorable ArchMipsel" + ArchS390X -> panic "trivColorable ArchS390X" ++ ArchRISCV64 -> panic "trivColorable ArchRISCV64" + ArchJavaScript-> panic "trivColorable ArchJavaScript" + ArchUnknown -> panic "trivColorable ArchUnknown") + , count2 <- accSqueeze 0 cALLOCATABLE_REGS_FLOAT +@@ -184,6 +186,7 @@ trivColorable platform virtualRegSqueeze + ArchMipseb -> panic "trivColorable ArchMipseb" + ArchMipsel -> panic "trivColorable ArchMipsel" + ArchS390X -> panic "trivColorable ArchS390X" ++ ArchRISCV64 -> panic "trivColorable ArchRISCV64" + ArchJavaScript-> panic "trivColorable ArchJavaScript" + ArchUnknown -> panic "trivColorable ArchUnknown") + , count2 <- accSqueeze 0 cALLOCATABLE_REGS_DOUBLE +Index: ghc-8.10.7/compiler/nativeGen/RegAlloc/Linear/FreeRegs.hs +=================================================================== +--- ghc-8.10.7.orig/compiler/nativeGen/RegAlloc/Linear/FreeRegs.hs ++++ ghc-8.10.7/compiler/nativeGen/RegAlloc/Linear/FreeRegs.hs +@@ -84,5 +84,6 @@ maxSpillSlots dflags + ArchAlpha -> panic "maxSpillSlots ArchAlpha" + ArchMipseb -> panic "maxSpillSlots ArchMipseb" + ArchMipsel -> panic "maxSpillSlots ArchMipsel" ++ ArchRISCV64 -> panic "maxSpillSlots ArchRISCV64" + ArchJavaScript-> panic "maxSpillSlots ArchJavaScript" + ArchUnknown -> panic "maxSpillSlots ArchUnknown" +Index: ghc-8.10.7/compiler/nativeGen/RegAlloc/Linear/Main.hs +=================================================================== +--- ghc-8.10.7.orig/compiler/nativeGen/RegAlloc/Linear/Main.hs ++++ ghc-8.10.7/compiler/nativeGen/RegAlloc/Linear/Main.hs +@@ -221,6 +221,7 @@ linearRegAlloc dflags entry_ids block_li + ArchAlpha -> panic "linearRegAlloc ArchAlpha" + ArchMipseb -> panic "linearRegAlloc ArchMipseb" + ArchMipsel -> panic "linearRegAlloc ArchMipsel" ++ ArchRISCV64 -> panic "linearRegAlloc ArchRISCV64" + ArchJavaScript -> panic "linearRegAlloc ArchJavaScript" + ArchUnknown -> panic "linearRegAlloc ArchUnknown" + where +Index: ghc-8.10.7/compiler/nativeGen/TargetReg.hs +=================================================================== +--- ghc-8.10.7.orig/compiler/nativeGen/TargetReg.hs ++++ ghc-8.10.7/compiler/nativeGen/TargetReg.hs +@@ -53,6 +53,7 @@ targetVirtualRegSqueeze platform + ArchAlpha -> panic "targetVirtualRegSqueeze ArchAlpha" + ArchMipseb -> panic "targetVirtualRegSqueeze ArchMipseb" + ArchMipsel -> panic "targetVirtualRegSqueeze ArchMipsel" ++ ArchRISCV64 -> panic "targetVirtualRegSqueeze ArchRISCV64" + ArchJavaScript-> panic "targetVirtualRegSqueeze ArchJavaScript" + ArchUnknown -> panic "targetVirtualRegSqueeze ArchUnknown" + +@@ -72,6 +73,7 @@ targetRealRegSqueeze platform + ArchAlpha -> panic "targetRealRegSqueeze ArchAlpha" + ArchMipseb -> panic "targetRealRegSqueeze ArchMipseb" + ArchMipsel -> panic "targetRealRegSqueeze ArchMipsel" ++ ArchRISCV64 -> panic "targetRealRegSqueeze ArchRISCV64" + ArchJavaScript-> panic "targetRealRegSqueeze ArchJavaScript" + ArchUnknown -> panic "targetRealRegSqueeze ArchUnknown" + +@@ -90,6 +92,7 @@ targetClassOfRealReg platform + ArchAlpha -> panic "targetClassOfRealReg ArchAlpha" + ArchMipseb -> panic "targetClassOfRealReg ArchMipseb" + ArchMipsel -> panic "targetClassOfRealReg ArchMipsel" ++ ArchRISCV64 -> panic "targetClassOfRealReg ArchRISCV64" + ArchJavaScript-> panic "targetClassOfRealReg ArchJavaScript" + ArchUnknown -> panic "targetClassOfRealReg ArchUnknown" + +@@ -108,6 +111,7 @@ targetMkVirtualReg platform + ArchAlpha -> panic "targetMkVirtualReg ArchAlpha" + ArchMipseb -> panic "targetMkVirtualReg ArchMipseb" + ArchMipsel -> panic "targetMkVirtualReg ArchMipsel" ++ ArchRISCV64 -> panic "targetMkVirtualReg ArchRISCV64" + ArchJavaScript-> panic "targetMkVirtualReg ArchJavaScript" + ArchUnknown -> panic "targetMkVirtualReg ArchUnknown" + +@@ -126,6 +130,7 @@ targetRegDotColor platform + ArchAlpha -> panic "targetRegDotColor ArchAlpha" + ArchMipseb -> panic "targetRegDotColor ArchMipseb" + ArchMipsel -> panic "targetRegDotColor ArchMipsel" ++ ArchRISCV64 -> panic "targetRegDotColor ArchRISCV64" + ArchJavaScript-> panic "targetRegDotColor ArchJavaScript" + ArchUnknown -> panic "targetRegDotColor ArchUnknown" + +Index: ghc-8.10.7/configure +=================================================================== +--- ghc-8.10.7.orig/configure ++++ ghc-8.10.7/configure +@@ -4921,7 +4921,7 @@ esac + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether target supports a registerised ABI" >&5 + printf %s "checking whether target supports a registerised ABI... " >&6; } + case "$TargetArch" in +- i386|x86_64|powerpc|powerpc64|powerpc64le|s390x|arm|aarch64) ++ i386|x86_64|powerpc|powerpc64|powerpc64le|s390x|arm|aarch64|riscv64) + UnregisterisedDefault=NO + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + printf "%s\n" "yes" >&6; } +@@ -4972,7 +4972,7 @@ printf %s "checking whether target suppo + case "$Unregisterised" in + NO) + case "$TargetArch" in +- ia64|powerpc64|powerpc64le|s390x) ++ ia64|powerpc64|powerpc64le|s390x|riscv64) + TablesNextToCodeDefault=NO + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + printf "%s\n" "no" >&6; } +@@ -5030,7 +5030,7 @@ fi + + + case "$target" in +- powerpc64-*|powerpc64le-*|powerpc-ibm-aix*|s390x-ibm-linux) ++ powerpc64-*|powerpc64le-*|powerpc-ibm-aix*|s390x-ibm-linux|riscv64-*) + TargetHasRTSLinker=NO + ;; + *) +@@ -10565,7 +10565,10 @@ rm -f core conftest.err conftest.$ac_obj + mipsel) + test -z "$2" || eval "$2=ArchMipsel" + ;; +- hppa|hppa1_1|ia64|m68k|nios2|riscv32|riscv64|rs6000|s390|sh4|vax) ++ riscv64) ++ test -z "$2" || eval "$2=ArchRISCV64" ++ ;; ++ hppa|hppa1_1|ia64|m68k|nios2|riscv32|rs6000|s390|sh4|vax) + test -z "$2" || eval "$2=ArchUnknown" + ;; + *) +Index: ghc-8.10.7/configure.ac +=================================================================== +--- ghc-8.10.7.orig/configure.ac ++++ ghc-8.10.7/configure.ac +@@ -262,7 +262,7 @@ dnl ------------------------------------ + + AC_MSG_CHECKING(whether target supports a registerised ABI) + case "$TargetArch" in +- i386|x86_64|powerpc|powerpc64|powerpc64le|s390x|arm|aarch64) ++ i386|x86_64|powerpc|powerpc64|powerpc64le|s390x|arm|aarch64|riscv64) + UnregisterisedDefault=NO + AC_MSG_RESULT([yes]) + ;; +@@ -297,7 +297,7 @@ AC_MSG_CHECKING(whether target supports + case "$Unregisterised" in + NO) + case "$TargetArch" in +- ia64|powerpc64|powerpc64le|s390x) ++ ia64|powerpc64|powerpc64le|s390x|riscv64) + TablesNextToCodeDefault=NO + AC_MSG_RESULT([no]) + ;; +@@ -326,7 +326,7 @@ AC_SUBST(TablesNextToCode) + dnl ** Does target have runtime linker support? + dnl -------------------------------------------------------------- + case "$target" in +- powerpc64-*|powerpc64le-*|powerpc-ibm-aix*|s390x-ibm-linux) ++ powerpc64-*|powerpc64le-*|powerpc-ibm-aix*|s390x-ibm-linux|riscv64-*) + TargetHasRTSLinker=NO + ;; + *) +Index: ghc-8.10.7/includes/CodeGen.Platform.hs +=================================================================== +--- ghc-8.10.7.orig/includes/CodeGen.Platform.hs ++++ ghc-8.10.7/includes/CodeGen.Platform.hs +@@ -380,6 +380,74 @@ import Reg + # define f14 30 + # define f15 31 + ++#elif defined(MACHREGS_riscv64) ++ ++# define zero 0 ++# define ra 1 ++# define sp 2 ++# define gp 3 ++# define tp 4 ++# define t0 5 ++# define t1 6 ++# define t2 7 ++# define s0 8 ++# define s1 9 ++# define a0 10 ++# define a1 11 ++# define a2 12 ++# define a3 13 ++# define a4 14 ++# define a5 15 ++# define a6 16 ++# define a7 17 ++# define s2 18 ++# define s3 19 ++# define s4 20 ++# define s5 21 ++# define s6 22 ++# define s7 23 ++# define s8 24 ++# define s9 25 ++# define s10 26 ++# define s11 27 ++# define t3 28 ++# define t4 29 ++# define t5 30 ++# define t6 31 ++ ++# define ft0 32 ++# define ft1 33 ++# define ft2 34 ++# define ft3 35 ++# define ft4 36 ++# define ft5 37 ++# define ft6 38 ++# define ft7 39 ++# define fs0 40 ++# define fs1 41 ++# define fa0 42 ++# define fa1 43 ++# define fa2 44 ++# define fa3 45 ++# define fa4 46 ++# define fa5 47 ++# define fa6 48 ++# define fa7 49 ++# define fs2 50 ++# define fs3 51 ++# define fs4 52 ++# define fs5 53 ++# define fs6 54 ++# define fs7 55 ++# define fs8 56 ++# define fs9 57 ++# define fs10 58 ++# define fs11 59 ++# define ft8 60 ++# define ft9 61 ++# define ft10 62 ++# define ft11 63 ++ + #endif + + callerSaves :: GlobalReg -> Bool +@@ -667,7 +735,7 @@ globalRegMaybe :: GlobalReg -> Maybe Rea + #if defined(MACHREGS_i386) || defined(MACHREGS_x86_64) \ + || defined(MACHREGS_sparc) || defined(MACHREGS_powerpc) \ + || defined(MACHREGS_arm) || defined(MACHREGS_aarch64) \ +- || defined(MACHREGS_s390x) ++ || defined(MACHREGS_s390x) || defined(MACHREGS_riscv64) + # if defined(REG_Base) + globalRegMaybe BaseReg = Just (RealRegSingle REG_Base) + # endif +Index: ghc-8.10.7/includes/stg/MachRegs.h +=================================================================== +--- ghc-8.10.7.orig/includes/stg/MachRegs.h ++++ ghc-8.10.7/includes/stg/MachRegs.h +@@ -661,6 +661,68 @@ the stack. See Note [Overlapping global + #define CALLER_SAVES_D5 + #define CALLER_SAVES_D6 + ++/* ----------------------------------------------------------------------------- ++ The riscv64 register mapping ++ ++ Register | Role(s) | Call effect ++ ------------+-----------------------------------------+------------- ++ zero | Hard-wired zero | - ++ ra | Return address | caller-saved ++ sp | Stack pointer | callee-saved ++ gp | Global pointer | callee-saved ++ tp | Thread pointer | callee-saved ++ t0,t1,t2 | - | caller-saved ++ s0 | Frame pointer | callee-saved ++ s1 | - | callee-saved ++ a0,a1 | Arguments / return values | caller-saved ++ a2..a7 | Arguments | caller-saved ++ s2..s11 | - | callee-saved ++ t3..t6 | - | caller-saved ++ ft0..ft7 | - | caller-saved ++ fs0,fs1 | - | callee-saved ++ fa0,fa1 | Arguments / return values | caller-saved ++ fa2..fa7 | Arguments | caller-saved ++ fs2..fs11 | - | callee-saved ++ ft8..ft11 | - | caller-saved ++ ++ Each general purpose register as well as each floating-point ++ register is 64 bits wide. ++ ++ -------------------------------------------------------------------------- */ ++ ++#elif defined(MACHREGS_riscv64) ++ ++#define REG(x) __asm__(#x) ++ ++#define REG_Base s1 ++#define REG_Sp s2 ++#define REG_Hp s3 ++#define REG_R1 s4 ++#define REG_R2 s5 ++#define REG_R3 s6 ++#define REG_R4 s7 ++#define REG_R5 s8 ++#define REG_R6 s9 ++#define REG_R7 s10 ++#define REG_SpLim s11 ++ ++#define REG_F1 fs0 ++#define REG_F2 fs1 ++#define REG_F3 fs2 ++#define REG_F4 fs3 ++#define REG_F5 fs4 ++#define REG_F6 fs5 ++ ++#define REG_D1 fs6 ++#define REG_D2 fs7 ++#define REG_D3 fs8 ++#define REG_D4 fs9 ++#define REG_D5 fs10 ++#define REG_D6 fs11 ++ ++#define MAX_REAL_FLOAT_REG 6 ++#define MAX_REAL_DOUBLE_REG 6 ++ + #else + + #error Cannot find platform to give register info for +Index: ghc-8.10.7/includes/stg/MachRegsForHost.h +=================================================================== +--- ghc-8.10.7.orig/includes/stg/MachRegsForHost.h ++++ ghc-8.10.7/includes/stg/MachRegsForHost.h +@@ -71,6 +71,10 @@ + #define MACHREGS_s390x 1 + #endif + ++#if defined(riscv64_HOST_ARCH) ++#define MACHREGS_riscv64 1 ++#endif ++ + #endif + + #include "MachRegs.h" +Index: ghc-8.10.7/includes/stg/SMP.h +=================================================================== +--- ghc-8.10.7.orig/includes/stg/SMP.h ++++ ghc-8.10.7/includes/stg/SMP.h +@@ -377,6 +377,8 @@ write_barrier(void) { + __asm__ __volatile__ ("" : : : "memory"); + #elif defined(arm_HOST_ARCH) || defined(aarch64_HOST_ARCH) + __asm__ __volatile__ ("dmb st" : : : "memory"); ++#elif defined(riscv64_HOST_ARCH) ++ __asm__ __volatile__ ("fence w,w" : : : "memory"); + #else + #error memory barriers unimplemented on this architecture + #endif +@@ -401,6 +403,8 @@ store_load_barrier(void) { + __asm__ __volatile__ ("dmb" : : : "memory"); + #elif defined(aarch64_HOST_ARCH) + __asm__ __volatile__ ("dmb sy" : : : "memory"); ++#elif defined(riscv64_HOST_ARCH) ++ __asm__ __volatile__ ("fence w,r" : : : "memory"); + #else + #error memory barriers unimplemented on this architecture + #endif +@@ -426,6 +430,8 @@ load_load_barrier(void) { + __asm__ __volatile__ ("dmb" : : : "memory"); + #elif defined(aarch64_HOST_ARCH) + __asm__ __volatile__ ("dmb sy" : : : "memory"); ++#elif defined(riscv64_HOST_ARCH) ++ __asm__ __volatile__ ("fence w,r" : : : "memory"); + #else + #error memory barriers unimplemented on this architecture + #endif +Index: ghc-8.10.7/libraries/ghc-boot/GHC/Platform.hs +=================================================================== +--- ghc-8.10.7.orig/libraries/ghc-boot/GHC/Platform.hs ++++ ghc-8.10.7/libraries/ghc-boot/GHC/Platform.hs +@@ -118,6 +118,7 @@ data Arch + | ArchAlpha + | ArchMipseb + | ArchMipsel ++ | ArchRISCV64 + | ArchJavaScript + deriving (Read, Show, Eq) + +@@ -159,6 +160,7 @@ stringEncodeArch = \case + ArchAlpha -> "alpha" + ArchMipseb -> "mipseb" + ArchMipsel -> "mipsel" ++ ArchRISCV64 -> "riscv64" + ArchJavaScript -> "js" + + isARM :: Arch -> Bool +Index: ghc-8.10.7/llvm-targets +=================================================================== +--- ghc-8.10.7.orig/llvm-targets ++++ ghc-8.10.7/llvm-targets +@@ -34,6 +34,8 @@ + ,("powerpc64le-unknown-linux-musl", ("e-m:e-i64:64-n32:64", "ppc64le", "+secure-plt")) + ,("powerpc64le-unknown-linux", ("e-m:e-i64:64-n32:64", "ppc64le", "")) + ,("s390x-ibm-linux", ("E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-a:8:16-n32:64", "z10", "")) ++,("riscv64-unknown-linux-gnu", ("e-m:e-p:64:64-i64:64-i128:128-n64-S128", "", "+m +a +f +d +c +relax")) ++,("riscv64-unknown-linux", ("e-m:e-p:64:64-i64:64-i128:128-n64-S128", "", "+m +a +f +d +c +relax")) + ,("i386-apple-darwin", ("e-m:o-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:128-n8:16:32-S128", "yonah", "")) + ,("x86_64-apple-darwin", ("e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128", "core2", "")) + ,("arm64-apple-darwin", ("e-m:o-i64:64-i128:128-n32:64-S128", "apple-a7", "+fp-armv8 +neon +crypto +zcm +zcz +sha2 +aes")) +Index: ghc-8.10.7/mk/config.mk.in +=================================================================== +--- ghc-8.10.7.orig/mk/config.mk.in ++++ ghc-8.10.7/mk/config.mk.in +@@ -192,7 +192,7 @@ ifeq "$(TargetArch_CPP)" "arm" + # We don't support load/store barriers pre-ARMv7. See #10433. + ArchSupportsSMP=$(if $(filter $(ARM_ISA),ARMv5 ARMv6),NO,YES) + else +-ArchSupportsSMP=$(strip $(patsubst $(TargetArch_CPP), YES, $(findstring $(TargetArch_CPP), i386 x86_64 sparc powerpc powerpc64 powerpc64le s390x aarch64))) ++ArchSupportsSMP=$(strip $(patsubst $(TargetArch_CPP), YES, $(findstring $(TargetArch_CPP), i386 x86_64 sparc powerpc powerpc64 powerpc64le s390x aarch64 riscv64))) + endif + + # The THREADED_RTS requires `BaseReg` to be in a register and the +Index: ghc-8.10.7/rts/StgCRunAsm.S +=================================================================== +--- ghc-8.10.7.orig/rts/StgCRunAsm.S ++++ ghc-8.10.7/rts/StgCRunAsm.S +@@ -276,6 +276,150 @@ StgReturn: + .size StgReturn, .-StgReturn + + .section .note.GNU-stack,"",@progbits ++ ++#elif defined(riscv64_HOST_ARCH) ++# define STACK_FRAME_SIZE (RESERVED_C_STACK_BYTES+208) ++ .text ++ .align 1 ++ .globl StgRun ++ .type StgRun, @function ++StgRun: ++ .cfi_startproc ++ addi sp,sp,-208 ++ .cfi_def_cfa_offset 208 ++ /* save callee-saved registers */ ++ sd ra,200(sp) ++ sd s0,192(sp) ++ sd s1,184(sp) ++ sd s2,176(sp) ++ sd s3,168(sp) ++ sd s4,160(sp) ++ sd s5,152(sp) ++ sd s6,144(sp) ++ sd s7,136(sp) ++ sd s8,128(sp) ++ sd s9,120(sp) ++ sd s10,112(sp) ++ sd s11,104(sp) ++ fsd fs0,88(sp) ++ fsd fs1,80(sp) ++ fsd fs2,72(sp) ++ fsd fs3,64(sp) ++ fsd fs4,56(sp) ++ fsd fs5,48(sp) ++ fsd fs6,40(sp) ++ fsd fs7,32(sp) ++ fsd fs8,24(sp) ++ fsd fs9,16(sp) ++ fsd fs10,8(sp) ++ fsd fs11,0(sp) ++ /* allocate stack frame */ ++ li t0,RESERVED_C_STACK_BYTES ++ sub sp,sp,t0 ++ .cfi_def_cfa_offset STACK_FRAME_SIZE ++ .cfi_offset 1, -8 ++ .cfi_offset 8, -16 ++ .cfi_offset 9, -24 ++ .cfi_offset 18, -32 ++ .cfi_offset 19, -40 ++ .cfi_offset 20, -48 ++ .cfi_offset 21, -56 ++ .cfi_offset 22, -64 ++ .cfi_offset 23, -72 ++ .cfi_offset 24, -80 ++ .cfi_offset 25, -88 ++ .cfi_offset 26, -96 ++ .cfi_offset 27, -104 ++ .cfi_offset 40, -120 ++ .cfi_offset 41, -128 ++ .cfi_offset 50, -136 ++ .cfi_offset 51, -144 ++ .cfi_offset 52, -152 ++ .cfi_offset 53, -160 ++ .cfi_offset 54, -168 ++ .cfi_offset 55, -176 ++ .cfi_offset 56, -184 ++ .cfi_offset 57, -192 ++ .cfi_offset 58, -200 ++ .cfi_offset 59, -208 ++ /* set STGs BaseReg from RISCV a1 */ ++ mv s1,a1 ++ /* jump to STG function */ ++ jr a0 ++ .cfi_endproc ++ .size StgRun, .-StgRun ++ ++ .text ++ .align 1 ++ .globl StgReturn ++ .type StgReturn, @function ++StgReturn: ++ .cfi_startproc ++ /* set return value from STGs R1 (RISCV s4) */ ++ mv a0,s4 ++ /* deallocate stack frame */ ++ li t0,RESERVED_C_STACK_BYTES ++ add sp,sp,t0 ++ .cfi_def_cfa_offset 208 ++ /* restore callee-saved registers */ ++ ld ra,200(sp) ++ .cfi_restore 1 ++ ld s0,192(sp) ++ .cfi_restore 8 ++ ld s1,184(sp) ++ .cfi_restore 9 ++ ld s2,176(sp) ++ .cfi_restore 18 ++ ld s3,168(sp) ++ .cfi_restore 19 ++ ld s4,160(sp) ++ .cfi_restore 20 ++ ld s5,152(sp) ++ .cfi_restore 21 ++ ld s6,144(sp) ++ .cfi_restore 22 ++ ld s7,136(sp) ++ .cfi_restore 23 ++ ld s8,128(sp) ++ .cfi_restore 24 ++ ld s9,120(sp) ++ .cfi_restore 25 ++ ld s10,112(sp) ++ .cfi_restore 26 ++ ld s11,104(sp) ++ .cfi_restore 27 ++ fld fs0,88(sp) ++ .cfi_restore 40 ++ fld fs1,80(sp) ++ .cfi_restore 41 ++ fld fs2,72(sp) ++ .cfi_restore 50 ++ fld fs3,64(sp) ++ .cfi_restore 51 ++ fld fs4,56(sp) ++ .cfi_restore 52 ++ fld fs5,48(sp) ++ .cfi_restore 53 ++ fld fs6,40(sp) ++ .cfi_restore 54 ++ fld fs7,32(sp) ++ .cfi_restore 55 ++ fld fs8,24(sp) ++ .cfi_restore 56 ++ fld fs9,16(sp) ++ .cfi_restore 57 ++ fld fs10,8(sp) ++ .cfi_restore 58 ++ fld fs11,0(sp) ++ .cfi_restore 59 ++ addi sp,sp,208 ++ .cfi_def_cfa_offset 0 ++ /* jump back to caller of StgRun() */ ++ ret ++ .cfi_endproc ++ .size StgReturn, .-StgReturn ++ ++ .section .note.GNU-stack,"",@progbits + #endif + + #endif /* !USE_MINIINTERPRETER */ +Index: ghc-8.10.7/rts/ghc.mk +=================================================================== +--- ghc-8.10.7.orig/rts/ghc.mk ++++ ghc-8.10.7/rts/ghc.mk +@@ -58,7 +58,7 @@ ifneq "$(findstring $(TargetArch_CPP), i + rts_S_SRCS += rts/AdjustorAsm.S + endif + # this matches substrings of powerpc64le, including "powerpc" and "powerpc64" +-ifneq "$(findstring $(TargetArch_CPP), powerpc64le s390x)" "" ++ifneq "$(findstring $(TargetArch_CPP), powerpc64le s390x riscv64)" "" + # unregisterised builds use the mini interpreter + ifneq "$(GhcUnregisterised)" "YES" + rts_S_SRCS += rts/StgCRunAsm.S +Index: ghc-8.10.7/rts/linker/Elf.c +=================================================================== +--- ghc-8.10.7.orig/rts/linker/Elf.c ++++ ghc-8.10.7/rts/linker/Elf.c +@@ -406,6 +406,12 @@ ocVerifyImage_ELF ( ObjectCode* oc ) + #if defined(EM_AARCH64) + case EM_AARCH64: IF_DEBUG(linker,debugBelch( "aarch64" )); break; + #endif ++#if defined(EM_RISCV) ++ case EM_RISCV: IF_DEBUG(linker,debugBelch( "riscv" )); ++ errorBelch("%s: RTS linker not implemented on riscv", ++ oc->fileName); ++ return 0; ++#endif + default: IF_DEBUG(linker,debugBelch( "unknown" )); + errorBelch("%s: unknown architecture (e_machine == %d)" + , oc->fileName, ehdr->e_machine); +Index: ghc-8.10.7/rts/rts.cabal.in +=================================================================== +--- ghc-8.10.7.orig/rts/rts.cabal.in ++++ ghc-8.10.7/rts/rts.cabal.in +@@ -387,7 +387,7 @@ library + + if arch(i386) || arch(powerpc) || arch(powerpc64) + asm-sources: AdjustorAsm.S +- if arch(powerpc) || arch(powerpc64) || arch(powerpc64le) || arch(s390x) ++ if arch(powerpc) || arch(powerpc64) || arch(powerpc64le) || arch(s390x) || arch(riscv64) + asm-sources: StgCRunAsm.S + + c-sources: Adjustor.c +Index: ghc-8.10.7/utils/genapply/Main.hs +=================================================================== +--- ghc-8.10.7.orig/utils/genapply/Main.hs ++++ ghc-8.10.7/utils/genapply/Main.hs +@@ -17,6 +17,8 @@ module Main(main) where + -- We improperly include *HOST* macros for our target... + #include "../../includes/ghcconfig.h" + ++#undef UnregisterisedCompiler ++ + -- ...so that this header defines the right stuff. It is the RTS's host, but + -- our target, as we are generating code that uses that RTS. + #include "../../includes/stg/MachRegsForHost.h" +Index: ghc-8.10.7/utils/llvm-targets/gen-data-layout.sh +=================================================================== +--- ghc-8.10.7.orig/utils/llvm-targets/gen-data-layout.sh ++++ ghc-8.10.7/utils/llvm-targets/gen-data-layout.sh +@@ -72,6 +72,9 @@ TARGETS=( + "powerpc64le-unknown-linux" + # Linux s390x + "s390x-ibm-linux" ++ # Linux riscv64 ++ "riscv64-unknown-linux-gnu" ++ "riscv64-unknown-linux" + + ######################### + # Darwin From 544b2b100b6e42788d85621093bb2d5158f77a087117fe4e034a043de4e3e569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20S=C3=BAkup?= Date: Thu, 2 Feb 2023 15:42:00 +0000 Subject: [PATCH 2/9] osc copypac from project:openSUSE:Factory package:ghc revision:97 OBS-URL: https://build.opensuse.org/package/show/devel:languages:haskell/ghc?expand=0&rev=375 --- _constraints | 4 +- buildpath-abi-stability.patch | 23 + execstack.patch | 50 -- fix-build-using-unregisterized-v8.4.patch | 58 -- fix-unregisterised-v8.4-8.6.patch | 17 - fix_extlinks.patch | 22 +- ghc-8.0.2-Cabal-dynlibdir.patch | 6 +- ghc-8.10.7-src.tar.xz | 3 + ghc-8.10.7-src.tar.xz.sig | Bin 0 -> 438 bytes ghc-8.6.3-sphinx-1.8.patch | 37 - ghc-9.4.4-src.tar.xz | 3 - ghc-9.4.4-src.tar.xz.sig | Bin 586 -> 0 bytes ghc-Cabal-install-PATH-warning.patch | 14 - ghc-armv7-VFPv3D16--NEON.patch | 11 + ghc-gen_contents_index-haddock-path.patch | 13 - ghc-pie.patch | 10 +- ghc-warnings.mk-CC-Wall.patch | 11 - ghc.changes | 139 +++- ghc.spec | 264 ++++---- libatomic.patch | 24 - riscv-tntc.patch | 74 -- riscv.patch | 778 ---------------------- 22 files changed, 283 insertions(+), 1278 deletions(-) create mode 100644 buildpath-abi-stability.patch delete mode 100644 execstack.patch delete mode 100644 fix-build-using-unregisterized-v8.4.patch delete mode 100644 fix-unregisterised-v8.4-8.6.patch create mode 100644 ghc-8.10.7-src.tar.xz create mode 100644 ghc-8.10.7-src.tar.xz.sig delete mode 100644 ghc-8.6.3-sphinx-1.8.patch delete mode 100644 ghc-9.4.4-src.tar.xz delete mode 100644 ghc-9.4.4-src.tar.xz.sig delete mode 100644 ghc-Cabal-install-PATH-warning.patch create mode 100644 ghc-armv7-VFPv3D16--NEON.patch delete mode 100644 ghc-gen_contents_index-haddock-path.patch delete mode 100644 ghc-warnings.mk-CC-Wall.patch delete mode 100644 libatomic.patch delete mode 100644 riscv-tntc.patch delete mode 100644 riscv.patch diff --git a/_constraints b/_constraints index 09ad4fc..2b5c1aa 100644 --- a/_constraints +++ b/_constraints @@ -1,7 +1,7 @@ - 16 + 12 4 @@ -24,7 +24,7 @@ - 32 + 20 diff --git a/buildpath-abi-stability.patch b/buildpath-abi-stability.patch new file mode 100644 index 0000000..d516980 --- /dev/null +++ b/buildpath-abi-stability.patch @@ -0,0 +1,23 @@ +Index: ghc-8.10.0.20191210/compiler/iface/MkIface.hs +=================================================================== +--- ghc-8.10.0.20191210.orig/compiler/iface/MkIface.hs ++++ ghc-8.10.0.20191210/compiler/iface/MkIface.hs +@@ -679,7 +679,7 @@ addFingerprints hsc_env iface0 + iface_hash <- computeFingerprint putNameLiterally + (mod_hash, + ann_fn (mkVarOcc "module"), -- See mkIfaceAnnCache +- mi_usages iface0, ++ usages, + sorted_deps, + mi_hpc iface0) + +@@ -714,6 +714,9 @@ addFingerprints hsc_env iface0 + (non_orph_rules, orph_rules) = mkOrphMap ifRuleOrph (mi_rules iface0) + (non_orph_fis, orph_fis) = mkOrphMap ifFamInstOrph (mi_fam_insts iface0) + ann_fn = mkIfaceAnnCache (mi_anns iface0) ++ -- Do not allow filenames to affect the interface ++ usages = [ case u of UsageFile _ fp -> UsageFile "" fp; _ -> u | u <- mi_usages iface0 ] ++ + + -- | Retrieve the orphan hashes 'mi_orphan_hash' for a list of modules + -- (in particular, the orphan modules which are transitively imported by the diff --git a/execstack.patch b/execstack.patch deleted file mode 100644 index c3d8f42..0000000 --- a/execstack.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 3739e565f8fa09b3a31ba8f563c518480585f6f9 Mon Sep 17 00:00:00 2001 -From: Andreas Schwab -Date: Sat, 11 Jun 2022 23:29:24 +0200 -Subject: [PATCH] RTS: Add stack marker to StgCRunAsm.S - -Every object file must be properly marked for non-executable stack, even if it -contains no code. ---- - rts/StgCRunAsm.S | 11 +++++------ - 1 file changed, 5 insertions(+), 6 deletions(-) - -diff --git a/rts/StgCRunAsm.S b/rts/StgCRunAsm.S -index aed3241d12..9216e6c759 100644 ---- a/rts/StgCRunAsm.S -+++ b/rts/StgCRunAsm.S -@@ -66,8 +66,6 @@ StgReturn: - addi 12,1,-(8*18) - bl _restgpr1_14 - b _restfpr_14 -- -- .section .note.GNU-stack,"",@progbits - # else // linux_HOST_OS - # error Only Linux support for power64 little endian right now. - # endif -@@ -231,8 +229,6 @@ StgReturn: - .cfi_endproc - .size StgReturn, .-StgReturn - -- .section .note.GNU-stack,"",@progbits -- - #elif defined(riscv64_HOST_ARCH) - # define STACK_FRAME_SIZE (RESERVED_C_STACK_BYTES+208) - .text -@@ -374,8 +370,11 @@ StgReturn: - ret - .cfi_endproc - .size StgReturn, .-StgReturn -- -- .section .note.GNU-stack,"",@progbits - #endif - - #endif /* !USE_MINIINTERPRETER */ -+ -+/* mark stack as nonexecutable */ -+#if defined(__linux__) && defined(__ELF__) -+.section .note.GNU-stack,"",@progbits -+#endif --- -2.37.0 - diff --git a/fix-build-using-unregisterized-v8.4.patch b/fix-build-using-unregisterized-v8.4.patch deleted file mode 100644 index 1cc9604..0000000 --- a/fix-build-using-unregisterized-v8.4.patch +++ /dev/null @@ -1,58 +0,0 @@ -Description: Allow unregisterised ghc-8.4 to build newer GHC - Commit 4075656e8bb introduced a regression stopping existing unregisteristed - compilers from being able to compile newer versions of GHC. The problem is - that the bootstrap compiler uses the newer `rts/storage/ClosureTypes.h` file - where some defines have been renamed, resulting in the following error: -. - error: ‘stg_MUT_ARR_PTRS_FROZEN0_info’ undeclared (first use in this function); did you mean ‘stg_MUT_ARR_PTRS_FROZEN_DIRTY_info’? -. - For more information, see https://gitlab.haskell.org/ghc/ghc/issues/15913. -. - This patch can be removed, once ghc-8.4 is no longer the bootstrap compiler. -Author: Ilias Tsitsimpis -Bug: https://gitlab.haskell.org/ghc/ghc/issues/15913 -Bug-Debian: https://bugs.debian.org/932941 - -Index: b/includes/rts/storage/ClosureTypes.h -=================================================================== ---- a/includes/rts/storage/ClosureTypes.h -+++ b/includes/rts/storage/ClosureTypes.h -@@ -82,5 +82,11 @@ - #define SMALL_MUT_ARR_PTRS_DIRTY 60 - #define SMALL_MUT_ARR_PTRS_FROZEN_DIRTY 61 - #define SMALL_MUT_ARR_PTRS_FROZEN_CLEAN 62 -+#if __GLASGOW_HASKELL__ < 806 -+#define SMALL_MUT_ARR_PTRS_FROZEN0 SMALL_MUT_ARR_PTRS_FROZEN_DIRTY -+#define SMALL_MUT_ARR_PTRS_FROZEN SMALL_MUT_ARR_PTRS_FROZEN_CLEAN -+#define MUT_ARR_PTRS_FROZEN0 MUT_ARR_PTRS_FROZEN_DIRTY -+#define MUT_ARR_PTRS_FROZEN MUT_ARR_PTRS_FROZEN_CLEAN -+#endif - #define COMPACT_NFDATA 63 - #define N_CLOSURE_TYPES 64 -Index: b/includes/stg/MiscClosures.h -=================================================================== ---- a/includes/stg/MiscClosures.h -+++ b/includes/stg/MiscClosures.h -@@ -116,12 +116,22 @@ RTS_ENTRY(stg_ARR_WORDS); - RTS_ENTRY(stg_MUT_ARR_WORDS); - RTS_ENTRY(stg_MUT_ARR_PTRS_CLEAN); - RTS_ENTRY(stg_MUT_ARR_PTRS_DIRTY); -+#if __GLASGOW_HASKELL__ < 806 -+RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN); -+RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN0); -+#else - RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN_CLEAN); - RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN_DIRTY); -+#endif - RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_CLEAN); - RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_DIRTY); -+#if __GLASGOW_HASKELL__ < 806 -+RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_FROZEN); -+RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_FROZEN0); -+#else - RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_FROZEN_CLEAN); - RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_FROZEN_DIRTY); -+#endif - RTS_ENTRY(stg_MUT_VAR_CLEAN); - RTS_ENTRY(stg_MUT_VAR_DIRTY); - RTS_ENTRY(stg_END_TSO_QUEUE); diff --git a/fix-unregisterised-v8.4-8.6.patch b/fix-unregisterised-v8.4-8.6.patch deleted file mode 100644 index 1d81893..0000000 --- a/fix-unregisterised-v8.4-8.6.patch +++ /dev/null @@ -1,17 +0,0 @@ -Index: ghc-8.10.0.20200123/includes/stg/MiscClosures.h -=================================================================== ---- ghc-8.10.0.20200123.orig/includes/stg/MiscClosures.h -+++ ghc-8.10.0.20200123/includes/stg/MiscClosures.h -@@ -401,8 +401,12 @@ RTS_FUN_DECL(stg_copySmallMutableArrayzh - RTS_FUN_DECL(stg_casSmallArrayzh); - - RTS_FUN_DECL(stg_newMutVarzh); -+#if __GLASGOW_HASKELL__ < 808 -+RTS_FUN_DECL(stg_atomicModifyMutVarzh); -+#else - RTS_FUN_DECL(stg_atomicModifyMutVar2zh); - RTS_FUN_DECL(stg_atomicModifyMutVarzuzh); -+#endif - RTS_FUN_DECL(stg_casMutVarzh); - - RTS_FUN_DECL(stg_isEmptyMVarzh); diff --git a/fix_extlinks.patch b/fix_extlinks.patch index 26ea155..dcd5315 100644 --- a/fix_extlinks.patch +++ b/fix_extlinks.patch @@ -1,7 +1,7 @@ -Index: ghc-9.4.4/docs/users_guide/ghc_config.py.in +Index: ghc-8.10.7/docs/users_guide/ghc_config.py.in =================================================================== ---- ghc-9.4.4.orig/docs/users_guide/ghc_config.py.in 2022-12-23 16:19:02.000000000 +0000 -+++ ghc-9.4.4/docs/users_guide/ghc_config.py.in 2023-01-30 21:30:24.105048683 +0000 +--- ghc-8.10.7.orig/docs/users_guide/ghc_config.py.in ++++ ghc-8.10.7/docs/users_guide/ghc_config.py.in @@ -1,6 +1,6 @@ extlinks = { - 'ghc-ticket': ('https://gitlab.haskell.org/ghc/ghc/issues/%s', '#'), @@ -11,21 +11,21 @@ Index: ghc-9.4.4/docs/users_guide/ghc_config.py.in } libs_base_uri = '../libraries' -Index: ghc-9.4.4/libraries/Cabal/doc/conf.py +Index: ghc-8.10.7/libraries/Cabal/Cabal/doc/conf.py =================================================================== ---- ghc-9.4.4.orig/libraries/Cabal/doc/conf.py 2022-12-23 16:19:53.000000000 +0000 -+++ ghc-9.4.4/libraries/Cabal/doc/conf.py 2023-01-30 21:30:53.908929483 +0000 -@@ -28,12 +28,12 @@ master_doc = 'index' +--- ghc-8.10.7.orig/libraries/Cabal/Cabal/doc/conf.py ++++ ghc-8.10.7/libraries/Cabal/Cabal/doc/conf.py +@@ -24,12 +24,12 @@ master_doc = 'index' # extlinks -- see http://www.sphinx-doc.org/en/stable/ext/extlinks.html extlinks = { - 'issue': ('https://github.com/haskell/cabal/issues/%s', '#'), + 'issue': ('https://github.com/haskell/cabal/issues/%s', '#%s'), -- 'ghc-wiki': ('https://gitlab.haskell.org/ghc/ghc/-/wikis/%s', ''), -- 'ghc-ticket': ('https://gitlab.haskell.org/ghc/ghc/-/issues/%s', 'GHC #'), -+ 'ghc-wiki': ('https://gitlab.haskell.org/ghc/ghc/-/wikis/%s', None), -+ 'ghc-ticket': ('https://gitlab.haskell.org/ghc/ghc/-/issues/%s', 'GHC #%s'), +- 'ghc-wiki': ('http://ghc.haskell.org/trac/ghc/wiki/%s', ''), +- 'ghc-ticket': ('http://ghc.haskell.org/trac/ghc/ticket/%s', 'GHC #'), ++ 'ghc-wiki': ('http://ghc.haskell.org/trac/ghc/wiki/%s', None), ++ 'ghc-ticket': ('http://ghc.haskell.org/trac/ghc/ticket/%s', 'GHC #%s'), - 'hackage-pkg': ('http://hackage.haskell.org/package/%s', ''), + 'hackage-pkg': ('http://hackage.haskell.org/package/%s', None), diff --git a/ghc-8.0.2-Cabal-dynlibdir.patch b/ghc-8.0.2-Cabal-dynlibdir.patch index 214241c..ae7cc51 100644 --- a/ghc-8.0.2-Cabal-dynlibdir.patch +++ b/ghc-8.0.2-Cabal-dynlibdir.patch @@ -1,7 +1,7 @@ -Index: ghc-8.10.0.20200123/libraries/Cabal/Cabal/src/Distribution/Simple/InstallDirs.hs +Index: ghc-8.10.0.20200123/libraries/Cabal/Cabal/Distribution/Simple/InstallDirs.hs =================================================================== ---- ghc-8.10.0.20200123.orig/libraries/Cabal/Cabal/src/Distribution/Simple/InstallDirs.hs -+++ ghc-8.10.0.20200123/libraries/Cabal/Cabal/src/Distribution/Simple/InstallDirs.hs +--- ghc-8.10.0.20200123.orig/libraries/Cabal/Cabal/Distribution/Simple/InstallDirs.hs ++++ ghc-8.10.0.20200123/libraries/Cabal/Cabal/Distribution/Simple/InstallDirs.hs @@ -207,7 +207,7 @@ defaultInstallDirs' False comp userInsta _other -> "$abi" "$libname", dynlibdir = "$libdir" case comp of diff --git a/ghc-8.10.7-src.tar.xz b/ghc-8.10.7-src.tar.xz new file mode 100644 index 0000000..0cb8bc8 --- /dev/null +++ b/ghc-8.10.7-src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e3eef6229ce9908dfe1ea41436befb0455fefb1932559e860ad4c606b0d03c9d +size 19932668 diff --git a/ghc-8.10.7-src.tar.xz.sig b/ghc-8.10.7-src.tar.xz.sig new file mode 100644 index 0000000000000000000000000000000000000000000000000000000000000000..b0404f75c5a6d6bf10f3cb6bd0fcf7e6671545af603bef3d9251770e8fa1330e GIT binary patch literal 438 zcmV;n0ZIOe0kZ@E0SEvc79j+PwSUijwL49-zofBPhh+QWEg8fG0%0fLh5!l)5Lky~ z`{FGb#3$Jd0JYt-!0erFO3s^SO2z9=TP_MNmDA|c3V*8Fa3}UD_*QH*4!`Yp_PI^@#(uAwvufhWrKnSqECuJTRsAcG5w zS4V!1`3(3u6@M~K&=ZKvG`)ZABu}Ds078oQ5`31jd2eIFs32N1H{nzgn@deFR4=e( z*0<_elze)3wz`!Qn7gcI!UiEeVfSwI#Z{<-R&ub@D-^C+6!xW1$5-0N4wo`3%9dyc zS6hEBIq7J1C9cc~%t>jicP>WbTk;e+zG9lRwS}= LooseVersion('1.8') else {} - -+ # Yuck: We can't use app.add_object_type since we need to provide the -+ # Directive instance ourselves. -+ std_object_types = app.registry.domain_object_types.setdefault('std', {}) -+ - # Add ghc-flag directive, and override the class with our own -- app.add_object_type('ghc-flag', 'ghc-flag') - app.add_directive_to_domain('std', 'ghc-flag', Flag, **override_arg) -+ app.add_role_to_domain('std', 'ghc-flag', XRefRole()) -+ std_object_types['ghc-flag'] = ObjType('ghc-flag', 'ghc-flag') - - # Add extension directive, and override the class with our own -- app.add_object_type('extension', 'extension') - app.add_directive_to_domain('std', 'extension', LanguageExtension, - **override_arg) -+ app.add_role_to_domain('std', 'extension', XRefRole()) -+ std_object_types['extension'] = ObjType('ghc-flag', 'ghc-flag') -+ - # NB: language-extension would be misinterpreted by sphinx, and produce - # lang="extensions" XML attributes - diff --git a/ghc-9.4.4-src.tar.xz b/ghc-9.4.4-src.tar.xz deleted file mode 100644 index 539165d..0000000 --- a/ghc-9.4.4-src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e8cef25a6ded1531cda7a90488d0cfb6d780657d16636daa59430be030cd67e2 -size 28564104 diff --git a/ghc-9.4.4-src.tar.xz.sig b/ghc-9.4.4-src.tar.xz.sig deleted file mode 100644 index 9513a3c7f5903f92a6c1b716c54391966a17d4235de7f10d24dcd6ecfc023348..0000000000000000000000000000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 586 zcmV-Q0=4~#0!IV@0SEvw79j-x>wM@Q7NcuEE$weD;7v}K+hnZ;0%NBpSrZ&$Wo|%s zWo&FMba`-PWG-WGZ2$@h5G~+MPM6zctye1$0Ht1tq8czEJCo&Uu?c>Md+pPsfoZT2 ztQ)iq60HqRrYXJvnqP6`ztAyN$B0Zd-F7u+`}4>Jo#+)Z(|>zQS=8OO7dH|_ka}>B zzNMa<^Ns%4{Np_)p=|d-+3xL7!<>fDHvdSX9TuNUl_loa3w@dM!b{HT&6Ee{CSh=< zz;=(?6^sodC;|m#=by+T+)k+dJrkLWU9Kvt!IDHBGbp|m; z`g({6a9G2QvI4$ZzY@v<8?--1aURPb_t7%iA3n@ug??S3omB+#iV@B=RX{%M=JNs)0gOQnO7|)iccvoX&U2Z|^E(-zV2%?L(TsC1hUrjgHfu6z!G^W4tlp4Kaird}{zRl41znm#304T(0Ogbx= z5I(qZDCX0!TyaqRO6)^CLKz)8CQ|RY2U~zWOfCS GHC.installExe verbosity lbi binPref buildPref progFix pkg_descr exe - GHCJS -> GHCJS.installExe verbosity lbi binPref buildPref progFix pkg_descr exe diff --git a/ghc-armv7-VFPv3D16--NEON.patch b/ghc-armv7-VFPv3D16--NEON.patch new file mode 100644 index 0000000..bc1255b --- /dev/null +++ b/ghc-armv7-VFPv3D16--NEON.patch @@ -0,0 +1,11 @@ +--- ghc-8.10.7/aclocal.m4 ++++ ghc-8.10.7/aclocal.m4 +@@ -408,7 +408,7 @@ + )], + [changequote(, )dnl + ARM_ISA=ARMv7 +- ARM_ISA_EXT="[VFPv3,NEON]" ++ ARM_ISA_EXT="[VFPv3D16]" + changequote([, ])dnl + ]) + ]) diff --git a/ghc-gen_contents_index-haddock-path.patch b/ghc-gen_contents_index-haddock-path.patch deleted file mode 100644 index f940fcc..0000000 --- a/ghc-gen_contents_index-haddock-path.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: ghc-9.2.0.20210331/libraries/gen_contents_index -=================================================================== ---- ghc-9.2.0.20210331.orig/libraries/gen_contents_index -+++ ghc-9.2.0.20210331/libraries/gen_contents_index -@@ -47,7 +47,7 @@ then - HADDOCK_ARGS="$HADDOCK_ARGS $HADDOCK_ARG" - done - else -- HADDOCK=../../../../../bin/haddock -+ HADDOCK=/usr/bin/haddock - # We don't want the GHC API to swamp the index - HADDOCK_FILES=`ls -1 */*.haddock | grep -v '/ghc\.haddock' | sort` - HADDOCK_ARGS="-p prologue.txt" diff --git a/ghc-pie.patch b/ghc-pie.patch index 5b4e4b3..e9ca4ae 100644 --- a/ghc-pie.patch +++ b/ghc-pie.patch @@ -1,11 +1,11 @@ -Index: ghc-9.2.3/compiler/GHC/Driver/Session.hs +Index: ghc-8.10.7/compiler/main/DynFlags.hs =================================================================== ---- ghc-9.2.3.orig/compiler/GHC/Driver/Session.hs -+++ ghc-9.2.3/compiler/GHC/Driver/Session.hs -@@ -3756,6 +3756,7 @@ default_PIC platform = - -- This requires PIC on AArch64, and ExternalDynamicRefs on Linux as on top +--- ghc-8.10.7.orig/compiler/main/DynFlags.hs ++++ ghc-8.10.7/compiler/main/DynFlags.hs +@@ -4659,6 +4659,7 @@ default_PIC platform = -- of that. Subsequently we expect all code on aarch64/linux (and macOS) to -- be built with -fPIC. + -- See #15275, #18892 + (OSLinux, ArchX86_64) -> [Opt_PIC] (OSDarwin, ArchAArch64) -> [Opt_PIC] (OSLinux, ArchAArch64) -> [Opt_PIC, Opt_ExternalDynamicRefs] diff --git a/ghc-warnings.mk-CC-Wall.patch b/ghc-warnings.mk-CC-Wall.patch deleted file mode 100644 index b4eece7..0000000 --- a/ghc-warnings.mk-CC-Wall.patch +++ /dev/null @@ -1,11 +0,0 @@ -Index: ghc-9.2.3/mk/warnings.mk -=================================================================== ---- ghc-9.2.3.orig/mk/warnings.mk -+++ ghc-9.2.3/mk/warnings.mk -@@ -1,5 +1,5 @@ - # See Note [Order of warning flags]. --SRC_CC_OPTS += -Wall $(WERROR) -+#SRC_CC_OPTS += -Wall $(WERROR) - SRC_HC_OPTS += -Wall - # Don't add -Werror to SRC_HC_OPTS_STAGE0 (or SRC_HC_OPTS), because otherwise - # validate may unnecessarily fail when booting with an older compiler. diff --git a/ghc.changes b/ghc.changes index f71922c..d77b3a8 100644 --- a/ghc.changes +++ b/ghc.changes @@ -1,37 +1,122 @@ ------------------------------------------------------------------- -Tue Jan 31 09:37:15 UTC 2023 - Peter Simons +Thu Jan 19 12:39:27 UTC 2023 - Guillaume GARDET -- Update to GHC version 9.4.4. - - * %{buildroot}%{ghclibdir}/include is apparently no longer used by - the RTS package. Those files now live in /usr/lib64/ghc-9.4.4/rts/include. - - * find %{buildroot}%{ghc_html_libraries_dir} -name LICENSE -exec rm '{}' ';' - no longer works because the directory doesn't exist at the time - that command is run. - - * The user manual and Haddock documentation is installed into a - different location. For now, we just list the catchall - %{_docdir}/packages/ghc to accept anything. - - * The LICENSE file for Cabal-syntax lives at libraries/Cabal/Cabal-syntax - instead of the expected place libraries/Cabal-syntax. - - * The package system-cxx-std-lib has no LICENSE file. It's not - even a proper package, it's just a configuration file that lists - some compiler and linker flags. To work around the build error - that causes, we just copy some random LICENSE file into the - place where our build would expect it. +- Do not require unversionned llvm since ghc needs a specific + llvm version. [boo#1207265] ------------------------------------------------------------------- -Fri Jul 8 11:48:57 UTC 2022 - Andreas Schwab +Tue Jan 17 11:45:32 UTC 2023 - Peter Simons -- execstack.patch: add missing stack note +- Apply "fix_extlinks.patch" to work around a bug in Sphinx 6.1.x + that broke our documentation build. Remove this patch once Sphinx + is fixed. This patch is a variant of the ghc-9.4.4 patch from + https://gitlab.haskell.org/ghc/ghc/-/issues/22766. Upstream's + https://github.com/sphinx-doc/sphinx/issues/11094 has further + details. [boo#1207214] ------------------------------------------------------------------- -Wed Feb 9 13:50:45 UTC 2022 - Peter Simons +Mon Jun 27 17:04:51 UTC 2022 - Dirk Müller -- add environ.patch to fix build errors with recent gcc +- add ghc.keyring to have source validation enabled +- limit to use llvm12 for Factory as newer versions are not supported + +------------------------------------------------------------------- +Fri Apr 29 13:49:29 UTC 2022 - Martin Liška + +- Remove dependency on binutils-gold as the package will be removed + in the future. Gold linker is unmaintained by the upstream project. + +------------------------------------------------------------------- +Tue Mar 8 22:35:07 UTC 2022 - Dirk Müller + +- add ghc-armv7-VFPv3D16--NEON.patch to use vfpv3-d16 on armv7hl + +------------------------------------------------------------------- +Fri Sep 3 20:57:29 UTC 2021 - Ondřej Súkup + +- update to 8.10.7 +- drop 4134.patch and refresh ghc-pie.patch + * portabilit yfixes + * Export some RTS symbols required for static builds of GHC + * Fix LLVM version checking logic so it no longer complains + about supported LLVM versions. + * Fix some RTS crashes on Darwin due to mixing up the closure + sizes of the aarch64 and x86-64 backends. + * Fix a crash on the non-moving GC due to incorrect logic + for calculating the header size for array write barries + * Fix a bug in base leading to a high likelihood of space + leaks when using lazy bytestrings + * Fix some timer races in the RTS possibly manifesting in #18033 and #20132 + * Fix a number of bugs affecting the RTS m32 allocator + * Fix a bug where code may be unloaded prematurely + when using the parallel garbage collector + * Fix a bug where the linker may during shutdown unload code before + libraries’ atexit handlers have a chance to run + * Improve code layout by distiguishing conditional and unconditional branches + * Add hs-boot file support for -ddump-minimal-imports + * Ensure hs-boot files are built before source files in GHCs -M mode + * Fix a long standing GHC API bug affecting clients like HLS where + async exceptions used to cancel threads during typechecking would be + caught by the Template Haskell evaluator and reported as compile errors + * Improve error messages when looking up packages fails + * Fix a number of quirks in GC accounting + * Fix a code generation bug which could result in entry of unlifted + objects in some programs using unboxed sums + * Ensure that POSIX signals are not delivered to the ticker thread + when using the pthread itimer implementation. + * Fix a specialiser bug which could result in the construction + of recursive dictionaries in some programs + * Bump containers to 0.6.4.1 + * Do not treat -Winferred-safe-imports warnings as errors. + * Fix a bug where typechecker plugins could be run with + an inconsistent typechecker environment + * Fix a simplifier bug which lead to an exponential + blow up and excessive memory usage in certain cases + +------------------------------------------------------------------- +Fri Jun 25 10:02:25 UTC 2021 - Ondřej Súkup + +- add 4134.patch to fix build with Sphinx4 + +------------------------------------------------------------------- +Mon Mar 15 20:33:24 UTC 2021 - Dirk Müller + +- always build against llvm9, also on SLE15 (suse_version == 1500) + otherwise the resulting build is not working (llvm is 7.x there) (bsc#1181571) + +------------------------------------------------------------------- +Tue Feb 9 01:29:46 UTC 2021 - Ondřej Súkup + +- update to 8.10.4 + * Fix a crash caused by inappropriate garbage of heap-allocated data + reachable from foreign exports + +------------------------------------------------------------------- +Sun Dec 20 00:29:27 UTC 2020 - Ondřej Súkup + +- update to 8.10.3 + * More robust support for architectures with weak memory ordering + guarantees (e.g. modern ARM hardware). + * GHC can now split dynamic objects to accomodate macOS' RPATH size + limitation when building large projects (#14444) + * Several correctness bugs in the new low-latency garbage collector + * Many, many other bug-fixes)) + +------------------------------------------------------------------- +Thu Dec 17 12:20:00 UTC 2020 - Ondřej Súkup + +- disable %{ix86} build + +------------------------------------------------------------------- +Wed Oct 14 12:20:00 UTC 2020 - Ondřej Súkup + +- force multiversion for subpackages + +------------------------------------------------------------------- +Sat Oct 3 15:58:52 UTC 2020 - Ondřej Súkup + +- add --enable-unregistered to configure phase on unregistered + architectures ------------------------------------------------------------------- Sun Aug 9 11:27:32 UTC 2020 - Ondřej Súkup @@ -53,7 +138,7 @@ Sun May 31 18:47:18 UTC 2020 - Ondřej Súkup - cleanup specfile from Leap 42 and older remrants - drop fix-unregisterised-v8.4-8.6.patch -- drop fix-build-using-unregisterized-v8.4.patch +- drop fix-build-using-unregisterized-v8.4.patch ------------------------------------------------------------------- Thu May 7 07:44:47 UTC 2020 - Peter Simons diff --git a/ghc.spec b/ghc.spec index 01f25a1..e5404b1 100644 --- a/ghc.spec +++ b/ghc.spec @@ -1,7 +1,7 @@ # # spec file for package ghc # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,9 +16,6 @@ # -%define full_version 9.4.4 -%define short_version 9.4.4 - %ifnarch %{arm} s390x %define with_libnuma 1 %else @@ -32,43 +29,23 @@ %else %global llvm_major 9 %endif +%define full_version 8.10.7 Name: ghc -Version: %{short_version} +Version: 8.10.7 Release: 0 -Summary: The Glorious Glasgow Haskell Compiler -License: BSD-3-Clause URL: https://www.haskell.org/ghc/ Source: https://downloads.haskell.org/~ghc/%{full_version}/ghc-%{version}-src.tar.xz Source1: https://downloads.haskell.org/~ghc/%{full_version}/ghc-%{version}-src.tar.xz.sig Source2: ghc-rpmlintrc Source9: ghc.keyring -Patch1: ghc-gen_contents_index-haddock-path.patch -# for unregisterized (s390x) -# https://ghc.haskell.org/trac/ghc/ticket/15689 -Patch2: ghc-Cabal-install-PATH-warning.patch -# PATCH-FIX-UPSTREAM Disable-unboxed-arrays.patch ptrommler@icloud.com -- Do not use unboxed arrays on big-endian platforms. See Haskell Trac #15411. -Patch3: Disable-unboxed-arrays.patch -# https://phabricator.haskell.org/rGHC4eebc8016f68719e1ccdf460754a97d1f4d6ef05 -Patch6: ghc-8.6.3-sphinx-1.8.patch -# PATCH-FIX-UPSTREAM execstack.patch -- RTS: Add stack marker to StgCRunAsm.S -Patch7: execstack.patch -# Work around a bug in Sphinx 6.1.x to fix the documentation build. Remove this patch ASAP. -Patch8: fix_extlinks.patch -# unregisterized -# PATCH-FIX-UPSTREAM ghc-pie.patch - set linux as default PIE platform -Patch35: ghc-pie.patch -# PATCH-FIX-OPENSUSE ghc-8.0.2-Cabal-dynlibdir.patch -- Fix shared library directory location. -Patch100: ghc-8.0.2-Cabal-dynlibdir.patch - -Patch120: libatomic.patch -Patch130: riscv-tntc.patch - - +Summary: The Glorious Glasgow Haskell Compiler +License: BSD-3-Clause +Group: Development/Languages/Other +ExclusiveArch: aarch64 %{arm} x86_64 ppc64 ppc64le riscv64 s390x BuildRequires: binutils-devel -BuildRequires: gcc-PIE -BuildRequires: ghc-bootstrap >= 8.10.7 -BuildRequires: ghc-bootstrap-helpers >= 1.3 +BuildRequires: gcc +BuildRequires: ghc-bootstrap >= 8.6 BuildRequires: ghc-rpm-macros-extra BuildRequires: glibc-devel BuildRequires: gmp-devel @@ -79,25 +56,37 @@ BuildRequires: libtool BuildRequires: memory-constraints BuildRequires: ncurses-devel BuildRequires: pkg-config -BuildRequires: python3 BuildRequires: xz -Requires: ghc-compiler = %{version}-%{release} -Requires: ghc-ghc-devel = %{version}-%{release} -Requires: ghc-devel = %{version}-%{release} -# FIXME: use proper Requires(pre/post/preun/...) -PreReq: update-alternatives -ExclusiveArch: aarch64 x86_64 ppc64 ppc64le riscv64 s390x -# %ifarch riscv64 s390x +%ifarch aarch64 %{arm} +BuildRequires: clang%{llvm_major} BuildRequires: llvm%{llvm_major} BuildRequires: llvm%{llvm_major}-devel -BuildRequires: clang%{llvm_major} -# %endif +%endif %if %{undefined without_manual} BuildRequires: python3-Sphinx %endif -%if %{with_libnuma} +%if %with_libnuma BuildRequires: libnuma-devel %endif +BuildRequires: ghc-bootstrap-helpers + +PreReq: update-alternatives + +Requires: ghc-compiler = %{version}-%{release} +Requires: ghc-ghc-devel = %{version}-%{release} +Requires: ghc-libraries = %{version}-%{release} +# Work around a bug in Sphinx 6.1.x to fix the documentation build. Remove this patch ASAP. +Patch1: fix_extlinks.patch +# PATCH-FIX-OPENSUSE: use vfpv3-d16 and disable NEON +Patch2: ghc-armv7-VFPv3D16--NEON.patch +# PATCH-FIX-UPSTREAM Disable-unboxed-arrays.patch ptrommler@icloud.com -- Do not use unboxed arrays on big-endian platforms. See Haskell Trac #15411. +Patch3: Disable-unboxed-arrays.patch +# PATCH-FIX-UPSTREAM ghc-pie.patch - set linux as default PIE platform +Patch35: ghc-pie.patch +# PATCH-FIX-OPENSUSE ghc-8.0.2-Cabal-dynlibdir.patch -- Fix shared library directory location. +Patch100: ghc-8.0.2-Cabal-dynlibdir.patch +# PATCH-FIX-UPSTREAM buildpath-abi-stability.patch -- debian patch for more stable abi-1 +Patch110: buildpath-abi-stability.patch %description Haskell is the standard purely functional programming language; the @@ -118,13 +107,20 @@ Haskell home page at . %package compiler Summary: GHC compiler and utilities +Group: Development/Languages/Other Requires: gcc Requires: ghc-base-devel Requires(post): update-alternatives -Requires(postun): update-alternatives -%ifarch riscv64 s390x +Requires(postun):update-alternatives +%ifarch aarch64 %{arm} +Requires: binutils-gold +%endif +%ifarch aarch64 %{arm} Requires: clang%{llvm_major} Requires: llvm%{llvm_major} +%else +Suggests: clang%{llvm_major} +Suggests: llvm%{llvm_major} %endif %description compiler @@ -134,9 +130,10 @@ The GHC libraries are provided by ghc-devel. To install all of GHC install package ghc. %global ghc_version_override %{version} + %global ghc_pkg_c_deps ghc-compiler = %{ghc_version_override}-%{release} -%if %{with_libnuma} +%if %with_libnuma %define libnuma_dep ,libnuma-devel %else %define libnuma_dep %{nil} @@ -144,55 +141,52 @@ To install all of GHC install package ghc. %if %{defined ghclibdir} #!ForceMultiversion -%ghc_lib_subpackage -d Cabal-3.8.1.0 -%ghc_lib_subpackage -d Cabal-syntax-3.8.1.0 +%ghc_lib_subpackage -d Cabal-3.2.1.0 %ghc_lib_subpackage -d array-0.5.4.0 -%ghc_lib_subpackage -d -c gmp-devel,libffi-devel,libdw-devel,libelf-devel%{libnuma_dep} base-4.17.0.0 -%ghc_lib_subpackage -d binary-0.8.9.1 -%ghc_lib_subpackage -d bytestring-0.11.3.1 -%ghc_lib_subpackage -d containers-0.6.6 -%ghc_lib_subpackage -d deepseq-1.4.8.0 -%ghc_lib_subpackage -d directory-1.3.7.1 -%ghc_lib_subpackage -d exceptions-0.10.5 -%ghc_lib_subpackage -d filepath-1.4.2.2 +%ghc_lib_subpackage -d -c gmp-devel,libffi-devel,libdw-devel,libelf-devel%{libnuma_dep} base-4.14.3.0 +%ghc_lib_subpackage -d binary-0.8.8.0 +%ghc_lib_subpackage -d bytestring-0.10.12.0 +%ghc_lib_subpackage -d containers-0.6.5.1 +%ghc_lib_subpackage -d deepseq-1.4.4.0 +%ghc_lib_subpackage -d directory-1.3.6.0 +%ghc_lib_subpackage -d exceptions-0.10.4 +%ghc_lib_subpackage -d filepath-1.4.2.1 %ghc_lib_subpackage -d -x ghc-%{ghc_version_override} -%ghc_lib_subpackage -d -x ghc-boot-%{ghc_version_override} +%ghc_lib_subpackage -d ghc-boot-%{ghc_version_override} %ghc_lib_subpackage -d ghc-boot-th-%{ghc_version_override} -%ghc_lib_subpackage -d ghc-bignum-1.3 -%ghc_lib_subpackage -d -x ghc-compact-0.1.0.0 -%ghc_lib_subpackage -d -x ghc-heap-%{ghc_version_override} +%ghc_lib_subpackage -d ghc-compact-0.1.0.0 +%ghc_lib_subpackage -d ghc-heap-%{ghc_version_override} %ghc_lib_subpackage -d -x ghci-%{ghc_version_override} %ghc_lib_subpackage -d haskeline-0.8.2 -%ghc_lib_subpackage -d -x hpc-0.6.1.0 -%ghc_lib_subpackage -d -x libiserv-%{ghc_version_override} +%ghc_lib_subpackage -d hpc-0.6.1.0 +%ghc_lib_subpackage -d libiserv-%{ghc_version_override} %ghc_lib_subpackage -d mtl-2.2.2 -%ghc_lib_subpackage -d parsec-3.1.15.0 +%ghc_lib_subpackage -d parsec-3.1.14.0 %ghc_lib_subpackage -d pretty-1.1.3.6 -%ghc_lib_subpackage -d process-1.6.16.0 -%ghc_lib_subpackage -d stm-2.5.1.0 -%ghc_lib_subpackage -d -c libstdc++-devel system-cxx-std-lib-1.0 -%ghc_lib_subpackage -d template-haskell-2.19.0.0 -%ghc_lib_subpackage -d -c ncurses-devel terminfo-0.4.1.5 -%ghc_lib_subpackage -d text-2.0.1 -%ghc_lib_subpackage -d time-1.12.2 +%ghc_lib_subpackage -d process-1.6.13.2 +%ghc_lib_subpackage -d stm-2.5.0.1 +%ghc_lib_subpackage -d template-haskell-2.16.0.0 +%ghc_lib_subpackage -d -c ncurses-devel terminfo-0.4.1.4 +%ghc_lib_subpackage -d text-1.2.4.1 +%ghc_lib_subpackage -d time-1.9.3 %ghc_lib_subpackage -d transformers-0.5.6.2 -%ghc_lib_subpackage -d unix-2.7.3 +%ghc_lib_subpackage -d unix-2.7.2.2 %ghc_lib_subpackage -d xhtml-3000.2.2.1 %endif - %global version %{ghc_version_override} -%package devel -%{?ghc_packages_list:Requires: %(echo %{ghc_packages_list} | sed -e "s/\([^ ]*\)-\([^ ]*\)/ghc-\1-devel = \2-%{release},/g")} +%package libraries Summary: GHC development libraries meta package +Group: Development/Libraries/Other Requires: ghc-compiler = %{version}-%{release} -Obsoletes: ghc-libraries < %{version}-%{release} -Provides: ghc-libraries = %{version}-%{release} +Obsoletes: ghc-devel < %{version}-%{release} +Provides: ghc-devel = %{version}-%{release} Obsoletes: ghc-prof < %{version}-%{release} Provides: ghc-prof = %{version}-%{release} +%{?ghc_packages_list:Requires: %(echo %{ghc_packages_list} | sed -e "s/\([^ ]*\)-\([^ ]*\)/ghc-\1-devel = \2-%{release},/g")} -%description devel +%description libraries This is a meta-package for all the development library packages in GHC except the ghc library, which is installed by the toplevel ghc metapackage. @@ -200,20 +194,16 @@ except the ghc library, which is installed by the toplevel ghc metapackage. %setup -q %patch1 -p1 %patch2 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 %ifarch ppc64 s390 s390x %patch3 -p1 %endif %patch35 -p1 %patch100 -p1 -%patch120 -p1 -# %patch130 -p1 +%patch110 -p1 %build -cat > mk/build.mk << EOF -%ifarch s390x riscv64 +cat > mk/build.mk <= 1500 -%ifarch %{unregisterised_archs} riscv64 +%ifarch %{unregisterised_archs} %if 0%{?qemu_user_space_build} %limit_build -m 15000 %else @@ -290,45 +264,35 @@ sed -i -e 's/MinBootGhcVersion="9.0"/MinBootGhcVersion="8.10"/' configure %else %limit_build -m 2000 %endif -%make_build +make %{?_smp_mflags} %else -%make_build -j 2 +make -j 2 %endif - %install -%make_install -cp -p libraries/containers/containers/LICENSE libraries/containers/LICENSE -install -D -m 644 libraries/Cabal/Cabal-syntax/LICENSE libraries/Cabal-syntax/LICENSE -install -D -m 644 libraries/Cabal/Cabal-syntax/LICENSE libraries/system-cxx-std-lib/LICENSE - +%makeinstall for i in %{ghc_packages_list}; do name=$(echo $i | sed -e "s/\(.*\)-.*/\1/") ver=$(echo $i | sed -e "s/.*-\(.*\)/\1/") %ghc_gen_filelists $name $ver -echo "%%doc libraries/$name/LICENSE" >> ghc-$name.files +# TODO: containers have license in $name/$name +#echo "%%doc libraries/$name/LICENSE" >> ghc-$name.files done # ghc-base should own ghclibdir echo "%dir %{ghclibdir}" >> ghc-base.files - %ghc_gen_filelists ghc %{ghc_version_override} -%ghc_gen_filelists ghc-boot %{ghc_version_override} -%ghc_gen_filelists ghc-compact 0.1.0.0 -%ghc_gen_filelists ghc-heap %{ghc_version_override} %ghc_gen_filelists ghci %{ghc_version_override} -%ghc_gen_filelists hpc 0.6.1.0 -%ghc_gen_filelists libiserv %{ghc_version_override} -%ghc_gen_filelists ghc-prim 0.9.0 -%ghc_gen_filelists integer-gmp 1.1 +%ghc_gen_filelists ghc-prim 0.6.1 +%ghc_gen_filelists integer-gmp 1.0.3.0 %define merge_filelist()\ -cat ghc-%{1}.files >> ghc-%{2}.files\ -cat ghc-%{1}-devel.files >> ghc-%{2}-devel.files\ -cp -p libraries/%{1}/LICENSE libraries/LICENSE.%{1}\ -echo "%doc libraries/LICENSE.%{1}" >> ghc-%{2}.files +cat ghc-%1.files >> ghc-%2.files\ +cat ghc-%1-devel.files >> ghc-%2-devel.files\ +cp -p libraries/%1/LICENSE libraries/LICENSE.%1\ +echo "%doc libraries/LICENSE.%1" >> ghc-%2.files %merge_filelist integer-gmp base %merge_filelist ghc-prim base @@ -339,7 +303,7 @@ ls %{buildroot}%{ghclibdir}/rts/libHS*.so >> ghc-base.files sed -i -e "s|^%{buildroot}||g" ghc-base.files %endif echo %%dir %{ghclibdir}/rts >> ghc-base-devel.files -ls -d %{buildroot}%{ghclibdir}/rts/libHS*.a %{buildroot}%{ghclibdir}/package.conf.d/rts.conf >> ghc-base-devel.files +ls -d %{buildroot}%{ghclibdir}/rts/libHS*.a %{buildroot}%{ghclibdir}/package.conf.d/rts.conf %{buildroot}%{ghclibdir}/include >> ghc-base-devel.files sed -i -e "s|^%{buildroot}||g" ghc-base-devel.files # these are handled as alternatives @@ -354,9 +318,7 @@ for i in hsc2hs runhaskell; do touch %{buildroot}%{_sysconfdir}/alternatives/$i done -# Fails with find: '/home/abuild/rpmbuild/BUILDROOT/ghc-9.4.4-0.x86_64/usr/share/doc/ghc-9.4.4/html/libraries': No such file or directory -# find %{buildroot}%{ghc_html_libraries_dir} -name LICENSE -exec rm '{}' ';' -mkdir -p %{buildroot}%{ghc_html_libraries_dir} +find %{buildroot}%{ghclibdocdir} -name LICENSE -exec rm '{}' ';' %check # Actually, I took this from Jens Petersen's Fedora package @@ -425,8 +387,6 @@ fi %{_bindir}/runhaskell-ghc %dir %{ghclibdir} %{ghclibdir}/settings -%{ghclibdir}/llvm-passes -%{ghclibdir}/llvm-targets %dir %{ghclibdir}/bin %{ghclibdir}/bin/ghc %{ghclibdir}/bin/ghc-pkg @@ -441,11 +401,13 @@ fi %dir %{ghclibdir}/package.conf.d %ghost %{ghclibdir}/package.conf.d/package.cache %ghost %{ghclibdir}/package.conf.d/package.cache.lock -#%%{ghclibdir}/platformConstants +%{ghclibdir}/platformConstants %{ghclibdir}/bin/runghc %{ghclibdir}/template-hsc.h %{ghclibdir}/bin/unlit -%dir %{_docdir}/ghc +%dir %{_datadir}/doc/ghc-%{version} +%dir %{ghcdocbasedir} +%dir %{ghcdocbasedir}/libraries %if %{undefined without_manual} %{_mandir}/man1/ghc.* %endif @@ -454,27 +416,27 @@ fi %{_bindir}/haddock-ghc-%{version} %{ghclibdir}/html %{ghclibdir}/latex +%{ghclibdir}/llvm-passes +%{ghclibdir}/llvm-targets %{ghclibdir}/bin/haddock -%ghost %{ghc_html_dir}/libraries/doc-index*.html -%ghost %{ghc_html_dir}/libraries/haddock-bundle.min.js -%ghost %{ghc_html_dir}/libraries/haddock-util.js -%ghost %{ghc_html_dir}/libraries/index*.html -%ghost %{ghc_html_dir}/libraries/minus.gif -%ghost %{ghc_html_dir}/libraries/plus.gif +%if %{undefined without_manual} +%{ghcdocbasedir}/haddock +%{ghcdocbasedir}/users_guide +%endif +%{ghcdocbasedir}/libraries/gen_contents_index +%{ghcdocbasedir}/libraries/*.css +%{ghcdocbasedir}/libraries/prologue.txt +%{ghcdocbasedir}/libraries/synopsis.png +%{ghcdocbasedir}/index.html +%ghost %{ghcdocbasedir}/libraries/doc-index*.html +%ghost %{ghcdocbasedir}/libraries/haddock-bundle.min.js +%ghost %{ghcdocbasedir}/libraries/haddock-util.js +%ghost %{ghcdocbasedir}/libraries/index*.html +%ghost %{ghcdocbasedir}/libraries/minus.gif +%ghost %{ghcdocbasedir}/libraries/plus.gif %endif -# ghc-compiler-9.4.4-0.x86_64.rpm: directories not owned by a package: -%dir /usr/share/doc/ghc-9.4.4 -%dir /usr/share/doc/ghc-9.4.4/html -%dir /usr/share/doc/ghc-9.4.4/html/libraries - -# Just accept all documentation. -/usr/share/doc/packages/ghc - -# The RTS include files have moved. -/usr/lib64/ghc-%{short_version}/rts/include - -%files devel +%files libraries %license LICENSE %changelog diff --git a/libatomic.patch b/libatomic.patch deleted file mode 100644 index ca5d2fc..0000000 --- a/libatomic.patch +++ /dev/null @@ -1,24 +0,0 @@ -Index: ghc-9.2.3/rts/package.conf.in -=================================================================== ---- ghc-9.2.3.orig/rts/package.conf.in -+++ ghc-9.2.3/rts/package.conf.in -@@ -66,6 +66,7 @@ extra-libraries: - #if NEED_ATOMIC_LIB - , "atomic" - #endif -+ , "atomic" - - #if defined(INSTALLING) - include-dirs: INCLUDE_DIR FFI_INCLUDE_DIR -Index: ghc-9.2.3/rts/rts.cabal.in -=================================================================== ---- ghc-9.2.3.orig/rts/rts.cabal.in -+++ ghc-9.2.3/rts/rts.cabal.in -@@ -144,6 +144,7 @@ library - extra-libraries: elf dw - if flag(libnuma) - extra-libraries: numa -+ extra-libraries: atomic - if !flag(smp) - cpp-options: -DNOSMP - diff --git a/riscv-tntc.patch b/riscv-tntc.patch deleted file mode 100644 index 70c7bb8..0000000 --- a/riscv-tntc.patch +++ /dev/null @@ -1,74 +0,0 @@ -Index: ghc-9.2.1/compiler/GHC/CmmToLlvm/Mangler.hs -=================================================================== ---- ghc-9.2.1.orig/compiler/GHC/CmmToLlvm/Mangler.hs -+++ ghc-9.2.1/compiler/GHC/CmmToLlvm/Mangler.hs -@@ -43,7 +43,7 @@ llvmFixupAsm logger dflags f1 f2 = {-# S - - -- | These are the rewrites that the mangler will perform - rewrites :: [Rewrite] --rewrites = [rewriteSymType, rewriteAVX] -+rewrites = [rewriteSymType, rewriteAVX, rewriteCall] - - type Rewrite = DynFlags -> B.ByteString -> Maybe B.ByteString - -@@ -107,6 +107,27 @@ rewriteAVX dflags s - isVmovdqa = B.isPrefixOf (B.pack "vmovdqa") - isVmovap = B.isPrefixOf (B.pack "vmovap") - -+-- | This rewrites (tail) calls to avoid creating PLT entries for -+-- functions on riscv64. The replacement will load the address from the -+-- GOT, which is resolved to point to the real address of the function. -+rewriteCall :: Rewrite -+rewriteCall dflags l -+ | not isRISCV64 = Nothing -+ | isCall l = Just $ replaceCall "call" "jalr" "ra" l -+ | isTail l = Just $ replaceCall "tail" "jr" "t1" l -+ | otherwise = Nothing -+ where -+ isRISCV64 = platformArch (targetPlatform dflags) == ArchRISCV64 -+ isCall = B.isPrefixOf (B.pack "call\t") -+ isTail = B.isPrefixOf (B.pack "tail\t") -+ -+ replaceCall call jump reg l = -+ appendInsn (jump ++ "\t" ++ reg) $ removePlt $ -+ replaceOnce (B.pack call) (B.pack ("la\t" ++ reg ++ ",")) l -+ where -+ removePlt = replaceOnce (B.pack "@plt") (B.pack "") -+ appendInsn i = (`B.append` B.pack ("\n\t" ++ i)) -+ - -- | @replaceOnce match replace bs@ replaces the first occurrence of the - -- substring @match@ in @bs@ with @replace@. - replaceOnce :: B.ByteString -> B.ByteString -> B.ByteString -> B.ByteString -Index: ghc-9.2.1/configure.ac -=================================================================== ---- ghc-9.2.1.orig/configure.ac -+++ ghc-9.2.1/configure.ac -@@ -322,7 +322,7 @@ AC_MSG_CHECKING(whether target supports - case "$Unregisterised" in - NO) - case "$TargetArch" in -- ia64|powerpc64|powerpc64le|s390x|riscv64) -+ ia64|powerpc64|powerpc64le|s390x) - TablesNextToCodeDefault=NO - AC_MSG_RESULT([no]) - ;; -Index: ghc-9.2.1/libraries/ghci/GHCi/InfoTable.hsc -=================================================================== ---- ghc-9.2.1.orig/libraries/ghci/GHCi/InfoTable.hsc -+++ ghc-9.2.1/libraries/ghci/GHCi/InfoTable.hsc -@@ -241,6 +241,15 @@ mkJumpToAddr a = case hostPlatformArch o - 0xC0, 0x19, byte3 w64, byte2 w64, byte1 w64, byte0 w64, - 0x07, 0xF1 ] - -+ ArchRISCV64 -> pure $ -+ let w64 = fromIntegral (funPtrToInt a) :: Word64 -+ in Right [ 0x00000297 -- auipc t0,0 -+ , 0x01053283 -- ld t0,16(t0) -+ , 0x00028067 -- jr t0 -+ , 0x00000013 -- nop -+ , fromIntegral w64 -+ , fromIntegral (w64 `shiftR` 32) ] -+ - arch -> - -- The arch isn't supported. You either need to add your architecture as a - -- distinct case, or use non-TABLES_NEXT_TO_CODE mode. diff --git a/riscv.patch b/riscv.patch deleted file mode 100644 index 7c67b5c..0000000 --- a/riscv.patch +++ /dev/null @@ -1,778 +0,0 @@ -Index: ghc-8.10.7/aclocal.m4 -=================================================================== ---- ghc-8.10.7.orig/aclocal.m4 -+++ ghc-8.10.7/aclocal.m4 -@@ -231,7 +231,10 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_V - mipsel) - test -z "[$]2" || eval "[$]2=ArchMipsel" - ;; -- hppa|hppa1_1|ia64|m68k|nios2|riscv32|riscv64|rs6000|s390|sh4|vax) -+ riscv64) -+ test -z "[$]2" || eval "[$]2=ArchRISCV64" -+ ;; -+ hppa|hppa1_1|ia64|m68k|nios2|riscv32|rs6000|s390|sh4|vax) - test -z "[$]2" || eval "[$]2=ArchUnknown" - ;; - *) -Index: ghc-8.10.7/compiler/GHC/Platform/RISCV64.hs -=================================================================== ---- /dev/null -+++ ghc-8.10.7/compiler/GHC/Platform/RISCV64.hs -@@ -0,0 +1,10 @@ -+{-# LANGUAGE CPP #-} -+ -+module GHC.Platform.RISCV64 where -+ -+import GhcPrelude -+ -+#define MACHREGS_NO_REGS 0 -+#define MACHREGS_riscv64 1 -+#include "../../../includes/CodeGen.Platform.hs" -+ -Index: ghc-8.10.7/compiler/GHC/Platform/Regs.hs -=================================================================== ---- ghc-8.10.7.orig/compiler/GHC/Platform/Regs.hs -+++ ghc-8.10.7/compiler/GHC/Platform/Regs.hs -@@ -15,6 +15,7 @@ import qualified GHC.Platform.S390X - import qualified GHC.Platform.SPARC as SPARC - import qualified GHC.Platform.X86 as X86 - import qualified GHC.Platform.X86_64 as X86_64 -+import qualified GHC.Platform.RISCV64 as RISCV64 - import qualified GHC.Platform.NoRegs as NoRegs - - -- | Returns 'True' if this global register is stored in a caller-saves -@@ -31,6 +32,7 @@ callerSaves platform - ArchSPARC -> SPARC.callerSaves - ArchARM {} -> ARM.callerSaves - ArchAArch64 -> AArch64.callerSaves -+ ArchRISCV64 -> RISCV64.callerSaves - arch - | arch `elem` [ArchPPC, ArchPPC_64 ELF_V1, ArchPPC_64 ELF_V2] -> - PPC.callerSaves -@@ -53,6 +55,7 @@ activeStgRegs platform - ArchSPARC -> SPARC.activeStgRegs - ArchARM {} -> ARM.activeStgRegs - ArchAArch64 -> AArch64.activeStgRegs -+ ArchRISCV64 -> RISCV64.activeStgRegs - arch - | arch `elem` [ArchPPC, ArchPPC_64 ELF_V1, ArchPPC_64 ELF_V2] -> - PPC.activeStgRegs -@@ -70,6 +73,7 @@ haveRegBase platform - ArchSPARC -> SPARC.haveRegBase - ArchARM {} -> ARM.haveRegBase - ArchAArch64 -> AArch64.haveRegBase -+ ArchRISCV64 -> RISCV64.haveRegBase - arch - | arch `elem` [ArchPPC, ArchPPC_64 ELF_V1, ArchPPC_64 ELF_V2] -> - PPC.haveRegBase -@@ -87,6 +91,7 @@ globalRegMaybe platform - ArchSPARC -> SPARC.globalRegMaybe - ArchARM {} -> ARM.globalRegMaybe - ArchAArch64 -> AArch64.globalRegMaybe -+ ArchRISCV64 -> RISCV64.globalRegMaybe - arch - | arch `elem` [ArchPPC, ArchPPC_64 ELF_V1, ArchPPC_64 ELF_V2] -> - PPC.globalRegMaybe -@@ -104,6 +109,7 @@ freeReg platform - ArchSPARC -> SPARC.freeReg - ArchARM {} -> ARM.freeReg - ArchAArch64 -> AArch64.freeReg -+ ArchRISCV64 -> RISCV64.freeReg - arch - | arch `elem` [ArchPPC, ArchPPC_64 ELF_V1, ArchPPC_64 ELF_V2] -> - PPC.freeReg -Index: ghc-8.10.7/compiler/ghc.cabal.in -=================================================================== ---- ghc-8.10.7.orig/compiler/ghc.cabal.in -+++ ghc-8.10.7/compiler/ghc.cabal.in -@@ -294,6 +294,7 @@ Library - GHC.Platform.AArch64 - GHC.Platform.NoRegs - GHC.Platform.PPC -+ GHC.Platform.RISCV64 - GHC.Platform.S390X - GHC.Platform.SPARC - GHC.Platform.X86 -Index: ghc-8.10.7/compiler/main/DriverPipeline.hs -=================================================================== ---- ghc-8.10.7.orig/compiler/main/DriverPipeline.hs -+++ ghc-8.10.7/compiler/main/DriverPipeline.hs -@@ -937,6 +937,7 @@ llvmOptions dflags = - ++ [("", "-mcpu=" ++ mcpu) | not (null mcpu) - , not (any (isInfixOf "-mcpu") (getOpts dflags opt_lc)) ] - ++ [("", "-mattr=" ++ attrs) | not (null attrs) ] -+ ++ [("", "-target-abi=" ++ abi) | not (null abi) ] - - where target = platformMisc_llvmTarget $ platformMisc dflags - Just (LlvmTarget _ mcpu mattr) = lookup target (llvmTargets $ llvmConfig dflags) -@@ -966,6 +967,11 @@ llvmOptions dflags = - ++ ["+bmi" | isBmiEnabled dflags ] - ++ ["+bmi2" | isBmi2Enabled dflags ] - -+ abi :: String -+ abi = case platformArch (targetPlatform dflags) of -+ ArchRISCV64 -> "lp64d" -+ _ -> "" -+ - -- ----------------------------------------------------------------------------- - -- | Each phase in the pipeline returns the next phase to execute, and the - -- name of the file in which the output was placed. -Index: ghc-8.10.7/compiler/nativeGen/AsmCodeGen.hs -=================================================================== ---- ghc-8.10.7.orig/compiler/nativeGen/AsmCodeGen.hs -+++ ghc-8.10.7/compiler/nativeGen/AsmCodeGen.hs -@@ -177,6 +177,7 @@ nativeCodeGen dflags this_mod modLoc h u - ArchAlpha -> panic "nativeCodeGen: No NCG for Alpha" - ArchMipseb -> panic "nativeCodeGen: No NCG for mipseb" - ArchMipsel -> panic "nativeCodeGen: No NCG for mipsel" -+ ArchRISCV64 -> panic "nativeCodeGen: No NCG for RISCV64" - ArchUnknown -> panic "nativeCodeGen: No NCG for unknown arch" - ArchJavaScript-> panic "nativeCodeGen: No NCG for JavaScript" - -Index: ghc-8.10.7/compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs -=================================================================== ---- ghc-8.10.7.orig/compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs -+++ ghc-8.10.7/compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs -@@ -120,6 +120,7 @@ trivColorable platform virtualRegSqueeze - ArchMipseb -> panic "trivColorable ArchMipseb" - ArchMipsel -> panic "trivColorable ArchMipsel" - ArchS390X -> panic "trivColorable ArchS390X" -+ ArchRISCV64 -> panic "trivColorable ArchRISCV64" - ArchJavaScript-> panic "trivColorable ArchJavaScript" - ArchUnknown -> panic "trivColorable ArchUnknown") - , count2 <- accSqueeze 0 cALLOCATABLE_REGS_INTEGER -@@ -151,6 +152,7 @@ trivColorable platform virtualRegSqueeze - ArchMipseb -> panic "trivColorable ArchMipseb" - ArchMipsel -> panic "trivColorable ArchMipsel" - ArchS390X -> panic "trivColorable ArchS390X" -+ ArchRISCV64 -> panic "trivColorable ArchRISCV64" - ArchJavaScript-> panic "trivColorable ArchJavaScript" - ArchUnknown -> panic "trivColorable ArchUnknown") - , count2 <- accSqueeze 0 cALLOCATABLE_REGS_FLOAT -@@ -184,6 +186,7 @@ trivColorable platform virtualRegSqueeze - ArchMipseb -> panic "trivColorable ArchMipseb" - ArchMipsel -> panic "trivColorable ArchMipsel" - ArchS390X -> panic "trivColorable ArchS390X" -+ ArchRISCV64 -> panic "trivColorable ArchRISCV64" - ArchJavaScript-> panic "trivColorable ArchJavaScript" - ArchUnknown -> panic "trivColorable ArchUnknown") - , count2 <- accSqueeze 0 cALLOCATABLE_REGS_DOUBLE -Index: ghc-8.10.7/compiler/nativeGen/RegAlloc/Linear/FreeRegs.hs -=================================================================== ---- ghc-8.10.7.orig/compiler/nativeGen/RegAlloc/Linear/FreeRegs.hs -+++ ghc-8.10.7/compiler/nativeGen/RegAlloc/Linear/FreeRegs.hs -@@ -84,5 +84,6 @@ maxSpillSlots dflags - ArchAlpha -> panic "maxSpillSlots ArchAlpha" - ArchMipseb -> panic "maxSpillSlots ArchMipseb" - ArchMipsel -> panic "maxSpillSlots ArchMipsel" -+ ArchRISCV64 -> panic "maxSpillSlots ArchRISCV64" - ArchJavaScript-> panic "maxSpillSlots ArchJavaScript" - ArchUnknown -> panic "maxSpillSlots ArchUnknown" -Index: ghc-8.10.7/compiler/nativeGen/RegAlloc/Linear/Main.hs -=================================================================== ---- ghc-8.10.7.orig/compiler/nativeGen/RegAlloc/Linear/Main.hs -+++ ghc-8.10.7/compiler/nativeGen/RegAlloc/Linear/Main.hs -@@ -221,6 +221,7 @@ linearRegAlloc dflags entry_ids block_li - ArchAlpha -> panic "linearRegAlloc ArchAlpha" - ArchMipseb -> panic "linearRegAlloc ArchMipseb" - ArchMipsel -> panic "linearRegAlloc ArchMipsel" -+ ArchRISCV64 -> panic "linearRegAlloc ArchRISCV64" - ArchJavaScript -> panic "linearRegAlloc ArchJavaScript" - ArchUnknown -> panic "linearRegAlloc ArchUnknown" - where -Index: ghc-8.10.7/compiler/nativeGen/TargetReg.hs -=================================================================== ---- ghc-8.10.7.orig/compiler/nativeGen/TargetReg.hs -+++ ghc-8.10.7/compiler/nativeGen/TargetReg.hs -@@ -53,6 +53,7 @@ targetVirtualRegSqueeze platform - ArchAlpha -> panic "targetVirtualRegSqueeze ArchAlpha" - ArchMipseb -> panic "targetVirtualRegSqueeze ArchMipseb" - ArchMipsel -> panic "targetVirtualRegSqueeze ArchMipsel" -+ ArchRISCV64 -> panic "targetVirtualRegSqueeze ArchRISCV64" - ArchJavaScript-> panic "targetVirtualRegSqueeze ArchJavaScript" - ArchUnknown -> panic "targetVirtualRegSqueeze ArchUnknown" - -@@ -72,6 +73,7 @@ targetRealRegSqueeze platform - ArchAlpha -> panic "targetRealRegSqueeze ArchAlpha" - ArchMipseb -> panic "targetRealRegSqueeze ArchMipseb" - ArchMipsel -> panic "targetRealRegSqueeze ArchMipsel" -+ ArchRISCV64 -> panic "targetRealRegSqueeze ArchRISCV64" - ArchJavaScript-> panic "targetRealRegSqueeze ArchJavaScript" - ArchUnknown -> panic "targetRealRegSqueeze ArchUnknown" - -@@ -90,6 +92,7 @@ targetClassOfRealReg platform - ArchAlpha -> panic "targetClassOfRealReg ArchAlpha" - ArchMipseb -> panic "targetClassOfRealReg ArchMipseb" - ArchMipsel -> panic "targetClassOfRealReg ArchMipsel" -+ ArchRISCV64 -> panic "targetClassOfRealReg ArchRISCV64" - ArchJavaScript-> panic "targetClassOfRealReg ArchJavaScript" - ArchUnknown -> panic "targetClassOfRealReg ArchUnknown" - -@@ -108,6 +111,7 @@ targetMkVirtualReg platform - ArchAlpha -> panic "targetMkVirtualReg ArchAlpha" - ArchMipseb -> panic "targetMkVirtualReg ArchMipseb" - ArchMipsel -> panic "targetMkVirtualReg ArchMipsel" -+ ArchRISCV64 -> panic "targetMkVirtualReg ArchRISCV64" - ArchJavaScript-> panic "targetMkVirtualReg ArchJavaScript" - ArchUnknown -> panic "targetMkVirtualReg ArchUnknown" - -@@ -126,6 +130,7 @@ targetRegDotColor platform - ArchAlpha -> panic "targetRegDotColor ArchAlpha" - ArchMipseb -> panic "targetRegDotColor ArchMipseb" - ArchMipsel -> panic "targetRegDotColor ArchMipsel" -+ ArchRISCV64 -> panic "targetRegDotColor ArchRISCV64" - ArchJavaScript-> panic "targetRegDotColor ArchJavaScript" - ArchUnknown -> panic "targetRegDotColor ArchUnknown" - -Index: ghc-8.10.7/configure -=================================================================== ---- ghc-8.10.7.orig/configure -+++ ghc-8.10.7/configure -@@ -4921,7 +4921,7 @@ esac - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether target supports a registerised ABI" >&5 - printf %s "checking whether target supports a registerised ABI... " >&6; } - case "$TargetArch" in -- i386|x86_64|powerpc|powerpc64|powerpc64le|s390x|arm|aarch64) -+ i386|x86_64|powerpc|powerpc64|powerpc64le|s390x|arm|aarch64|riscv64) - UnregisterisedDefault=NO - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 - printf "%s\n" "yes" >&6; } -@@ -4972,7 +4972,7 @@ printf %s "checking whether target suppo - case "$Unregisterised" in - NO) - case "$TargetArch" in -- ia64|powerpc64|powerpc64le|s390x) -+ ia64|powerpc64|powerpc64le|s390x|riscv64) - TablesNextToCodeDefault=NO - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 - printf "%s\n" "no" >&6; } -@@ -5030,7 +5030,7 @@ fi - - - case "$target" in -- powerpc64-*|powerpc64le-*|powerpc-ibm-aix*|s390x-ibm-linux) -+ powerpc64-*|powerpc64le-*|powerpc-ibm-aix*|s390x-ibm-linux|riscv64-*) - TargetHasRTSLinker=NO - ;; - *) -@@ -10565,7 +10565,10 @@ rm -f core conftest.err conftest.$ac_obj - mipsel) - test -z "$2" || eval "$2=ArchMipsel" - ;; -- hppa|hppa1_1|ia64|m68k|nios2|riscv32|riscv64|rs6000|s390|sh4|vax) -+ riscv64) -+ test -z "$2" || eval "$2=ArchRISCV64" -+ ;; -+ hppa|hppa1_1|ia64|m68k|nios2|riscv32|rs6000|s390|sh4|vax) - test -z "$2" || eval "$2=ArchUnknown" - ;; - *) -Index: ghc-8.10.7/configure.ac -=================================================================== ---- ghc-8.10.7.orig/configure.ac -+++ ghc-8.10.7/configure.ac -@@ -262,7 +262,7 @@ dnl ------------------------------------ - - AC_MSG_CHECKING(whether target supports a registerised ABI) - case "$TargetArch" in -- i386|x86_64|powerpc|powerpc64|powerpc64le|s390x|arm|aarch64) -+ i386|x86_64|powerpc|powerpc64|powerpc64le|s390x|arm|aarch64|riscv64) - UnregisterisedDefault=NO - AC_MSG_RESULT([yes]) - ;; -@@ -297,7 +297,7 @@ AC_MSG_CHECKING(whether target supports - case "$Unregisterised" in - NO) - case "$TargetArch" in -- ia64|powerpc64|powerpc64le|s390x) -+ ia64|powerpc64|powerpc64le|s390x|riscv64) - TablesNextToCodeDefault=NO - AC_MSG_RESULT([no]) - ;; -@@ -326,7 +326,7 @@ AC_SUBST(TablesNextToCode) - dnl ** Does target have runtime linker support? - dnl -------------------------------------------------------------- - case "$target" in -- powerpc64-*|powerpc64le-*|powerpc-ibm-aix*|s390x-ibm-linux) -+ powerpc64-*|powerpc64le-*|powerpc-ibm-aix*|s390x-ibm-linux|riscv64-*) - TargetHasRTSLinker=NO - ;; - *) -Index: ghc-8.10.7/includes/CodeGen.Platform.hs -=================================================================== ---- ghc-8.10.7.orig/includes/CodeGen.Platform.hs -+++ ghc-8.10.7/includes/CodeGen.Platform.hs -@@ -380,6 +380,74 @@ import Reg - # define f14 30 - # define f15 31 - -+#elif defined(MACHREGS_riscv64) -+ -+# define zero 0 -+# define ra 1 -+# define sp 2 -+# define gp 3 -+# define tp 4 -+# define t0 5 -+# define t1 6 -+# define t2 7 -+# define s0 8 -+# define s1 9 -+# define a0 10 -+# define a1 11 -+# define a2 12 -+# define a3 13 -+# define a4 14 -+# define a5 15 -+# define a6 16 -+# define a7 17 -+# define s2 18 -+# define s3 19 -+# define s4 20 -+# define s5 21 -+# define s6 22 -+# define s7 23 -+# define s8 24 -+# define s9 25 -+# define s10 26 -+# define s11 27 -+# define t3 28 -+# define t4 29 -+# define t5 30 -+# define t6 31 -+ -+# define ft0 32 -+# define ft1 33 -+# define ft2 34 -+# define ft3 35 -+# define ft4 36 -+# define ft5 37 -+# define ft6 38 -+# define ft7 39 -+# define fs0 40 -+# define fs1 41 -+# define fa0 42 -+# define fa1 43 -+# define fa2 44 -+# define fa3 45 -+# define fa4 46 -+# define fa5 47 -+# define fa6 48 -+# define fa7 49 -+# define fs2 50 -+# define fs3 51 -+# define fs4 52 -+# define fs5 53 -+# define fs6 54 -+# define fs7 55 -+# define fs8 56 -+# define fs9 57 -+# define fs10 58 -+# define fs11 59 -+# define ft8 60 -+# define ft9 61 -+# define ft10 62 -+# define ft11 63 -+ - #endif - - callerSaves :: GlobalReg -> Bool -@@ -667,7 +735,7 @@ globalRegMaybe :: GlobalReg -> Maybe Rea - #if defined(MACHREGS_i386) || defined(MACHREGS_x86_64) \ - || defined(MACHREGS_sparc) || defined(MACHREGS_powerpc) \ - || defined(MACHREGS_arm) || defined(MACHREGS_aarch64) \ -- || defined(MACHREGS_s390x) -+ || defined(MACHREGS_s390x) || defined(MACHREGS_riscv64) - # if defined(REG_Base) - globalRegMaybe BaseReg = Just (RealRegSingle REG_Base) - # endif -Index: ghc-8.10.7/includes/stg/MachRegs.h -=================================================================== ---- ghc-8.10.7.orig/includes/stg/MachRegs.h -+++ ghc-8.10.7/includes/stg/MachRegs.h -@@ -661,6 +661,68 @@ the stack. See Note [Overlapping global - #define CALLER_SAVES_D5 - #define CALLER_SAVES_D6 - -+/* ----------------------------------------------------------------------------- -+ The riscv64 register mapping -+ -+ Register | Role(s) | Call effect -+ ------------+-----------------------------------------+------------- -+ zero | Hard-wired zero | - -+ ra | Return address | caller-saved -+ sp | Stack pointer | callee-saved -+ gp | Global pointer | callee-saved -+ tp | Thread pointer | callee-saved -+ t0,t1,t2 | - | caller-saved -+ s0 | Frame pointer | callee-saved -+ s1 | - | callee-saved -+ a0,a1 | Arguments / return values | caller-saved -+ a2..a7 | Arguments | caller-saved -+ s2..s11 | - | callee-saved -+ t3..t6 | - | caller-saved -+ ft0..ft7 | - | caller-saved -+ fs0,fs1 | - | callee-saved -+ fa0,fa1 | Arguments / return values | caller-saved -+ fa2..fa7 | Arguments | caller-saved -+ fs2..fs11 | - | callee-saved -+ ft8..ft11 | - | caller-saved -+ -+ Each general purpose register as well as each floating-point -+ register is 64 bits wide. -+ -+ -------------------------------------------------------------------------- */ -+ -+#elif defined(MACHREGS_riscv64) -+ -+#define REG(x) __asm__(#x) -+ -+#define REG_Base s1 -+#define REG_Sp s2 -+#define REG_Hp s3 -+#define REG_R1 s4 -+#define REG_R2 s5 -+#define REG_R3 s6 -+#define REG_R4 s7 -+#define REG_R5 s8 -+#define REG_R6 s9 -+#define REG_R7 s10 -+#define REG_SpLim s11 -+ -+#define REG_F1 fs0 -+#define REG_F2 fs1 -+#define REG_F3 fs2 -+#define REG_F4 fs3 -+#define REG_F5 fs4 -+#define REG_F6 fs5 -+ -+#define REG_D1 fs6 -+#define REG_D2 fs7 -+#define REG_D3 fs8 -+#define REG_D4 fs9 -+#define REG_D5 fs10 -+#define REG_D6 fs11 -+ -+#define MAX_REAL_FLOAT_REG 6 -+#define MAX_REAL_DOUBLE_REG 6 -+ - #else - - #error Cannot find platform to give register info for -Index: ghc-8.10.7/includes/stg/MachRegsForHost.h -=================================================================== ---- ghc-8.10.7.orig/includes/stg/MachRegsForHost.h -+++ ghc-8.10.7/includes/stg/MachRegsForHost.h -@@ -71,6 +71,10 @@ - #define MACHREGS_s390x 1 - #endif - -+#if defined(riscv64_HOST_ARCH) -+#define MACHREGS_riscv64 1 -+#endif -+ - #endif - - #include "MachRegs.h" -Index: ghc-8.10.7/includes/stg/SMP.h -=================================================================== ---- ghc-8.10.7.orig/includes/stg/SMP.h -+++ ghc-8.10.7/includes/stg/SMP.h -@@ -377,6 +377,8 @@ write_barrier(void) { - __asm__ __volatile__ ("" : : : "memory"); - #elif defined(arm_HOST_ARCH) || defined(aarch64_HOST_ARCH) - __asm__ __volatile__ ("dmb st" : : : "memory"); -+#elif defined(riscv64_HOST_ARCH) -+ __asm__ __volatile__ ("fence w,w" : : : "memory"); - #else - #error memory barriers unimplemented on this architecture - #endif -@@ -401,6 +403,8 @@ store_load_barrier(void) { - __asm__ __volatile__ ("dmb" : : : "memory"); - #elif defined(aarch64_HOST_ARCH) - __asm__ __volatile__ ("dmb sy" : : : "memory"); -+#elif defined(riscv64_HOST_ARCH) -+ __asm__ __volatile__ ("fence w,r" : : : "memory"); - #else - #error memory barriers unimplemented on this architecture - #endif -@@ -426,6 +430,8 @@ load_load_barrier(void) { - __asm__ __volatile__ ("dmb" : : : "memory"); - #elif defined(aarch64_HOST_ARCH) - __asm__ __volatile__ ("dmb sy" : : : "memory"); -+#elif defined(riscv64_HOST_ARCH) -+ __asm__ __volatile__ ("fence w,r" : : : "memory"); - #else - #error memory barriers unimplemented on this architecture - #endif -Index: ghc-8.10.7/libraries/ghc-boot/GHC/Platform.hs -=================================================================== ---- ghc-8.10.7.orig/libraries/ghc-boot/GHC/Platform.hs -+++ ghc-8.10.7/libraries/ghc-boot/GHC/Platform.hs -@@ -118,6 +118,7 @@ data Arch - | ArchAlpha - | ArchMipseb - | ArchMipsel -+ | ArchRISCV64 - | ArchJavaScript - deriving (Read, Show, Eq) - -@@ -159,6 +160,7 @@ stringEncodeArch = \case - ArchAlpha -> "alpha" - ArchMipseb -> "mipseb" - ArchMipsel -> "mipsel" -+ ArchRISCV64 -> "riscv64" - ArchJavaScript -> "js" - - isARM :: Arch -> Bool -Index: ghc-8.10.7/llvm-targets -=================================================================== ---- ghc-8.10.7.orig/llvm-targets -+++ ghc-8.10.7/llvm-targets -@@ -34,6 +34,8 @@ - ,("powerpc64le-unknown-linux-musl", ("e-m:e-i64:64-n32:64", "ppc64le", "+secure-plt")) - ,("powerpc64le-unknown-linux", ("e-m:e-i64:64-n32:64", "ppc64le", "")) - ,("s390x-ibm-linux", ("E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-a:8:16-n32:64", "z10", "")) -+,("riscv64-unknown-linux-gnu", ("e-m:e-p:64:64-i64:64-i128:128-n64-S128", "", "+m +a +f +d +c +relax")) -+,("riscv64-unknown-linux", ("e-m:e-p:64:64-i64:64-i128:128-n64-S128", "", "+m +a +f +d +c +relax")) - ,("i386-apple-darwin", ("e-m:o-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:128-n8:16:32-S128", "yonah", "")) - ,("x86_64-apple-darwin", ("e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128", "core2", "")) - ,("arm64-apple-darwin", ("e-m:o-i64:64-i128:128-n32:64-S128", "apple-a7", "+fp-armv8 +neon +crypto +zcm +zcz +sha2 +aes")) -Index: ghc-8.10.7/mk/config.mk.in -=================================================================== ---- ghc-8.10.7.orig/mk/config.mk.in -+++ ghc-8.10.7/mk/config.mk.in -@@ -192,7 +192,7 @@ ifeq "$(TargetArch_CPP)" "arm" - # We don't support load/store barriers pre-ARMv7. See #10433. - ArchSupportsSMP=$(if $(filter $(ARM_ISA),ARMv5 ARMv6),NO,YES) - else --ArchSupportsSMP=$(strip $(patsubst $(TargetArch_CPP), YES, $(findstring $(TargetArch_CPP), i386 x86_64 sparc powerpc powerpc64 powerpc64le s390x aarch64))) -+ArchSupportsSMP=$(strip $(patsubst $(TargetArch_CPP), YES, $(findstring $(TargetArch_CPP), i386 x86_64 sparc powerpc powerpc64 powerpc64le s390x aarch64 riscv64))) - endif - - # The THREADED_RTS requires `BaseReg` to be in a register and the -Index: ghc-8.10.7/rts/StgCRunAsm.S -=================================================================== ---- ghc-8.10.7.orig/rts/StgCRunAsm.S -+++ ghc-8.10.7/rts/StgCRunAsm.S -@@ -276,6 +276,150 @@ StgReturn: - .size StgReturn, .-StgReturn - - .section .note.GNU-stack,"",@progbits -+ -+#elif defined(riscv64_HOST_ARCH) -+# define STACK_FRAME_SIZE (RESERVED_C_STACK_BYTES+208) -+ .text -+ .align 1 -+ .globl StgRun -+ .type StgRun, @function -+StgRun: -+ .cfi_startproc -+ addi sp,sp,-208 -+ .cfi_def_cfa_offset 208 -+ /* save callee-saved registers */ -+ sd ra,200(sp) -+ sd s0,192(sp) -+ sd s1,184(sp) -+ sd s2,176(sp) -+ sd s3,168(sp) -+ sd s4,160(sp) -+ sd s5,152(sp) -+ sd s6,144(sp) -+ sd s7,136(sp) -+ sd s8,128(sp) -+ sd s9,120(sp) -+ sd s10,112(sp) -+ sd s11,104(sp) -+ fsd fs0,88(sp) -+ fsd fs1,80(sp) -+ fsd fs2,72(sp) -+ fsd fs3,64(sp) -+ fsd fs4,56(sp) -+ fsd fs5,48(sp) -+ fsd fs6,40(sp) -+ fsd fs7,32(sp) -+ fsd fs8,24(sp) -+ fsd fs9,16(sp) -+ fsd fs10,8(sp) -+ fsd fs11,0(sp) -+ /* allocate stack frame */ -+ li t0,RESERVED_C_STACK_BYTES -+ sub sp,sp,t0 -+ .cfi_def_cfa_offset STACK_FRAME_SIZE -+ .cfi_offset 1, -8 -+ .cfi_offset 8, -16 -+ .cfi_offset 9, -24 -+ .cfi_offset 18, -32 -+ .cfi_offset 19, -40 -+ .cfi_offset 20, -48 -+ .cfi_offset 21, -56 -+ .cfi_offset 22, -64 -+ .cfi_offset 23, -72 -+ .cfi_offset 24, -80 -+ .cfi_offset 25, -88 -+ .cfi_offset 26, -96 -+ .cfi_offset 27, -104 -+ .cfi_offset 40, -120 -+ .cfi_offset 41, -128 -+ .cfi_offset 50, -136 -+ .cfi_offset 51, -144 -+ .cfi_offset 52, -152 -+ .cfi_offset 53, -160 -+ .cfi_offset 54, -168 -+ .cfi_offset 55, -176 -+ .cfi_offset 56, -184 -+ .cfi_offset 57, -192 -+ .cfi_offset 58, -200 -+ .cfi_offset 59, -208 -+ /* set STGs BaseReg from RISCV a1 */ -+ mv s1,a1 -+ /* jump to STG function */ -+ jr a0 -+ .cfi_endproc -+ .size StgRun, .-StgRun -+ -+ .text -+ .align 1 -+ .globl StgReturn -+ .type StgReturn, @function -+StgReturn: -+ .cfi_startproc -+ /* set return value from STGs R1 (RISCV s4) */ -+ mv a0,s4 -+ /* deallocate stack frame */ -+ li t0,RESERVED_C_STACK_BYTES -+ add sp,sp,t0 -+ .cfi_def_cfa_offset 208 -+ /* restore callee-saved registers */ -+ ld ra,200(sp) -+ .cfi_restore 1 -+ ld s0,192(sp) -+ .cfi_restore 8 -+ ld s1,184(sp) -+ .cfi_restore 9 -+ ld s2,176(sp) -+ .cfi_restore 18 -+ ld s3,168(sp) -+ .cfi_restore 19 -+ ld s4,160(sp) -+ .cfi_restore 20 -+ ld s5,152(sp) -+ .cfi_restore 21 -+ ld s6,144(sp) -+ .cfi_restore 22 -+ ld s7,136(sp) -+ .cfi_restore 23 -+ ld s8,128(sp) -+ .cfi_restore 24 -+ ld s9,120(sp) -+ .cfi_restore 25 -+ ld s10,112(sp) -+ .cfi_restore 26 -+ ld s11,104(sp) -+ .cfi_restore 27 -+ fld fs0,88(sp) -+ .cfi_restore 40 -+ fld fs1,80(sp) -+ .cfi_restore 41 -+ fld fs2,72(sp) -+ .cfi_restore 50 -+ fld fs3,64(sp) -+ .cfi_restore 51 -+ fld fs4,56(sp) -+ .cfi_restore 52 -+ fld fs5,48(sp) -+ .cfi_restore 53 -+ fld fs6,40(sp) -+ .cfi_restore 54 -+ fld fs7,32(sp) -+ .cfi_restore 55 -+ fld fs8,24(sp) -+ .cfi_restore 56 -+ fld fs9,16(sp) -+ .cfi_restore 57 -+ fld fs10,8(sp) -+ .cfi_restore 58 -+ fld fs11,0(sp) -+ .cfi_restore 59 -+ addi sp,sp,208 -+ .cfi_def_cfa_offset 0 -+ /* jump back to caller of StgRun() */ -+ ret -+ .cfi_endproc -+ .size StgReturn, .-StgReturn -+ -+ .section .note.GNU-stack,"",@progbits - #endif - - #endif /* !USE_MINIINTERPRETER */ -Index: ghc-8.10.7/rts/ghc.mk -=================================================================== ---- ghc-8.10.7.orig/rts/ghc.mk -+++ ghc-8.10.7/rts/ghc.mk -@@ -58,7 +58,7 @@ ifneq "$(findstring $(TargetArch_CPP), i - rts_S_SRCS += rts/AdjustorAsm.S - endif - # this matches substrings of powerpc64le, including "powerpc" and "powerpc64" --ifneq "$(findstring $(TargetArch_CPP), powerpc64le s390x)" "" -+ifneq "$(findstring $(TargetArch_CPP), powerpc64le s390x riscv64)" "" - # unregisterised builds use the mini interpreter - ifneq "$(GhcUnregisterised)" "YES" - rts_S_SRCS += rts/StgCRunAsm.S -Index: ghc-8.10.7/rts/linker/Elf.c -=================================================================== ---- ghc-8.10.7.orig/rts/linker/Elf.c -+++ ghc-8.10.7/rts/linker/Elf.c -@@ -406,6 +406,12 @@ ocVerifyImage_ELF ( ObjectCode* oc ) - #if defined(EM_AARCH64) - case EM_AARCH64: IF_DEBUG(linker,debugBelch( "aarch64" )); break; - #endif -+#if defined(EM_RISCV) -+ case EM_RISCV: IF_DEBUG(linker,debugBelch( "riscv" )); -+ errorBelch("%s: RTS linker not implemented on riscv", -+ oc->fileName); -+ return 0; -+#endif - default: IF_DEBUG(linker,debugBelch( "unknown" )); - errorBelch("%s: unknown architecture (e_machine == %d)" - , oc->fileName, ehdr->e_machine); -Index: ghc-8.10.7/rts/rts.cabal.in -=================================================================== ---- ghc-8.10.7.orig/rts/rts.cabal.in -+++ ghc-8.10.7/rts/rts.cabal.in -@@ -387,7 +387,7 @@ library - - if arch(i386) || arch(powerpc) || arch(powerpc64) - asm-sources: AdjustorAsm.S -- if arch(powerpc) || arch(powerpc64) || arch(powerpc64le) || arch(s390x) -+ if arch(powerpc) || arch(powerpc64) || arch(powerpc64le) || arch(s390x) || arch(riscv64) - asm-sources: StgCRunAsm.S - - c-sources: Adjustor.c -Index: ghc-8.10.7/utils/genapply/Main.hs -=================================================================== ---- ghc-8.10.7.orig/utils/genapply/Main.hs -+++ ghc-8.10.7/utils/genapply/Main.hs -@@ -17,6 +17,8 @@ module Main(main) where - -- We improperly include *HOST* macros for our target... - #include "../../includes/ghcconfig.h" - -+#undef UnregisterisedCompiler -+ - -- ...so that this header defines the right stuff. It is the RTS's host, but - -- our target, as we are generating code that uses that RTS. - #include "../../includes/stg/MachRegsForHost.h" -Index: ghc-8.10.7/utils/llvm-targets/gen-data-layout.sh -=================================================================== ---- ghc-8.10.7.orig/utils/llvm-targets/gen-data-layout.sh -+++ ghc-8.10.7/utils/llvm-targets/gen-data-layout.sh -@@ -72,6 +72,9 @@ TARGETS=( - "powerpc64le-unknown-linux" - # Linux s390x - "s390x-ibm-linux" -+ # Linux riscv64 -+ "riscv64-unknown-linux-gnu" -+ "riscv64-unknown-linux" - - ######################### - # Darwin From 476db4a04dda83f9714f38e4131bf9ed9922a82d1bee6b162096c678b1de304d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20S=C3=BAkup?= Date: Thu, 2 Feb 2023 15:44:26 +0000 Subject: [PATCH 3/9] - drop ghc-8.0.2-Cabal-dynlibdir.patch - hadrian build fails with this patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:haskell/ghc?expand=0&rev=376 --- ghc-8.0.2-Cabal-dynlibdir.patch | 13 ------------- ghc.changes | 6 ++++++ ghc.spec | 5 +---- 3 files changed, 7 insertions(+), 17 deletions(-) delete mode 100644 ghc-8.0.2-Cabal-dynlibdir.patch diff --git a/ghc-8.0.2-Cabal-dynlibdir.patch b/ghc-8.0.2-Cabal-dynlibdir.patch deleted file mode 100644 index ae7cc51..0000000 --- a/ghc-8.0.2-Cabal-dynlibdir.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: ghc-8.10.0.20200123/libraries/Cabal/Cabal/Distribution/Simple/InstallDirs.hs -=================================================================== ---- ghc-8.10.0.20200123.orig/libraries/Cabal/Cabal/Distribution/Simple/InstallDirs.hs -+++ ghc-8.10.0.20200123/libraries/Cabal/Cabal/Distribution/Simple/InstallDirs.hs -@@ -207,7 +207,7 @@ defaultInstallDirs' False comp userInsta - _other -> "$abi" "$libname", - dynlibdir = "$libdir" case comp of - UHC -> "$pkgid" -- _other -> "$abi", -+ _other -> "$compiler" "$pkgkey", - libexecsubdir= "$abi" "$pkgid", - flibdir = "$libdir", - libexecdir = case buildOS of diff --git a/ghc.changes b/ghc.changes index d77b3a8..6d04cbe 100644 --- a/ghc.changes +++ b/ghc.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Feb 2 15:43:52 UTC 2023 - Ondřej Súkup + +- drop ghc-8.0.2-Cabal-dynlibdir.patch - hadrian build fails with + this patch + ------------------------------------------------------------------- Thu Jan 19 12:39:27 UTC 2023 - Guillaume GARDET diff --git a/ghc.spec b/ghc.spec index e5404b1..2e39487 100644 --- a/ghc.spec +++ b/ghc.spec @@ -1,7 +1,7 @@ # # spec file for package ghc # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -83,8 +83,6 @@ Patch2: ghc-armv7-VFPv3D16--NEON.patch Patch3: Disable-unboxed-arrays.patch # PATCH-FIX-UPSTREAM ghc-pie.patch - set linux as default PIE platform Patch35: ghc-pie.patch -# PATCH-FIX-OPENSUSE ghc-8.0.2-Cabal-dynlibdir.patch -- Fix shared library directory location. -Patch100: ghc-8.0.2-Cabal-dynlibdir.patch # PATCH-FIX-UPSTREAM buildpath-abi-stability.patch -- debian patch for more stable abi-1 Patch110: buildpath-abi-stability.patch @@ -198,7 +196,6 @@ except the ghc library, which is installed by the toplevel ghc metapackage. %patch3 -p1 %endif %patch35 -p1 -%patch100 -p1 %patch110 -p1 %build From 440583e5b1aaecff53c6feb205a055dd4cd97491e322309bd09979e32c4c7429 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Fri, 3 Feb 2023 09:19:01 +0000 Subject: [PATCH 4/9] osc copypac from project:devel:languages:haskell:ghc-8.10.x package:ghc revision:59, using keep-link OBS-URL: https://build.opensuse.org/package/show/devel:languages:haskell/ghc?expand=0&rev=377 --- ghc-8.0.2-Cabal-dynlibdir.patch | 13 +++++++++++++ ghc.changes | 6 ------ ghc.spec | 5 ++++- 3 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 ghc-8.0.2-Cabal-dynlibdir.patch diff --git a/ghc-8.0.2-Cabal-dynlibdir.patch b/ghc-8.0.2-Cabal-dynlibdir.patch new file mode 100644 index 0000000..ae7cc51 --- /dev/null +++ b/ghc-8.0.2-Cabal-dynlibdir.patch @@ -0,0 +1,13 @@ +Index: ghc-8.10.0.20200123/libraries/Cabal/Cabal/Distribution/Simple/InstallDirs.hs +=================================================================== +--- ghc-8.10.0.20200123.orig/libraries/Cabal/Cabal/Distribution/Simple/InstallDirs.hs ++++ ghc-8.10.0.20200123/libraries/Cabal/Cabal/Distribution/Simple/InstallDirs.hs +@@ -207,7 +207,7 @@ defaultInstallDirs' False comp userInsta + _other -> "$abi" "$libname", + dynlibdir = "$libdir" case comp of + UHC -> "$pkgid" +- _other -> "$abi", ++ _other -> "$compiler" "$pkgkey", + libexecsubdir= "$abi" "$pkgid", + flibdir = "$libdir", + libexecdir = case buildOS of diff --git a/ghc.changes b/ghc.changes index 6d04cbe..d77b3a8 100644 --- a/ghc.changes +++ b/ghc.changes @@ -1,9 +1,3 @@ -------------------------------------------------------------------- -Thu Feb 2 15:43:52 UTC 2023 - Ondřej Súkup - -- drop ghc-8.0.2-Cabal-dynlibdir.patch - hadrian build fails with - this patch - ------------------------------------------------------------------- Thu Jan 19 12:39:27 UTC 2023 - Guillaume GARDET diff --git a/ghc.spec b/ghc.spec index 2e39487..e5404b1 100644 --- a/ghc.spec +++ b/ghc.spec @@ -1,7 +1,7 @@ # # spec file for package ghc # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -83,6 +83,8 @@ Patch2: ghc-armv7-VFPv3D16--NEON.patch Patch3: Disable-unboxed-arrays.patch # PATCH-FIX-UPSTREAM ghc-pie.patch - set linux as default PIE platform Patch35: ghc-pie.patch +# PATCH-FIX-OPENSUSE ghc-8.0.2-Cabal-dynlibdir.patch -- Fix shared library directory location. +Patch100: ghc-8.0.2-Cabal-dynlibdir.patch # PATCH-FIX-UPSTREAM buildpath-abi-stability.patch -- debian patch for more stable abi-1 Patch110: buildpath-abi-stability.patch @@ -196,6 +198,7 @@ except the ghc library, which is installed by the toplevel ghc metapackage. %patch3 -p1 %endif %patch35 -p1 +%patch100 -p1 %patch110 -p1 %build From e69f225fe8eb0b5801989def23bcb86c0fc62afd6829e3e1cc2c2259d6a3acb1 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Thu, 30 Mar 2023 08:26:17 +0000 Subject: [PATCH 5/9] osc copypac from project:devel:languages:haskell:ghc-9.4.x package:ghc revision:15, using keep-link OBS-URL: https://build.opensuse.org/package/show/devel:languages:haskell/ghc?expand=0&rev=378 --- 9_2_3-bootstrap-sources.tar.gz | 3 + Disable-unboxed-arrays.patch | 16 +- _constraints | 4 +- buildpath-abi-stability.patch | 23 - execstack.patch | 50 ++ fix_extlinks.patch | 22 +- ghc-8.0.2-Cabal-dynlibdir.patch | 6 +- ghc-8.10.7-src.tar.xz | 3 - ghc-8.10.7-src.tar.xz.sig | Bin 438 -> 0 bytes ghc-9.4.4-src.tar.xz | 3 + ghc-9.4.4-src.tar.xz.sig | Bin 0 -> 586 bytes ghc-Cabal-install-PATH-warning.patch | 14 + ghc-armv7-VFPv3D16--NEON.patch | 11 - ghc-gen_contents_index-haddock-path.patch | 13 + ghc-hadrian-s390x-rts--qg.patch | 13 + ghc-pie.patch | 10 +- ghc-pkg.man | 228 +++++++ ghc.changes | 161 ++--- ghc.spec | 768 +++++++++++++++------- haddock.man | 231 +++++++ libatomic.patch | 24 + riscv-tntc.patch | 74 +++ runghc.man | 45 ++ 23 files changed, 1297 insertions(+), 425 deletions(-) create mode 100644 9_2_3-bootstrap-sources.tar.gz delete mode 100644 buildpath-abi-stability.patch create mode 100644 execstack.patch delete mode 100644 ghc-8.10.7-src.tar.xz delete mode 100644 ghc-8.10.7-src.tar.xz.sig create mode 100644 ghc-9.4.4-src.tar.xz create mode 100644 ghc-9.4.4-src.tar.xz.sig create mode 100644 ghc-Cabal-install-PATH-warning.patch delete mode 100644 ghc-armv7-VFPv3D16--NEON.patch create mode 100644 ghc-gen_contents_index-haddock-path.patch create mode 100644 ghc-hadrian-s390x-rts--qg.patch create mode 100644 ghc-pkg.man create mode 100644 haddock.man create mode 100644 libatomic.patch create mode 100644 riscv-tntc.patch create mode 100644 runghc.man diff --git a/9_2_3-bootstrap-sources.tar.gz b/9_2_3-bootstrap-sources.tar.gz new file mode 100644 index 0000000..53104bb --- /dev/null +++ b/9_2_3-bootstrap-sources.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:14c0aaeffa8f8ad642ddd9e97a1d862c2f06e2f00a81f03909bd6485525acfb5 +size 1494230 diff --git a/Disable-unboxed-arrays.patch b/Disable-unboxed-arrays.patch index b476645..3e87cbf 100644 --- a/Disable-unboxed-arrays.patch +++ b/Disable-unboxed-arrays.patch @@ -1,12 +1,12 @@ -Index: ghc-8.6.1/libraries/containers/containers/include/containers.h +Index: ghc-9.4.4/libraries/containers/containers/include/containers.h =================================================================== ---- ghc-8.6.1.orig/libraries/containers/containers//include/containers.h -+++ ghc-8.6.1/libraries/containers/containers/include/containers.h -@@ -35,7 +35,6 @@ - - #ifdef __GLASGOW_HASKELL__ - # define USE_ST_MONAD 1 +--- ghc-9.4.4.orig/libraries/containers/containers/include/containers.h ++++ ghc-9.4.4/libraries/containers/containers/include/containers.h +@@ -23,7 +23,6 @@ + * Unboxed arrays are broken on big-endian architectures. + * See https://gitlab.haskell.org/ghc/ghc/-/issues/16998 + */ -# define USE_UNBOXED_ARRAYS 1 #endif - #endif + diff --git a/_constraints b/_constraints index 2b5c1aa..09ad4fc 100644 --- a/_constraints +++ b/_constraints @@ -1,7 +1,7 @@ - 12 + 16 4 @@ -24,7 +24,7 @@ - 20 + 32 diff --git a/buildpath-abi-stability.patch b/buildpath-abi-stability.patch deleted file mode 100644 index d516980..0000000 --- a/buildpath-abi-stability.patch +++ /dev/null @@ -1,23 +0,0 @@ -Index: ghc-8.10.0.20191210/compiler/iface/MkIface.hs -=================================================================== ---- ghc-8.10.0.20191210.orig/compiler/iface/MkIface.hs -+++ ghc-8.10.0.20191210/compiler/iface/MkIface.hs -@@ -679,7 +679,7 @@ addFingerprints hsc_env iface0 - iface_hash <- computeFingerprint putNameLiterally - (mod_hash, - ann_fn (mkVarOcc "module"), -- See mkIfaceAnnCache -- mi_usages iface0, -+ usages, - sorted_deps, - mi_hpc iface0) - -@@ -714,6 +714,9 @@ addFingerprints hsc_env iface0 - (non_orph_rules, orph_rules) = mkOrphMap ifRuleOrph (mi_rules iface0) - (non_orph_fis, orph_fis) = mkOrphMap ifFamInstOrph (mi_fam_insts iface0) - ann_fn = mkIfaceAnnCache (mi_anns iface0) -+ -- Do not allow filenames to affect the interface -+ usages = [ case u of UsageFile _ fp -> UsageFile "" fp; _ -> u | u <- mi_usages iface0 ] -+ - - -- | Retrieve the orphan hashes 'mi_orphan_hash' for a list of modules - -- (in particular, the orphan modules which are transitively imported by the diff --git a/execstack.patch b/execstack.patch new file mode 100644 index 0000000..c3d8f42 --- /dev/null +++ b/execstack.patch @@ -0,0 +1,50 @@ +From 3739e565f8fa09b3a31ba8f563c518480585f6f9 Mon Sep 17 00:00:00 2001 +From: Andreas Schwab +Date: Sat, 11 Jun 2022 23:29:24 +0200 +Subject: [PATCH] RTS: Add stack marker to StgCRunAsm.S + +Every object file must be properly marked for non-executable stack, even if it +contains no code. +--- + rts/StgCRunAsm.S | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +diff --git a/rts/StgCRunAsm.S b/rts/StgCRunAsm.S +index aed3241d12..9216e6c759 100644 +--- a/rts/StgCRunAsm.S ++++ b/rts/StgCRunAsm.S +@@ -66,8 +66,6 @@ StgReturn: + addi 12,1,-(8*18) + bl _restgpr1_14 + b _restfpr_14 +- +- .section .note.GNU-stack,"",@progbits + # else // linux_HOST_OS + # error Only Linux support for power64 little endian right now. + # endif +@@ -231,8 +229,6 @@ StgReturn: + .cfi_endproc + .size StgReturn, .-StgReturn + +- .section .note.GNU-stack,"",@progbits +- + #elif defined(riscv64_HOST_ARCH) + # define STACK_FRAME_SIZE (RESERVED_C_STACK_BYTES+208) + .text +@@ -374,8 +370,11 @@ StgReturn: + ret + .cfi_endproc + .size StgReturn, .-StgReturn +- +- .section .note.GNU-stack,"",@progbits + #endif + + #endif /* !USE_MINIINTERPRETER */ ++ ++/* mark stack as nonexecutable */ ++#if defined(__linux__) && defined(__ELF__) ++.section .note.GNU-stack,"",@progbits ++#endif +-- +2.37.0 + diff --git a/fix_extlinks.patch b/fix_extlinks.patch index dcd5315..26ea155 100644 --- a/fix_extlinks.patch +++ b/fix_extlinks.patch @@ -1,7 +1,7 @@ -Index: ghc-8.10.7/docs/users_guide/ghc_config.py.in +Index: ghc-9.4.4/docs/users_guide/ghc_config.py.in =================================================================== ---- ghc-8.10.7.orig/docs/users_guide/ghc_config.py.in -+++ ghc-8.10.7/docs/users_guide/ghc_config.py.in +--- ghc-9.4.4.orig/docs/users_guide/ghc_config.py.in 2022-12-23 16:19:02.000000000 +0000 ++++ ghc-9.4.4/docs/users_guide/ghc_config.py.in 2023-01-30 21:30:24.105048683 +0000 @@ -1,6 +1,6 @@ extlinks = { - 'ghc-ticket': ('https://gitlab.haskell.org/ghc/ghc/issues/%s', '#'), @@ -11,21 +11,21 @@ Index: ghc-8.10.7/docs/users_guide/ghc_config.py.in } libs_base_uri = '../libraries' -Index: ghc-8.10.7/libraries/Cabal/Cabal/doc/conf.py +Index: ghc-9.4.4/libraries/Cabal/doc/conf.py =================================================================== ---- ghc-8.10.7.orig/libraries/Cabal/Cabal/doc/conf.py -+++ ghc-8.10.7/libraries/Cabal/Cabal/doc/conf.py -@@ -24,12 +24,12 @@ master_doc = 'index' +--- ghc-9.4.4.orig/libraries/Cabal/doc/conf.py 2022-12-23 16:19:53.000000000 +0000 ++++ ghc-9.4.4/libraries/Cabal/doc/conf.py 2023-01-30 21:30:53.908929483 +0000 +@@ -28,12 +28,12 @@ master_doc = 'index' # extlinks -- see http://www.sphinx-doc.org/en/stable/ext/extlinks.html extlinks = { - 'issue': ('https://github.com/haskell/cabal/issues/%s', '#'), + 'issue': ('https://github.com/haskell/cabal/issues/%s', '#%s'), -- 'ghc-wiki': ('http://ghc.haskell.org/trac/ghc/wiki/%s', ''), -- 'ghc-ticket': ('http://ghc.haskell.org/trac/ghc/ticket/%s', 'GHC #'), -+ 'ghc-wiki': ('http://ghc.haskell.org/trac/ghc/wiki/%s', None), -+ 'ghc-ticket': ('http://ghc.haskell.org/trac/ghc/ticket/%s', 'GHC #%s'), +- 'ghc-wiki': ('https://gitlab.haskell.org/ghc/ghc/-/wikis/%s', ''), +- 'ghc-ticket': ('https://gitlab.haskell.org/ghc/ghc/-/issues/%s', 'GHC #'), ++ 'ghc-wiki': ('https://gitlab.haskell.org/ghc/ghc/-/wikis/%s', None), ++ 'ghc-ticket': ('https://gitlab.haskell.org/ghc/ghc/-/issues/%s', 'GHC #%s'), - 'hackage-pkg': ('http://hackage.haskell.org/package/%s', ''), + 'hackage-pkg': ('http://hackage.haskell.org/package/%s', None), diff --git a/ghc-8.0.2-Cabal-dynlibdir.patch b/ghc-8.0.2-Cabal-dynlibdir.patch index ae7cc51..214241c 100644 --- a/ghc-8.0.2-Cabal-dynlibdir.patch +++ b/ghc-8.0.2-Cabal-dynlibdir.patch @@ -1,7 +1,7 @@ -Index: ghc-8.10.0.20200123/libraries/Cabal/Cabal/Distribution/Simple/InstallDirs.hs +Index: ghc-8.10.0.20200123/libraries/Cabal/Cabal/src/Distribution/Simple/InstallDirs.hs =================================================================== ---- ghc-8.10.0.20200123.orig/libraries/Cabal/Cabal/Distribution/Simple/InstallDirs.hs -+++ ghc-8.10.0.20200123/libraries/Cabal/Cabal/Distribution/Simple/InstallDirs.hs +--- ghc-8.10.0.20200123.orig/libraries/Cabal/Cabal/src/Distribution/Simple/InstallDirs.hs ++++ ghc-8.10.0.20200123/libraries/Cabal/Cabal/src/Distribution/Simple/InstallDirs.hs @@ -207,7 +207,7 @@ defaultInstallDirs' False comp userInsta _other -> "$abi" "$libname", dynlibdir = "$libdir" case comp of diff --git a/ghc-8.10.7-src.tar.xz b/ghc-8.10.7-src.tar.xz deleted file mode 100644 index 0cb8bc8..0000000 --- a/ghc-8.10.7-src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e3eef6229ce9908dfe1ea41436befb0455fefb1932559e860ad4c606b0d03c9d -size 19932668 diff --git a/ghc-8.10.7-src.tar.xz.sig b/ghc-8.10.7-src.tar.xz.sig deleted file mode 100644 index b0404f75c5a6d6bf10f3cb6bd0fcf7e6671545af603bef3d9251770e8fa1330e..0000000000000000000000000000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 438 zcmV;n0ZIOe0kZ@E0SEvc79j+PwSUijwL49-zofBPhh+QWEg8fG0%0fLh5!l)5Lky~ z`{FGb#3$Jd0JYt-!0erFO3s^SO2z9=TP_MNmDA|c3V*8Fa3}UD_*QH*4!`Yp_PI^@#(uAwvufhWrKnSqECuJTRsAcG5w zS4V!1`3(3u6@M~K&=ZKvG`)ZABu}Ds078oQ5`31jd2eIFs32N1H{nzgn@deFR4=e( z*0<_elze)3wz`!Qn7gcI!UiEeVfSwI#Z{<-R&ub@D-^C+6!xW1$5-0N4wo`3%9dyc zS6hEBIq7J1C9cc~%t>jicP>WbTk;e+zG9lRwS}wM@Q7NcuEE$weD;7v}K+hnZ;0%NBpSrZ&$Wo|%s zWo&FMba`-PWG-WGZ2$@h5G~+MPM6zctye1$0Ht1tq8czEJCo&Uu?c>Md+pPsfoZT2 ztQ)iq60HqRrYXJvnqP6`ztAyN$B0Zd-F7u+`}4>Jo#+)Z(|>zQS=8OO7dH|_ka}>B zzNMa<^Ns%4{Np_)p=|d-+3xL7!<>fDHvdSX9TuNUl_loa3w@dM!b{HT&6Ee{CSh=< zz;=(?6^sodC;|m#=by+T+)k+dJrkLWU9Kvt!IDHBGbp|m; z`g({6a9G2QvI4$ZzY@v<8?--1aURPb_t7%iA3n@ug??S3omB+#iV@B=RX{%M=JNs)0gOQnO7|)iccvoX&U2Z|^E(-zV2%?L(TsC1hUrjgHfu6z!G^W4tlp4Kaird}{zRl41znm#304T(0Ogbx= z5I(qZDCX0!TyaqRO6)^CLKz)8CQ|RY2U~zWOfCS GHC.installExe verbosity lbi binPref buildPref progFix pkg_descr exe + GHCJS -> GHCJS.installExe verbosity lbi binPref buildPref progFix pkg_descr exe diff --git a/ghc-armv7-VFPv3D16--NEON.patch b/ghc-armv7-VFPv3D16--NEON.patch deleted file mode 100644 index bc1255b..0000000 --- a/ghc-armv7-VFPv3D16--NEON.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ghc-8.10.7/aclocal.m4 -+++ ghc-8.10.7/aclocal.m4 -@@ -408,7 +408,7 @@ - )], - [changequote(, )dnl - ARM_ISA=ARMv7 -- ARM_ISA_EXT="[VFPv3,NEON]" -+ ARM_ISA_EXT="[VFPv3D16]" - changequote([, ])dnl - ]) - ]) diff --git a/ghc-gen_contents_index-haddock-path.patch b/ghc-gen_contents_index-haddock-path.patch new file mode 100644 index 0000000..0d9afa6 --- /dev/null +++ b/ghc-gen_contents_index-haddock-path.patch @@ -0,0 +1,13 @@ +Index: ghc-9.4.4/libraries/gen_contents_index +=================================================================== +--- ghc-9.4.4.orig/libraries/gen_contents_index ++++ ghc-9.4.4/libraries/gen_contents_index +@@ -58,7 +58,7 @@ then + HADDOCK_ARGS="$HADDOCK_ARGS $HADDOCK_ARG" + done + else +- HADDOCK=../../../../../bin/haddock ++ HADDOCK=/usr/bin/haddock + # We don't want the GHC API to swamp the index + HADDOCK_FILES=`ls -1 */*.haddock | grep -v '/ghc\.haddock' | sort` + HADDOCK_ARGS="-p prologue.txt" diff --git a/ghc-hadrian-s390x-rts--qg.patch b/ghc-hadrian-s390x-rts--qg.patch new file mode 100644 index 0000000..91ebbe3 --- /dev/null +++ b/ghc-hadrian-s390x-rts--qg.patch @@ -0,0 +1,13 @@ +Index: ghc-9.4.4/hadrian/hadrian.cabal +=================================================================== +--- ghc-9.4.4.orig/hadrian/hadrian.cabal ++++ ghc-9.4.4/hadrian/hadrian.cabal +@@ -173,7 +173,7 @@ executable hadrian + -- waiting for external processes + -- * -qg: Don't use parallel GC as the synchronization + -- time tends to eat any benefit. +- "-with-rtsopts=-I0 -qg" ++ "-with-rtsopts=-I0" + -threaded + + if flag(selftest) diff --git a/ghc-pie.patch b/ghc-pie.patch index e9ca4ae..5a0b9a5 100644 --- a/ghc-pie.patch +++ b/ghc-pie.patch @@ -1,11 +1,11 @@ -Index: ghc-8.10.7/compiler/main/DynFlags.hs +Index: ghc-9.4.4/compiler/GHC/Driver/Session.hs =================================================================== ---- ghc-8.10.7.orig/compiler/main/DynFlags.hs -+++ ghc-8.10.7/compiler/main/DynFlags.hs -@@ -4659,6 +4659,7 @@ default_PIC platform = +--- ghc-9.4.4.orig/compiler/GHC/Driver/Session.hs ++++ ghc-9.4.4/compiler/GHC/Driver/Session.hs +@@ -3870,6 +3870,7 @@ default_PIC platform = + -- This requires PIC on AArch64, and ExternalDynamicRefs on Linux as on top -- of that. Subsequently we expect all code on aarch64/linux (and macOS) to -- be built with -fPIC. - -- See #15275, #18892 + (OSLinux, ArchX86_64) -> [Opt_PIC] (OSDarwin, ArchAArch64) -> [Opt_PIC] (OSLinux, ArchAArch64) -> [Opt_PIC, Opt_ExternalDynamicRefs] diff --git a/ghc-pkg.man b/ghc-pkg.man new file mode 100644 index 0000000..131240d --- /dev/null +++ b/ghc-pkg.man @@ -0,0 +1,228 @@ +.TH ghc-pkg 1 "2010-01-27" +.SH NAME +ghc-pkg \- GHC Haskell Cabal package manager +.SH SYNOPSIS +.B ghc-pkg +.I action +.RI [ OPTION ]... +.SH DESCRIPTION +A package is a library of Haskell modules known to the compiler. The +.B ghc-pkg +tool allows adding or removing them from a package database. By +default, the system-wide package database is modified, but +alternatively the user's local package database or another specified +file can be used. +.PP +To make a package available for +.BR ghc , +.B ghc-pkg +can be used to register it. Unregistering it removes it from the +database. Also, packages can be hidden, to make +.B ghc +ignore the package by default, without uninstalling it. Exposing a +package makes a hidden package available. Additionally, +.B ghc-pkg +has various commands to query the package database. +.PP +Where a package name is required, the package can be named in full +including the version number (e.g. +.BR network-1.0 ), +or without the version number. Naming a package without the version +number matches all versions of the package; the specified action will +be applied to all the matching packages. A package specifier that +matches all version of the package can also be written +.BR pkg-* , +to make it clearer that multiple packages are being matched. +.SH ACTIONS +.TP +\fBregister\fP \fIfilename\fP|\fB-\fP +Register the package using the specified installed package +description. +.TP +\fBupdate\fP \fIfilename\fP|\fB-\fP +Register the package, overwriting any other package with the same +name. +.TP +\fBunregister\fP \fIpkg-id\fP +Unregister the specified package. +.TP +\fBexpose\fP \fIpkg-id\fP +Expose the specified package. +.TP +\fBhide\fP \fIpkg-id\fP +Hide the specified package +.TP +\fBlist\fP \fR[\fIpkg\fR]...\fP +List registered packages in the global database, and also the user +database if +.B --user +is given. If a package name is given all the registered versions will +be listed in ascending order. Accepts the +.B --simple-output +flag. +.TP +.B dot +Generate a graph of the package dependencies in a form suitable for +input for the graphviz tools. For example, to generate a PDF of the +dependency graph: +.br +\fB dot \| tred \| dot -Tpdf >pkgs.pdf\fP +.TP +\fBfind-module\fP \fImodule\fP +List registered packages exposing module +.I module +in the global database, and also the user database if +.B --user +is given. All the registered versions will be listed in ascending +order. Accepts the +.B --simple-output +flag. +.TP +\fBlatest\fP \fIpkg-id\fP +Prints the highest registered version of a package. +.TP +.B check +Check the consistency of package dependencies and list broken +packages. Accepts the +.B --simple-output +flag. +.TP +\fBdescribe\fP \fIpkg\fP +Give the registered description for the +specified package. The description is returned in precisely the syntax +required by ghc-pkg register. +.TP +\fBfield\fP \fIpkg field\fP +Extract the specified field of the package description for the +specified package. Accepts comma-separated multiple fields. +.TP +.B dump +Dump the registered description for every package. This is like +.BR ghc-pkg\ describe\ '*' , +expect that it is intended to be used by tools that parse the results, +rather than humans. +.TP +.B recache +Regenerate the package database cache. This command should only be +necessary if you added a package to the database by dropping a file +into the database directory manyally. By default, the global DB is +recached; to recache a different DB use +.B --user +or +.B --package-conf +as appropriate. +.SH OPTIONS +When asked to modify a database +.RB ( register ,\ unregister ,\ update ,\ hide ,\ expose ,\ and\ also\ check ), +.B ghc-pkg +modifies the global database by +default. Specifying +.B --user +causes it to act on the user database, +or +.B --package-conf +can be used to act on another database +entirely. When multiple of these options are given, the rightmost +one is used as the database to act upon. +.PP +Commands that query the package database +.RB ( list ,\ latest ,\ describe ,\ field ) +operate on the list of databases specified by the flags +.BR --user ,\ --global , +and +.BR --package-conf . +If none of these flags are +given, the default is +.BR --global\ --user . +.TP +.B --user +Use the current user's package database. +.TP +.B --global +Use the global package database. +.TP +\fB-f\fP \fIFILE\fP, \fB--package-conf=\fIFILE\fP +Use the specified package config file. +.TP +.BI --global-conf= FILE +Location of the global package config. +.TP +.B --force +Ignore missing dependencies, directories, and libraries. +.TP +.B --force-files +Ignore missing directories and libraries only. +.TP +.BR -g ,\ --auto-ghc-libs +Automatically build libs for GHCi (with register). +.TP +.BR -? ,\ --help +Display a help message and exit. +.TP +.BR -V ,\ --version +Output version information and exit. +.TP +.B --simple-output +Print output in easy-to-parse format for some commands. +.TP +.B --names-only +Only print package names, not versions; can only be used with +.BR list\ --simple-output . +.TP +.B --ignore-case +Ignore case for substring matching. +.SH ENVIRONMENT VARIABLES +.TP +.B GHC_PACKAGE_PATH +The +.B GHC_PACKAGE_PATH +environment variable may be set to a +.BR : -separated +list of files containing package databases. This list of package +databases is used by +.B ghc +and +.BR ghc-pkg , +with earlier databases in the list overriding later ones. This order +was chosen to match the behaviour of the +.B PATH +environment variable; think of it as a list of package databases that +are searched left-to-right for packages. + +If +.B GHC_PACKAGE_PATH +ends in a separator, then the default user and system package +databases are appended, in that order. e.g. to augment the usual set +of packages with a database of your own, you could say: + +.br +\fB export GHC_PACKAGE_PATH=$HOME/.my-ghc-packages.conf:\fP +.br + +To check whether your +.B GHC_PACKAGE_PATH +setting is doing the right thing, +.B ghc-pkg list +will list all the databases in use, in the reverse order they are +searched. +.SH FILES +Both of these locations are changed for Debian. Upstream still keeps +these under +.IR /usr . +Some programs may refer to that, but look in +.I /var +instead. +.TP +.I /var/lib/ghc/package.conf +Global package.conf file. +.TP +.I /var/lib/ghc/package.conf.d/ +Directory for library specific package.conf files. These are added to +the global registry. +.SH "SEE ALSO" +.BR ghc (1), +.BR runghc (1), +.BR hugs (1). +.SH AUTHOR +This manual page was written by Kari Pahula , for the +Debian project (and may be used by others). diff --git a/ghc.changes b/ghc.changes index d77b3a8..d48de4c 100644 --- a/ghc.changes +++ b/ghc.changes @@ -1,122 +1,59 @@ ------------------------------------------------------------------- -Thu Jan 19 12:39:27 UTC 2023 - Guillaume GARDET +Fri Mar 17 11:09:29 UTC 2023 - Ondřej Súkup -- Do not require unversionned llvm since ghc needs a specific - llvm version. [boo#1207265] +- build with hadrian +- reintroduced profiling packages +- added man pages: ghc-pkg.man haddock.man runghc.man +- added 9_2_3-bootstrap-sources.tar.gz as hadrian deps +- refreshed patches: + * fix_extlinks.patch + * Disable-unboxed-arrays.patch + * ghc-8.0.2-Cabal-dynlibdir.patch + * ghc-pie.patch +- removed patches: + * ghc-armv7-VFPv3D16--NEON.patch + * buildpath-abi-stability.patch +- added patches: + * ghc-gen_contents_index-haddock-path.patch + * ghc-Cabal-install-PATH-warning.patch + * execstack.patch + * libatomic.patch + * riscv-tntc.patch + +------------------------------------------------------------------- +Tue Jan 31 09:37:15 UTC 2023 - Peter Simons + +- Update to GHC version 9.4.4. + + * %{buildroot}%{ghclibdir}/include is apparently no longer used by + the RTS package. Those files now live in /usr/lib64/ghc-9.4.4/rts/include. + + * find %{buildroot}%{ghc_html_libraries_dir} -name LICENSE -exec rm '{}' ';' + no longer works because the directory doesn't exist at the time + that command is run. + + * The user manual and Haddock documentation is installed into a + different location. For now, we just list the catchall + %{_docdir}/packages/ghc to accept anything. + + * The LICENSE file for Cabal-syntax lives at libraries/Cabal/Cabal-syntax + instead of the expected place libraries/Cabal-syntax. + + * The package system-cxx-std-lib has no LICENSE file. It's not + even a proper package, it's just a configuration file that lists + some compiler and linker flags. To work around the build error + that causes, we just copy some random LICENSE file into the + place where our build would expect it. ------------------------------------------------------------------- -Tue Jan 17 11:45:32 UTC 2023 - Peter Simons +Fri Jul 8 11:48:57 UTC 2022 - Andreas Schwab -- Apply "fix_extlinks.patch" to work around a bug in Sphinx 6.1.x - that broke our documentation build. Remove this patch once Sphinx - is fixed. This patch is a variant of the ghc-9.4.4 patch from - https://gitlab.haskell.org/ghc/ghc/-/issues/22766. Upstream's - https://github.com/sphinx-doc/sphinx/issues/11094 has further - details. [boo#1207214] +- execstack.patch: add missing stack note ------------------------------------------------------------------- -Mon Jun 27 17:04:51 UTC 2022 - Dirk Müller +Wed Feb 9 13:50:45 UTC 2022 - Peter Simons -- add ghc.keyring to have source validation enabled -- limit to use llvm12 for Factory as newer versions are not supported - -------------------------------------------------------------------- -Fri Apr 29 13:49:29 UTC 2022 - Martin Liška - -- Remove dependency on binutils-gold as the package will be removed - in the future. Gold linker is unmaintained by the upstream project. - -------------------------------------------------------------------- -Tue Mar 8 22:35:07 UTC 2022 - Dirk Müller - -- add ghc-armv7-VFPv3D16--NEON.patch to use vfpv3-d16 on armv7hl - -------------------------------------------------------------------- -Fri Sep 3 20:57:29 UTC 2021 - Ondřej Súkup - -- update to 8.10.7 -- drop 4134.patch and refresh ghc-pie.patch - * portabilit yfixes - * Export some RTS symbols required for static builds of GHC - * Fix LLVM version checking logic so it no longer complains - about supported LLVM versions. - * Fix some RTS crashes on Darwin due to mixing up the closure - sizes of the aarch64 and x86-64 backends. - * Fix a crash on the non-moving GC due to incorrect logic - for calculating the header size for array write barries - * Fix a bug in base leading to a high likelihood of space - leaks when using lazy bytestrings - * Fix some timer races in the RTS possibly manifesting in #18033 and #20132 - * Fix a number of bugs affecting the RTS m32 allocator - * Fix a bug where code may be unloaded prematurely - when using the parallel garbage collector - * Fix a bug where the linker may during shutdown unload code before - libraries’ atexit handlers have a chance to run - * Improve code layout by distiguishing conditional and unconditional branches - * Add hs-boot file support for -ddump-minimal-imports - * Ensure hs-boot files are built before source files in GHCs -M mode - * Fix a long standing GHC API bug affecting clients like HLS where - async exceptions used to cancel threads during typechecking would be - caught by the Template Haskell evaluator and reported as compile errors - * Improve error messages when looking up packages fails - * Fix a number of quirks in GC accounting - * Fix a code generation bug which could result in entry of unlifted - objects in some programs using unboxed sums - * Ensure that POSIX signals are not delivered to the ticker thread - when using the pthread itimer implementation. - * Fix a specialiser bug which could result in the construction - of recursive dictionaries in some programs - * Bump containers to 0.6.4.1 - * Do not treat -Winferred-safe-imports warnings as errors. - * Fix a bug where typechecker plugins could be run with - an inconsistent typechecker environment - * Fix a simplifier bug which lead to an exponential - blow up and excessive memory usage in certain cases - -------------------------------------------------------------------- -Fri Jun 25 10:02:25 UTC 2021 - Ondřej Súkup - -- add 4134.patch to fix build with Sphinx4 - -------------------------------------------------------------------- -Mon Mar 15 20:33:24 UTC 2021 - Dirk Müller - -- always build against llvm9, also on SLE15 (suse_version == 1500) - otherwise the resulting build is not working (llvm is 7.x there) (bsc#1181571) - -------------------------------------------------------------------- -Tue Feb 9 01:29:46 UTC 2021 - Ondřej Súkup - -- update to 8.10.4 - * Fix a crash caused by inappropriate garbage of heap-allocated data - reachable from foreign exports - -------------------------------------------------------------------- -Sun Dec 20 00:29:27 UTC 2020 - Ondřej Súkup - -- update to 8.10.3 - * More robust support for architectures with weak memory ordering - guarantees (e.g. modern ARM hardware). - * GHC can now split dynamic objects to accomodate macOS' RPATH size - limitation when building large projects (#14444) - * Several correctness bugs in the new low-latency garbage collector - * Many, many other bug-fixes)) - -------------------------------------------------------------------- -Thu Dec 17 12:20:00 UTC 2020 - Ondřej Súkup - -- disable %{ix86} build - -------------------------------------------------------------------- -Wed Oct 14 12:20:00 UTC 2020 - Ondřej Súkup - -- force multiversion for subpackages - -------------------------------------------------------------------- -Sat Oct 3 15:58:52 UTC 2020 - Ondřej Súkup - -- add --enable-unregistered to configure phase on unregistered - architectures +- add environ.patch to fix build errors with recent gcc ------------------------------------------------------------------- Sun Aug 9 11:27:32 UTC 2020 - Ondřej Súkup @@ -138,7 +75,7 @@ Sun May 31 18:47:18 UTC 2020 - Ondřej Súkup - cleanup specfile from Leap 42 and older remrants - drop fix-unregisterised-v8.4-8.6.patch -- drop fix-build-using-unregisterized-v8.4.patch +- drop fix-build-using-unregisterized-v8.4.patch ------------------------------------------------------------------- Thu May 7 07:44:47 UTC 2020 - Peter Simons diff --git a/ghc.spec b/ghc.spec index e5404b1..1d6bc7b 100644 --- a/ghc.spec +++ b/ghc.spec @@ -1,7 +1,7 @@ # # spec file for package ghc # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,36 +16,114 @@ # -%ifnarch %{arm} s390x +%define full_version 9.4.4 +%define short_version 9.4.4 + +%ifnarch s390x %define with_libnuma 1 %else %define with_libnuma 0 %endif - -%global unregisterised_archs s390 s390x riscv64 +%ifarch riscv64 +%global unregisterised_archs riscv64 +%endif # Keep in sync with ghc-bootstrap.spec -%if 0%{suse_version} > 1550 -%global llvm_major 12 +%if 0%{?suse_version} > 1550 +%global llvm_major 14 %else %global llvm_major 9 %endif -%define full_version 8.10.7 + +# conditionals + +# disable prof, docs, perf build +# bcond_with for production builds: disable quick build +%bcond_with quickbuild + +# make sure ghc libraries' ABI hashes unchanged (ghcX.Y not supported yet) +%bcond_with abicheck + +# bcond_without for production builds: use Hadrian buildsystem +%bcond_without hadrian + +# bcond_without for production builds: build hadrian +%bcond_without build_hadrian + +# bcond_without for production builds: enable debuginfo +%bcond_without ghc_debuginfo + +%if %{without ghc_debuginfo} +%undefine _enable_debug_packages +%endif + +# build profiling libraries +# build haddock +# perf production build (disable for quick build) +%if %{with quickbuild} +%undefine with_ghc_prof +%undefine with_haddock +%bcond_with perf_build +%else +%bcond_without ghc_prof +%bcond_without haddock +%bcond_without manual +%bcond_without perf_build +%endif + +%if %{without hadrian} +# locked together since disabling haddock causes no manuals built +# and disabling haddock still created index.html +# https://gitlab.haskell.org/ghc/ghc/-/issues/15190 +%{?with_haddock:%bcond_without manual} +%endif + +%global ghc_llvm_archs s390x +%global ghc_unregisterized_arches riscv64 + +%global base_ver 4.17.0.0 +%global ghc_compact_ver 0.1.0.0 +%global hpc_ver 0.6.1.0 Name: ghc -Version: 8.10.7 +Version: %{short_version} Release: 0 +Summary: The Glorious Glasgow Haskell Compiler +License: BSD-3-Clause URL: https://www.haskell.org/ghc/ Source: https://downloads.haskell.org/~ghc/%{full_version}/ghc-%{version}-src.tar.xz Source1: https://downloads.haskell.org/~ghc/%{full_version}/ghc-%{version}-src.tar.xz.sig Source2: ghc-rpmlintrc +Source3: 9_2_3-bootstrap-sources.tar.gz +Source5: ghc-pkg.man +Source6: haddock.man +Source7: runghc.man Source9: ghc.keyring -Summary: The Glorious Glasgow Haskell Compiler -License: BSD-3-Clause -Group: Development/Languages/Other -ExclusiveArch: aarch64 %{arm} x86_64 ppc64 ppc64le riscv64 s390x +Patch1: ghc-gen_contents_index-haddock-path.patch +# for unregisterized (s390x) +# https://ghc.haskell.org/trac/ghc/ticket/15689 +Patch2: ghc-Cabal-install-PATH-warning.patch +# PATCH-FIX-UPSTREAM Disable-unboxed-arrays.patch ptrommler@icloud.com -- Do not use unboxed arrays on big-endian platforms. See Haskell Trac #15411. +Patch3: Disable-unboxed-arrays.patch +# https://phabricator.haskell.org/rGHC4eebc8016f68719e1ccdf460754a97d1f4d6ef05 +# Patch6: ghc-8.6.3-sphinx-1.8.patch +# PATCH-FIX-UPSTREAM execstack.patch -- RTS: Add stack marker to StgCRunAsm.S +Patch7: execstack.patch +# Work around a bug in Sphinx 6.1.x to fix the documentation build. Remove this patch ASAP. +Patch8: fix_extlinks.patch +# unregisterized +# PATCH-FIX-UPSTREAM ghc-pie.patch - set linux as default PIE platform +Patch35: ghc-pie.patch +# PATCH-FIX-OPENSUSE ghc-8.0.2-Cabal-dynlibdir.patch -- Fix shared library directory location. +Patch100: ghc-8.0.2-Cabal-dynlibdir.patch +Patch120: libatomic.patch +Patch130: riscv-tntc.patch +Patch200: ghc-hadrian-s390x-rts--qg.patch BuildRequires: binutils-devel -BuildRequires: gcc -BuildRequires: ghc-bootstrap >= 8.6 +BuildRequires: clang%{llvm_major} +BuildRequires: gcc-PIE +BuildRequires: gcc-c++ +BuildRequires: ghc-bootstrap >= 9.0 +BuildRequires: ghc-bootstrap-helpers >= 1.3 BuildRequires: ghc-rpm-macros-extra BuildRequires: glibc-devel BuildRequires: gmp-devel @@ -53,40 +131,42 @@ BuildRequires: libdw-devel BuildRequires: libelf-devel BuildRequires: libffi-devel BuildRequires: libtool -BuildRequires: memory-constraints -BuildRequires: ncurses-devel -BuildRequires: pkg-config -BuildRequires: xz -%ifarch aarch64 %{arm} -BuildRequires: clang%{llvm_major} BuildRequires: llvm%{llvm_major} BuildRequires: llvm%{llvm_major}-devel +BuildRequires: memory-constraints +BuildRequires: ncurses-devel +BuildRequires: pkgconfig +BuildRequires: python3 +BuildRequires: xz +Requires: %{name}-compiler = %{version}-%{release} +Requires: %{name}-devel = %{version}-%{release} +Requires: %{name}-ghc-boot-devel = %{version}-%{release} +Requires: %{name}-ghc-compact-devel = %{ghc_compact_ver}-%{release} +Requires: %{name}-ghc-devel = %{version}-%{release} +Requires: %{name}-ghc-heap-devel = %{version}-%{release} +Requires: %{name}-ghci-devel = %{version}-%{release} +Requires: %{name}-hpc-devel = %{hpc_ver}-%{release} +Requires: %{name}-libiserv-devel = %{version}-%{release} +Recommends: %{name}-compiler-default = %{version}-%{release} +%if %{without ghc_debuginfo} +%undefine _enable_debug_packages %endif -%if %{undefined without_manual} +%if %{with manual} BuildRequires: python3-Sphinx %endif -%if %with_libnuma +%if %{with_libnuma} BuildRequires: libnuma-devel %endif -BuildRequires: ghc-bootstrap-helpers - -PreReq: update-alternatives - -Requires: ghc-compiler = %{version}-%{release} -Requires: ghc-ghc-devel = %{version}-%{release} -Requires: ghc-libraries = %{version}-%{release} -# Work around a bug in Sphinx 6.1.x to fix the documentation build. Remove this patch ASAP. -Patch1: fix_extlinks.patch -# PATCH-FIX-OPENSUSE: use vfpv3-d16 and disable NEON -Patch2: ghc-armv7-VFPv3D16--NEON.patch -# PATCH-FIX-UPSTREAM Disable-unboxed-arrays.patch ptrommler@icloud.com -- Do not use unboxed arrays on big-endian platforms. See Haskell Trac #15411. -Patch3: Disable-unboxed-arrays.patch -# PATCH-FIX-UPSTREAM ghc-pie.patch - set linux as default PIE platform -Patch35: ghc-pie.patch -# PATCH-FIX-OPENSUSE ghc-8.0.2-Cabal-dynlibdir.patch -- Fix shared library directory location. -Patch100: ghc-8.0.2-Cabal-dynlibdir.patch -# PATCH-FIX-UPSTREAM buildpath-abi-stability.patch -- debian patch for more stable abi-1 -Patch110: buildpath-abi-stability.patch +%if %{with haddock} +Suggests: %{name}-doc = %{version}-%{release} +Suggests: %{name}-doc-index = %{version}-%{release} +%endif +%if %{with manual} +Suggests: %{name}-manual = %{version}-%{release} +%endif +%if %{with ghc_prof} +Suggests: %{name}-prof = %{version}-%{release} +%endif %description Haskell is the standard purely functional programming language; the @@ -107,20 +187,13 @@ Haskell home page at . %package compiler Summary: GHC compiler and utilities -Group: Development/Languages/Other +License: BSD-3-Clause Requires: gcc -Requires: ghc-base-devel -Requires(post): update-alternatives -Requires(postun):update-alternatives -%ifarch aarch64 %{arm} -Requires: binutils-gold -%endif -%ifarch aarch64 %{arm} +Requires: ghc-base-devel = %{base_ver}-%{release} +Requires: %{name}-filesystem = %{version}-%{release} +%ifarch riscv64 s390x Requires: clang%{llvm_major} Requires: llvm%{llvm_major} -%else -Suggests: clang%{llvm_major} -Suggests: llvm%{llvm_major} %endif %description compiler @@ -129,133 +202,173 @@ This package contains the GHC compiler, tools and utilities. The GHC libraries are provided by ghc-devel. To install all of GHC install package ghc. + +%if %{with haddock} || (%{with hadrian} && %{with manual}) +%package doc +Summary: Haskell library documentation meta package +License: BSD-3-Clause + +%description doc +Installing this package causes %{name}-*-doc packages corresponding to +%{name}-*-devel packages to be automatically installed too. + +%package doc-index +Summary: GHC library documentation indexing +License: BSD-3-Clause +Requires: %{name}-compiler = %{version}-%{release} +BuildArch: noarch + +%description doc-index +The package enables re-indexing of installed library documention. + +%package filesystem +Summary: Shared directories for Haskell documentation +License: BSD-3-Clause +BuildArch: noarch + +%description filesystem +This package provides some common directories used for +Haskell libraries documentation. +%endif + + +%if %{with manual} +%package manual +Summary: GHC manual +License: BSD-3-Clause +Requires: %{name}-filesystem = %{version}-%{release} +BuildArch: noarch + +%description manual +This package provides the User Guide and Haddock manual. +%endif + + %global ghc_version_override %{version} - %global ghc_pkg_c_deps ghc-compiler = %{ghc_version_override}-%{release} - -%if %with_libnuma +%global version %{ghc_version_override} +%if %{with_libnuma} %define libnuma_dep ,libnuma-devel %else %define libnuma_dep %{nil} %endif - -%if %{defined ghclibdir} #!ForceMultiversion -%ghc_lib_subpackage -d Cabal-3.2.1.0 +%ghc_lib_subpackage -d Cabal-3.8.1.0 +%ghc_lib_subpackage -d Cabal-syntax-3.8.1.0 %ghc_lib_subpackage -d array-0.5.4.0 -%ghc_lib_subpackage -d -c gmp-devel,libffi-devel,libdw-devel,libelf-devel%{libnuma_dep} base-4.14.3.0 -%ghc_lib_subpackage -d binary-0.8.8.0 -%ghc_lib_subpackage -d bytestring-0.10.12.0 -%ghc_lib_subpackage -d containers-0.6.5.1 -%ghc_lib_subpackage -d deepseq-1.4.4.0 -%ghc_lib_subpackage -d directory-1.3.6.0 -%ghc_lib_subpackage -d exceptions-0.10.4 -%ghc_lib_subpackage -d filepath-1.4.2.1 +%ghc_lib_subpackage -d -c gmp-devel,libffi-devel,libdw-devel,libelf-devel%{libnuma_dep} base-4.17.0.0 +%ghc_lib_subpackage -d binary-0.8.9.1 +%ghc_lib_subpackage -d bytestring-0.11.3.1 +%ghc_lib_subpackage -d containers-0.6.6 +%ghc_lib_subpackage -d deepseq-1.4.8.0 +%ghc_lib_subpackage -d directory-1.3.7.1 +%ghc_lib_subpackage -d exceptions-0.10.5 +%ghc_lib_subpackage -d filepath-1.4.2.2 %ghc_lib_subpackage -d -x ghc-%{ghc_version_override} -%ghc_lib_subpackage -d ghc-boot-%{ghc_version_override} +%ghc_lib_subpackage -d -x ghc-boot-%{ghc_version_override} %ghc_lib_subpackage -d ghc-boot-th-%{ghc_version_override} -%ghc_lib_subpackage -d ghc-compact-0.1.0.0 -%ghc_lib_subpackage -d ghc-heap-%{ghc_version_override} +%ghc_lib_subpackage -d -x ghc-compact-0.1.0.0 +%ghc_lib_subpackage -d -x ghc-heap-%{ghc_version_override} %ghc_lib_subpackage -d -x ghci-%{ghc_version_override} %ghc_lib_subpackage -d haskeline-0.8.2 -%ghc_lib_subpackage -d hpc-0.6.1.0 -%ghc_lib_subpackage -d libiserv-%{ghc_version_override} +%ghc_lib_subpackage -d -x hpc-0.6.1.0 +%ghc_lib_subpackage -d -x libiserv-%{ghc_version_override} %ghc_lib_subpackage -d mtl-2.2.2 -%ghc_lib_subpackage -d parsec-3.1.14.0 +%ghc_lib_subpackage -d parsec-3.1.15.0 %ghc_lib_subpackage -d pretty-1.1.3.6 -%ghc_lib_subpackage -d process-1.6.13.2 -%ghc_lib_subpackage -d stm-2.5.0.1 -%ghc_lib_subpackage -d template-haskell-2.16.0.0 -%ghc_lib_subpackage -d -c ncurses-devel terminfo-0.4.1.4 -%ghc_lib_subpackage -d text-1.2.4.1 -%ghc_lib_subpackage -d time-1.9.3 +%ghc_lib_subpackage -d process-1.6.16.0 +%ghc_lib_subpackage -d stm-2.5.1.0 +%ghc_lib_subpackage -d template-haskell-2.19.0.0 +%ghc_lib_subpackage -d -c ncurses-devel terminfo-0.4.1.5 +%ghc_lib_subpackage -d text-2.0.1 +%ghc_lib_subpackage -d time-1.12.2 %ghc_lib_subpackage -d transformers-0.5.6.2 -%ghc_lib_subpackage -d unix-2.7.2.2 +%ghc_lib_subpackage -d unix-2.7.3 %ghc_lib_subpackage -d xhtml-3000.2.2.1 -%endif %global version %{ghc_version_override} -%package libraries +%package devel +%{?ghc_packages_list:Requires: %(echo %{ghc_packages_list} | sed -e "s/\([^ ]*\)-\([^ ]*\)/%{name}-\1-devel = \2-%{release},/g")} Summary: GHC development libraries meta package -Group: Development/Libraries/Other Requires: ghc-compiler = %{version}-%{release} -Obsoletes: ghc-devel < %{version}-%{release} -Provides: ghc-devel = %{version}-%{release} -Obsoletes: ghc-prof < %{version}-%{release} -Provides: ghc-prof = %{version}-%{release} -%{?ghc_packages_list:Requires: %(echo %{ghc_packages_list} | sed -e "s/\([^ ]*\)-\([^ ]*\)/ghc-\1-devel = \2-%{release},/g")} +Obsoletes: ghc-libraries < %{version}-%{release} +Provides: ghc-libraries = %{version}-%{release} -%description libraries +%description devel This is a meta-package for all the development library packages in GHC except the ghc library, which is installed by the toplevel ghc metapackage. +%if %{with ghc_prof} +%package prof +Summary: GHC profiling libraries meta package +License: BSD-3-Clause +Requires: %{name}-compiler = %{version}-%{release} + +%description prof +Installing this package causes %{name}-*-prof packages corresponding to +%{name}-*-devel packages to be automatically installed too. +%endif + %prep %setup -q %patch1 -p1 %patch2 -p1 +#%%patch6 -p1 +%patch7 -p1 +%patch8 -p1 %ifarch ppc64 s390 s390x %patch3 -p1 %endif %patch35 -p1 -%patch100 -p1 -%patch110 -p1 +#%%patch100 -p1 +%patch120 -p1 +# %patch130 -p1 +%ifarch ppc64 ppc64le s390x riscv64 +%patch200 -p1 +%endif + +rm libffi-tarballs/libffi-*.tar.gz %build -cat > mk/build.mk <> mk/build.mk -# override some settings -cat >> mk/build.mk << EOF -GhcLibWays = v %{!?ghc_without_shared:dyn} %{!?without_prof:p} -%if %{defined ghc_without_shared} -DYNAMIC_BY_DEFAULT = NO -DYNAMIC_GHC_PROGRAMS = NO -%endif -%ifarch %{unregisterised_archs} -GhcUnregisterised = YES -GhcWithNativeCodeGen = NO -SRC_HC_OPTS = -O -H64m -GhcStage1HcOpts = -O -GhcStage2HcOpts = -O -GhcHcOpts = -Rghc-timing -GhcLibHcOpts = -O -SRC_HC_OPTS += -optc-fno-builtin -optc-Wno-return-type -SRC_CC_OPTS += -fno-builtin -Wno-return-type -%endif -%if %{defined without_haddock} -HADDOCK_DOCS = NO -%endif -BUILD_SPHINX_PS = NO -%if %{defined without_manual} -BUILD_SPHINX_HTML = NO -BUILD_SPHINX_PDF = NO -%endif -%if %{defined without_hscolour} -HSCOLOUR_SRCS = NO -%endif -EOF -export CFLAGS="${CFLAGS:-%optflags}" ./configure --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} \ --bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} \ --datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} \ --libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} \ --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} \ -%ifarch %{unregisterised_archs} + --docdir=%{_docdir}/%{name}-%{version} \ + --with-system-libffi \ +%ifarch %{ghc_unregisterized_arches} --enable-unregisterised \ %endif - --with-system-libffi +%{nil} + +%undefine _ghcdynlibdir + + +%ifarch %{ghc_llvm_archs} +%global hadrian_llvm +llvm +%endif +%define hadrian_docs %{!?with_haddock:--docs=no-haddocks} %{!?with_manual:--docs=no-sphinx}%{?with_manual:--docs=no-sphinx-pdfs --docs=no-sphinx-man} + %if 0%{?suse_version} >= 1500 -%ifarch %{unregisterised_archs} +%ifarch %{unregisterised_archs} riscv64 %if 0%{?qemu_user_space_build} %limit_build -m 15000 %else @@ -264,179 +377,340 @@ export CFLAGS="${CFLAGS:-%optflags}" %else %limit_build -m 2000 %endif -make %{?_smp_mflags} +%{hadrian} %{?_smp_mflags} --flavour=%{?with_quickbuild:quick+no_profiled_libs}%{!?with_quickbuild:perf%{!?with_ghc_prof:+no_profiled_libs}}%{?hadrian_llvm} %{hadrian_docs} binary-dist-dir %else -make -j 2 +%{hadrian} -j1 --flavour=%{?with_quickbuild:quick+no_profiled_libs}%{!?with_quickbuild:perf%{!?with_ghc_prof:+no_profiled_libs}}%{?hadrian_llvm} %{hadrian_docs} binary-dist-dir %endif -%install -%makeinstall +%install + +( +cd _build/bindist/ghc-%{version}-* +./configure --prefix=%{buildroot}%{ghclibdir} --bindir=%{buildroot}%{_bindir} --libdir=%{buildroot}%{_libdir} --mandir=%{buildroot}%{_mandir} --docdir=%{buildroot}%{_docdir}/%{name}-%{version} +make install +) +mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d +echo "%{ghclibplatform}" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}.conf +# avoid 'E: binary-or-shlib-defines-rpath' +for i in $(find %{buildroot} -type f -executable -exec sh -c "file {} | grep -q 'dynamically linked'" \; -print); do + chrpath -d $i +done + + + +# containers src moved to a subdir +cp -p libraries/containers/containers/LICENSE libraries/containers/LICENSE +# hack for Cabal-syntax/LICENSE +mkdir -p libraries/Cabal-syntax +cp -p libraries/Cabal/Cabal-syntax/LICENSE libraries/Cabal-syntax + +rm -f %{name}-*.files + +# FIXME replace with ghc_subpackages_list for i in %{ghc_packages_list}; do name=$(echo $i | sed -e "s/\(.*\)-.*/\1/") ver=$(echo $i | sed -e "s/.*-\(.*\)/\1/") %ghc_gen_filelists $name $ver -# TODO: containers have license in $name/$name -#echo "%%doc libraries/$name/LICENSE" >> ghc-$name.files +echo "%%license libraries/$name/LICENSE" >> %{name}-$name.files done -# ghc-base should own ghclibdir -echo "%dir %{ghclibdir}" >> ghc-base.files +echo "%%dir %{ghclibdir}" >> %{name}-base%{?_ghcdynlibdir:-devel}.files %ghc_gen_filelists ghc %{ghc_version_override} +%ghc_gen_filelists ghc-boot %{ghc_version_override} +%ghc_gen_filelists ghc-compact %{ghc_compact_ver} +%ghc_gen_filelists ghc-heap %{ghc_version_override} %ghc_gen_filelists ghci %{ghc_version_override} -%ghc_gen_filelists ghc-prim 0.6.1 -%ghc_gen_filelists integer-gmp 1.0.3.0 +%ghc_gen_filelists hpc %{hpc_ver} +%ghc_gen_filelists libiserv %{ghc_version_override} + +%ghc_gen_filelists ghc-bignum 1.3 +%ghc_gen_filelists ghc-prim 0.9.0 +%ghc_gen_filelists integer-gmp 1.1 +%ghc_gen_filelists rts 1.0.2 %define merge_filelist()\ -cat ghc-%1.files >> ghc-%2.files\ -cat ghc-%1-devel.files >> ghc-%2-devel.files\ -cp -p libraries/%1/LICENSE libraries/LICENSE.%1\ -echo "%doc libraries/LICENSE.%1" >> ghc-%2.files +cat %{name}-%{1}.files >> %{name}-%{2}.files\ +cat %{name}-%{1}-devel.files >> %{name}-%{2}-devel.files\ +%if %{with ghc_prof}\ +cat %{name}-%{1}-doc.files >> %{name}-%{2}-doc.files\ +cat %{name}-%{1}-prof.files >> %{name}-%{2}-prof.files\ +%endif\ +if [ "%{1}" != "rts" ]; then\ +cp -p libraries/%{1}/LICENSE libraries/LICENSE.%{1}\ +echo "%%license libraries/LICENSE.%{1}" >> %{name}-%{2}.files\ +fi\ +%{nil} -%merge_filelist integer-gmp base +%merge_filelist ghc-bignum base %merge_filelist ghc-prim base +%merge_filelist integer-gmp base +%merge_filelist rts base -%if %{undefined ghc_without_shared} -echo %%dir %{ghclibdir}/rts >> ghc-base.files -ls %{buildroot}%{ghclibdir}/rts/libHS*.so >> ghc-base.files -sed -i -e "s|^%{buildroot}||g" ghc-base.files -%endif -echo %%dir %{ghclibdir}/rts >> ghc-base-devel.files -ls -d %{buildroot}%{ghclibdir}/rts/libHS*.a %{buildroot}%{ghclibdir}/package.conf.d/rts.conf %{buildroot}%{ghclibdir}/include >> ghc-base-devel.files -sed -i -e "s|^%{buildroot}||g" ghc-base-devel.files - -# these are handled as alternatives -mkdir -p %{buildroot}%{_sysconfdir}/alternatives -for i in hsc2hs runhaskell; do - if [ -x %{buildroot}%{_bindir}/$i-ghc ]; then - rm %{buildroot}%{_bindir}/$i - else - mv %{buildroot}%{_bindir}/$i{,-ghc} - fi - ln -s -f %{_sysconfdir}/alternatives/$i %{buildroot}%{_bindir}/$i - touch %{buildroot}%{_sysconfdir}/alternatives/$i +# add rts libs +%if %{with hadrian} +for i in %{buildroot}%{ghclibplatform}/libHSrts*ghc%{ghc_version}.so; do +echo $i >> %{name}-base.files done +echo "%{_sysconfdir}/ld.so.conf.d/%{name}.conf" >> %{name}-base.files +%else +%if %{defined _ghcdynlibdir} +echo "%{ghclibdir}/rts" >> %{name}-base-devel.files +%else +echo "%%dir %{ghclibdir}/rts" >> %{name}-base.files +ls -d %{buildroot}%{ghclibdir}/rts/lib*.a >> %{name}-base-devel.files +%endif +ls %{buildroot}%{?_ghcdynlibdir}%{!?_ghcdynlibdir:%{ghclibdir}/rts}/libHSrts*.so >> %{name}-base.files +%if %{defined _ghcdynlibdir} +sed -i -e 's!^library-dirs: %{ghclibdir}/rts!&\ndynamic-library-dirs: %{_libdir}!' %{buildroot}%{ghclibdir}/package.conf.d/rts.conf +%endif +ls -d %{buildroot}%{ghclibdir}/package.conf.d/rts.conf >> %{name}-base-devel.files +%endif -find %{buildroot}%{ghclibdocdir} -name LICENSE -exec rm '{}' ';' +if [ -f %{buildroot}%{ghcliblib}/package.conf.d/system-cxx-std-lib-1.0.conf ]; then +ls -d %{buildroot}%{ghcliblib}/package.conf.d/system-cxx-std-lib-1.0.conf >> %{name}-base-devel.files +fi + +%if %{with ghc_prof} +ls %{buildroot}%{ghclibdir}/bin/ghc-iserv-prof* >> %{name}-base-prof.files +%if %{with hadrian} +ls %{buildroot}%{ghclibdir}/lib/bin/ghc-iserv-prof >> %{name}-base-prof.files +echo "%%dir %{ghcliblib}/bin" +%endif +%endif + +sed -i -e "s|^%{buildroot}||g" %{name}-base*.files +%if %{with hadrian} +sed -i -e "s|%{buildroot}||g" %{buildroot}%{_bindir}/* +%endif + +%if %{with haddock} && %{without hadrian} +# generate initial lib doc index +cd libraries +sh %{gen_contents_index} --intree --verbose +cd .. +%endif + +%if %{with hadrian} +%if %{with haddock} +rm %{buildroot}%{_docdir}/ghc-%{version}/archives/libraries.html.tar.xz +%endif +%if %{with manual} +rm %{buildroot}%{_docdir}/ghc-%{version}/archives/Haddock.html.tar.xz +rm %{buildroot}%{_docdir}/ghc-%{version}/archives/users_guide.html.tar.xz +%endif +%endif + +# we package the library license files separately +%if %{without hadrian} +find %{buildroot}%{ghc_html_libraries_dir} -name LICENSE -exec rm '{}' ';' +%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 %{without hadrian} +for i in hp2ps hpc hsc2hs runhaskell; do + mv %{buildroot}%{_bindir}/$i{,-%{version}} + ln -s $i-%{version} %{buildroot}%{_bindir}/$i +done +%endif + +%if %{with hadrian} +rm %{buildroot}%{ghclibdir}/lib/package.conf.d/.stamp +rm %{buildroot}%{ghclibdir}/lib/package.conf.d/*.conf.copy + +( +cd %{buildroot}%{ghclibdir}/lib/bin +for i in *; do +if [ -f %{buildroot}%{ghclibdir}/bin/$i ]; then +ln -sf ../../bin/$i +fi +done +) +%endif %check # Actually, I took this from Jens Petersen's Fedora package # stolen from ghc6/debian/rules: +#Do some very simple tests that the compiler actually works +export LANG=C.utf8 +%if %{with hadrian} +export LD_LIBRARY_PATH=%{buildroot}%{ghclibplatform}: +GHC=%{buildroot}%{ghclibdir}/bin/ghc +%else +GHC=inplace/bin/ghc-stage2 +%endif # Do some very simple tests that the compiler actually works rm -rf testghc mkdir testghc echo 'main = putStrLn "Foo"' > testghc/foo.hs -inplace/bin/ghc-stage2 testghc/foo.hs -o testghc/foo -[ "$(testghc/foo)" = "Foo" ] -# doesn't seem to work inplace: -#[ "$(inplace/bin/runghc testghc/foo.hs)" = "Foo" ] -rm testghc/* -echo 'main = putStrLn "Foo"' > testghc/foo.hs -inplace/bin/ghc-stage2 testghc/foo.hs -o testghc/foo -O2 +$GHC testghc/foo.hs -o testghc/foo [ "$(testghc/foo)" = "Foo" ] rm testghc/* -%if %{undefined ghc_without_shared} echo 'main = putStrLn "Foo"' > testghc/foo.hs -#inplace/bin/ghc-stage2 testghc/foo.hs -o testghc/foo -dynamic -#[ "$(testghc/foo)" = "Foo" ] +$GHC testghc/foo.hs -o testghc/foo -O2 +[ "$(testghc/foo)" = "Foo" ] +rm testghc/* +echo 'main = putStrLn "Foo"' > testghc/foo.hs +$GHC testghc/foo.hs -o testghc/foo -dynamic +[ "$(testghc/foo)" = "Foo" ] rm testghc/* -%endif -%post compiler -# Alas, GHC, Hugs and nhc all come with different set of tools in addition to -# a runFOO: -# -# * GHC: hsc2hs -# * Hugs: hsc2hs, cpphs -# * nhc: cpphs -# -# Therefore it is currently not possible to use --slave below to form link -# groups under a single name 'runhaskell'. Either these tools should be -# disentangled from the Haskell implementations or all implementations should -# have the same set of tools. *sigh* -%{_sbindir}/update-alternatives --install %{_bindir}/runhaskell runhaskell %{_bindir}/runghc 500 -%{_sbindir}/update-alternatives --install %{_bindir}/hsc2hs hsc2hs %{_bindir}/hsc2hs-ghc 500 +$GHC --info -%preun compiler -if test "$1" = 0; then - %{_sbindir}/update-alternatives --remove runhaskell %{_bindir}/runghc - %{_sbindir}/update-alternatives --remove hsc2hs %{_bindir}/hsc2hs-ghc -fi + +%post base -p /sbin/ldconfig +%postun base -p /sbin/ldconfig + +%transfiletriggerin compiler -- %{ghcliblib}/package.conf.d +%ghc_pkg_recache +%end + +%transfiletriggerpostun compiler -- %{ghcliblib}/package.conf.d +%ghc_pkg_recache +%end %files %license LICENSE +%dir %{ghcliblib} +%dir %{ghclibdir} +%dir %{ghcliblib}/%{ghcplatform} %files compiler %license LICENSE -%{_bindir}/ghc +%doc README.md %{_bindir}/ghc-%{version} -%{_bindir}/ghc-pkg %{_bindir}/ghc-pkg-%{version} -%{_bindir}/ghci %{_bindir}/ghci-%{version} +%{_bindir}/hp2ps-%{?with_hadrian:ghc-}%{version} +%{_bindir}/hpc-%{?with_hadrian:ghc-}%{version} +%{_bindir}/hsc2hs-%{?with_hadrian:ghc-}%{version} +%{_bindir}/runghc-%{version} +%{_bindir}/runhaskell-%{version} +%{_bindir}/ghc +%{_bindir}/ghc-pkg +%{_bindir}/ghci +%if %{with hadrian} || %{with haddock} +%{_bindir}/haddock +%endif %{_bindir}/hp2ps %{_bindir}/hpc %{_bindir}/hsc2hs -%ghost %{_sysconfdir}/alternatives/hsc2hs -%{_bindir}/hsc2hs-ghc %{_bindir}/runghc -%{_bindir}/runghc-%{version} %{_bindir}/runhaskell -%ghost %{_sysconfdir}/alternatives/runhaskell -%{_bindir}/runhaskell-ghc -%dir %{ghclibdir} -%{ghclibdir}/settings %dir %{ghclibdir}/bin +%dir %{ghcliblib}/bin %{ghclibdir}/bin/ghc -%{ghclibdir}/bin/ghc-pkg %{ghclibdir}/bin/ghc-iserv %{ghclibdir}/bin/ghc-iserv-dyn -%{ghclibdir}/bin/ghc-iserv-prof -%{ghclibdir}/bin/hp2ps +%{ghclibdir}/bin/ghc-pkg %{ghclibdir}/bin/hpc %{ghclibdir}/bin/hsc2hs -%{ghclibdir}/ghc-usage.txt -%{ghclibdir}/ghci-usage.txt -%dir %{ghclibdir}/package.conf.d -%ghost %{ghclibdir}/package.conf.d/package.cache -%ghost %{ghclibdir}/package.conf.d/package.cache.lock -%{ghclibdir}/platformConstants %{ghclibdir}/bin/runghc -%{ghclibdir}/template-hsc.h +%{ghclibdir}/bin/hp2ps %{ghclibdir}/bin/unlit -%dir %{_datadir}/doc/ghc-%{version} -%dir %{ghcdocbasedir} -%dir %{ghcdocbasedir}/libraries -%if %{undefined without_manual} -%{_mandir}/man1/ghc.* -%endif -%if %{undefined without_haddock} -%{_bindir}/haddock -%{_bindir}/haddock-ghc-%{version} -%{ghclibdir}/html -%{ghclibdir}/latex -%{ghclibdir}/llvm-passes -%{ghclibdir}/llvm-targets +%if %{with hadrian} +%{ghclibdir}/bin/ghc-%{version} +%{ghclibdir}/bin/ghc-iserv-ghc-%{version} +%{ghclibdir}/bin/ghc-iserv-dyn-ghc-%{version} +%{ghclibdir}/bin/ghc-pkg-%{version} %{ghclibdir}/bin/haddock -%if %{undefined without_manual} -%{ghcdocbasedir}/haddock -%{ghcdocbasedir}/users_guide +%{ghclibdir}/bin/haddock-ghc-%{version} +%{ghclibdir}/bin/hp2ps-ghc-%{version} +%{ghclibdir}/bin/hpc-ghc-%{version} +%{ghclibdir}/bin/hsc2hs-ghc-%{version} +%{ghclibdir}/bin/runghc-%{version} +%{ghclibdir}/bin/runhaskell +%{ghclibdir}/bin/runhaskell-%{version} +%{ghclibdir}/bin/unlit-ghc-%{version} +%{ghclibdir}/lib/bin/ghc-iserv +%{ghclibdir}/lib/bin/ghc-iserv-dyn +%{ghclibdir}/lib/bin/unlit %endif -%{ghcdocbasedir}/libraries/gen_contents_index -%{ghcdocbasedir}/libraries/*.css -%{ghcdocbasedir}/libraries/prologue.txt -%{ghcdocbasedir}/libraries/synopsis.png -%{ghcdocbasedir}/index.html -%ghost %{ghcdocbasedir}/libraries/doc-index*.html -%ghost %{ghcdocbasedir}/libraries/haddock-bundle.min.js -%ghost %{ghcdocbasedir}/libraries/haddock-util.js -%ghost %{ghcdocbasedir}/libraries/index*.html -%ghost %{ghcdocbasedir}/libraries/minus.gif -%ghost %{ghcdocbasedir}/libraries/plus.gif +%{ghcliblib}/ghc-usage.txt +%{ghcliblib}/ghci-usage.txt +%{ghcliblib}/llvm-passes +%{ghcliblib}/llvm-targets +%dir %{ghcliblib}/package.conf.d +%ghost %{ghcliblib}/package.conf.d/package.cache +%{ghcliblib}/package.conf.d/package.cache.lock +%{ghcliblib}/settings +%{ghcliblib}/template-hsc.h +%{_mandir}/man1/ghc-pkg.1%{?ext_man} +%{_mandir}/man1/haddock.1%{?ext_man} +%{_mandir}/man1/runghc.1%{?ext_man} +%if %{with hadrian} || %{with haddock} +%{_bindir}/haddock-ghc-%{version} +%{ghcliblib}/html +%{ghcliblib}/latex +%endif +%if %{with haddock} || (%{with hadrian} && %{with manual}) +%{ghc_html_libraries_dir}/prologue.txt +%endif +%if %{with haddock} +%if %{without hadrian} +%{ghclibdir}/bin/haddock +%endif +%verify(not size mtime) %{ghc_html_libraries_dir}/haddock-bundle.min.js +%verify(not size mtime) %{ghc_html_libraries_dir}/linuwial.css +%verify(not size mtime) %{ghc_html_libraries_dir}/quick-jump.css +%verify(not size mtime) %{ghc_html_libraries_dir}/synopsis.png +%endif +%if %{with manual} && %{without hadrian} +%{_mandir}/man1/ghc.1%{?ext_man} %endif -%files libraries -%license LICENSE +%{_bindir}/ghc +%{_bindir}/ghc-pkg +%{_bindir}/ghci +%if %{with hadrian} || %{with haddock} +%{_bindir}/haddock +%endif +%{_bindir}/hp2ps +%{_bindir}/hpc +%{_bindir}/hsc2hs +%{_bindir}/runghc +%{_bindir}/runhaskell + +%files devel + +%if %{with haddock} || (%{with hadrian} && %{with manual}) +%files doc +%{ghc_html_dir}/index.html + +%files doc-index +%{ghc_html_libraries_dir}/gen_contents_index +%if %{with haddock} +%verify(not size mtime) %{ghc_html_libraries_dir}/doc-index*.html +%verify(not size mtime) %{ghc_html_libraries_dir}/index*.html +%endif + +%files filesystem +%dir %_ghc_doc_dir +%dir %ghc_html_dir +%dir %ghc_html_libraries_dir +%endif + +%if %{with manual} +%files manual +## needs pandoc +#%%{ghc_html_dir}/Cabal +%{ghc_html_dir}/users_guide +%if %{with hadrian} +%{ghc_html_dir}/Haddock +%else +%if %{with haddock} +%{ghc_html_dir}/haddock +%endif +%endif +%endif + +%if %{with ghc_prof} +%files prof +%endif %changelog diff --git a/haddock.man b/haddock.man new file mode 100644 index 0000000..4a83192 --- /dev/null +++ b/haddock.man @@ -0,0 +1,231 @@ +.TH HADDOCK 1 "July 2010" "Haddock, version 2.6.1" "Haddock documentation generator" + + +.SH NAME +haddock \- documentation tool for annotated Haskell source code + + +.SH SYNOPSIS +.B haddock +.RI [ options ] " file" ... + + +.SH DESCRIPTION +This manual page documents briefly the +.B haddock +command. +Extensive documentation is available in various other formats including DVI, +PostScript and HTML; see below. + +.PP +.I file +is a filename containing a Haskell source module. +All the modules specified on the command line will be processed together. +When one module refers to an entity in another module being processed, the +documentation will link directly to that entity. + +Entities that cannot be found, for example because they are in a module that +is not being processed as part of the current batch, simply will not be +hyperlinked in the generated documentation. +.B haddock +will emit warnings listing all the identifiers it could not resolve. + +The modules should not be mutually recursive, as +.B haddock +does not like swimming in circles. + + +.SH OPTIONS +The programs follow the usual GNU command line syntax, with long +options starting with two dashes (`--'). +A summary of options is included below. +For a complete description, see the other documentation. + +.TP +\fB\-o \fIDIR\fP, \-\-odir=\fIDIR\fP +directory in which to put the output files + +.TP +\fB\-i \fIFILE\fP, \-\-read-interface=\fIFILE\fP +read an interface from +.IR FILE . + +.TP +\fB\-D \fIFILE\fP, \-\-dump\-interface=\fIFILE\fP +dump an interface for these modules in +.IR FILE . + +.TP +\fB\-l \fIDIR\fP, \-\-lib=\fIDIR\fP +location of Haddock's auxiliary files + +.TP +.BR \-h ", " \-\-html +Generate documentation in HTML format. +Several files will be generated into the current directory (or the specified +directory if the +.B \-o +option is given), including the following: +.RS +.TP +.I index.html +The top level page of the documentation: +lists the modules available, using indentation to represent the hierarchy if +the modules are hierarchical. +.TP +.I haddock.css +The stylesheet used by the generated HTML. +Feel free to modify this to change the colors or layout, or even specify +your own stylesheet using the +.B \-\-css +option. +.TP +.I module.html +An HTML page for each module. +.TP +.IR doc-index.html ", " doc-index-XX.html +The index, split into two (functions/constructors and types/classes, as per +Haskell namespaces) and further split alphabetically. +.RE + +.TP +.B \-\-hoogle +output for Hoogle + +.TP +\fB\-\-html\-help=\fIformat +produce index and table of contents in mshelp, mshelp2 or devhelp format +(with \fI\-h\fP) + +.TP +\fB\-\-source\-base=\fPURL +Include links to the source files in the generated documentation, where URL +is the base URL where the source files can be found. + +.TP +\fB\-s \fPURL, \fB\-\-source\-module=\fPURL +Include links to the source files in the generated documentation, where URL +is a source code link for each module (using the %{FILE} or %{MODULE} vars). + +.TP +\fB\-\-source\-entity=\fPURL +Include links to the source files in the generated documentation, where URL +is a source code link for each entity (using the %{FILE}, %{MODULE} or %{NAME} vars). + +.TP +\fB\-\-comments\-base=\fPURL +URL for a comments link on the contents and index pages. +.TP +\fB\-\-comments\-module=\fPURL +URL for a comments link for each module (using the %{MODULE} var). +.TP +\fB\-\-comments\-entity=\fPURL +URL for a comments link for each entity (using the %{FILE}, %{MODULE} or %{NAME} vars). +.TP +.BI \-\-css= FILE +Use the CSS +.I FILE +instead of the default stylesheet that comes with +.B haddock +for HTML output. It should specify certain classes: see the default stylesheet for details. + +.TP +\fB\-p \fIFILE\fP, \-\-prologue=\fIFILE\fP +Specify a file containing prologue text. + +.TP +\fB\-t \fITITLE\fP, \-\-title=\fITITLE\fP +Use \fITITLE\fP as the page heading for each page in the documentation. +This will normally be the name of the library being documented. + +The title should be a plain string (no markup please!). + +.TP +\fB\-k \fINAME\fP, \-\-package=\fINAME\fP +Specify the package name (optional). + +.TP +.BR \-n ", " \-\-no\-implicit\-prelude +do not assume Prelude is imported + +.TP +.BR \-d ", " \-\-debug +Enable extra debugging output. + +.TP +.BR \-? ", " \-\-help +Display help. + +.TP +.BR \-V ", " \-\-version +Display version. + +.TP +.BR \-v ", " \-\-verbose +Verbose status reporting. + +.TP +\fB\-\-use\-contents=\fPURL +Use a separately-generated HTML contents page. + +.TP +.B \-\-gen\-contents +Generate an HTML contents from specified interfaces. + +.TP +\fB\-\-use\-index=\fPURL +Use a separately-generated HTML index. + +.TP +.B \-\-gen\-index +Generate an HTML index from specified interfaces. + +.TP +.B \-\-ignore\-all\-exports +Behave as if all modules have the ignore-exports atribute + +.TP +\fB\-\-hide=\fIMODULE +Behave as if \fIMODULE\fP has the hide attribute. + +.TP +\fB\-\-use\-package=\fIPACKAGE +The modules being processed depend on \fIPACKAGE\fP. + +.SH FILES +.I /usr/bin/haddock +.br +.I /usr/share/haddock-2.6.1/html/plus.gif +.br +.I /usr/share/haddock-2.6.1/html/minus.gif +.br +.I /usr/share/haddock-2.6.1/html/haskell_icon.gif +.br +.I /usr/share/haddock-2.6.1/html/haddock.js +.br +.I /usr/share/haddock-2.6.1/html/haddock.css +.br +.I /usr/share/haddock-2.6.1/html/haddock-DEBUG.css + +.SH SEE ALSO +.IR /usr/share/doc/haddock/ , +.br +the Haddock homepage +.UR http://haskell.org/haddock/ +(http://haskell.org/haddock/) +.UE + +.SH COPYRIGHT +Haddock version 2.6.1 + +Copyright 2006-2010 Simon Marlow , Dawid Waern . +All rights reserved. + + +.SH AUTHOR +This manual page was written by Michael Weber +for the Debian GNU/Linux system (but may be used by others). + +.\" Local variables: +.\" mode: nroff +.\" End: diff --git a/libatomic.patch b/libatomic.patch new file mode 100644 index 0000000..600012b --- /dev/null +++ b/libatomic.patch @@ -0,0 +1,24 @@ +Index: ghc-9.4.4/rts/package.conf.in +=================================================================== +--- ghc-9.4.4.orig/rts/package.conf.in ++++ ghc-9.4.4/rts/package.conf.in +@@ -66,6 +66,7 @@ extra-libraries: + #if NEED_ATOMIC_LIB + , "atomic" + #endif ++ , "atomic" + + #if defined(INSTALLING) + include-dirs: INCLUDE_DIR FFI_INCLUDE_DIR +Index: ghc-9.4.4/rts/rts.cabal.in +=================================================================== +--- ghc-9.4.4.orig/rts/rts.cabal.in ++++ ghc-9.4.4/rts/rts.cabal.in +@@ -152,6 +152,7 @@ library + extra-libraries: elf dw + if flag(libnuma) + extra-libraries: numa ++ extra-libraries: atomic + if !flag(smp) + cpp-options: -DNOSMP + diff --git a/riscv-tntc.patch b/riscv-tntc.patch new file mode 100644 index 0000000..70c7bb8 --- /dev/null +++ b/riscv-tntc.patch @@ -0,0 +1,74 @@ +Index: ghc-9.2.1/compiler/GHC/CmmToLlvm/Mangler.hs +=================================================================== +--- ghc-9.2.1.orig/compiler/GHC/CmmToLlvm/Mangler.hs ++++ ghc-9.2.1/compiler/GHC/CmmToLlvm/Mangler.hs +@@ -43,7 +43,7 @@ llvmFixupAsm logger dflags f1 f2 = {-# S + + -- | These are the rewrites that the mangler will perform + rewrites :: [Rewrite] +-rewrites = [rewriteSymType, rewriteAVX] ++rewrites = [rewriteSymType, rewriteAVX, rewriteCall] + + type Rewrite = DynFlags -> B.ByteString -> Maybe B.ByteString + +@@ -107,6 +107,27 @@ rewriteAVX dflags s + isVmovdqa = B.isPrefixOf (B.pack "vmovdqa") + isVmovap = B.isPrefixOf (B.pack "vmovap") + ++-- | This rewrites (tail) calls to avoid creating PLT entries for ++-- functions on riscv64. The replacement will load the address from the ++-- GOT, which is resolved to point to the real address of the function. ++rewriteCall :: Rewrite ++rewriteCall dflags l ++ | not isRISCV64 = Nothing ++ | isCall l = Just $ replaceCall "call" "jalr" "ra" l ++ | isTail l = Just $ replaceCall "tail" "jr" "t1" l ++ | otherwise = Nothing ++ where ++ isRISCV64 = platformArch (targetPlatform dflags) == ArchRISCV64 ++ isCall = B.isPrefixOf (B.pack "call\t") ++ isTail = B.isPrefixOf (B.pack "tail\t") ++ ++ replaceCall call jump reg l = ++ appendInsn (jump ++ "\t" ++ reg) $ removePlt $ ++ replaceOnce (B.pack call) (B.pack ("la\t" ++ reg ++ ",")) l ++ where ++ removePlt = replaceOnce (B.pack "@plt") (B.pack "") ++ appendInsn i = (`B.append` B.pack ("\n\t" ++ i)) ++ + -- | @replaceOnce match replace bs@ replaces the first occurrence of the + -- substring @match@ in @bs@ with @replace@. + replaceOnce :: B.ByteString -> B.ByteString -> B.ByteString -> B.ByteString +Index: ghc-9.2.1/configure.ac +=================================================================== +--- ghc-9.2.1.orig/configure.ac ++++ ghc-9.2.1/configure.ac +@@ -322,7 +322,7 @@ AC_MSG_CHECKING(whether target supports + case "$Unregisterised" in + NO) + case "$TargetArch" in +- ia64|powerpc64|powerpc64le|s390x|riscv64) ++ ia64|powerpc64|powerpc64le|s390x) + TablesNextToCodeDefault=NO + AC_MSG_RESULT([no]) + ;; +Index: ghc-9.2.1/libraries/ghci/GHCi/InfoTable.hsc +=================================================================== +--- ghc-9.2.1.orig/libraries/ghci/GHCi/InfoTable.hsc ++++ ghc-9.2.1/libraries/ghci/GHCi/InfoTable.hsc +@@ -241,6 +241,15 @@ mkJumpToAddr a = case hostPlatformArch o + 0xC0, 0x19, byte3 w64, byte2 w64, byte1 w64, byte0 w64, + 0x07, 0xF1 ] + ++ ArchRISCV64 -> pure $ ++ let w64 = fromIntegral (funPtrToInt a) :: Word64 ++ in Right [ 0x00000297 -- auipc t0,0 ++ , 0x01053283 -- ld t0,16(t0) ++ , 0x00028067 -- jr t0 ++ , 0x00000013 -- nop ++ , fromIntegral w64 ++ , fromIntegral (w64 `shiftR` 32) ] ++ + arch -> + -- The arch isn't supported. You either need to add your architecture as a + -- distinct case, or use non-TABLES_NEXT_TO_CODE mode. diff --git a/runghc.man b/runghc.man new file mode 100644 index 0000000..8351fe7 --- /dev/null +++ b/runghc.man @@ -0,0 +1,45 @@ +.TH RUNGHC 1 "28 NOVEMBER 2007" +.SH NAME +runghc \- program to run Haskell programs without first having to compile them. +.SH SYNOPSIS +.B runghc +.RI +[runghc|flags] [GHC|flags] module [program|flags]... +.br +.SH DESCRIPTION +.B runghc +is considered a non-interactive interpreter and part of The Glasgow Haskell Compiler. +.B runghc +is a compiler that automatically runs its results at the end. +.PP +.SH OPTIONS +.TP +the flags are: +.TP +.B \-f +it tells runghc which GHC to use to run the program. If it is not given then runghc will search for GHC in the directories in the system search path. runghc -f /path/to/ghc +.TP +.B \-- +runghc will try to work out where the boundaries between [runghc flags] and [GHC flags], and [GHC flags] and module are, but you can use a -- flag if it doesn't get it right. For example, runghc -- -fglasgow-exts Foo +means runghc won't try to use glasgow-exts as the path to GHC, but instead will pass the flag to GHC. + +.SH EXAMPLES +.TP +.B runghc foo +.PP +.B runghc -f /path/to/ghc foo +.TP +.B runghc -- -fglasgow-exts Foo + +.SH SEE ALSO +.BR ghc (1), +.BR ghci (1). +.br + +.SH COPYRIGHT +Copyright 2002, The University Court of the University of Glasgow. All rights reserved. + +.SH AUTHOR +This manual page was written by Efrain Valles Pulgar . This is free documentation; see the GNU +General Public Licence version 2 or later for copying conditions. There is NO WARRANTY. + From 7ae10e2ca637d1c34a486002ea516a4ba4aad272b79976a9797fb4ab9fddd790 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Fri, 31 Mar 2023 07:10:48 +0000 Subject: [PATCH 6/9] osc copypac from project:devel:languages:haskell:ghc-9.4.x package:ghc revision:16, using keep-link OBS-URL: https://build.opensuse.org/package/show/devel:languages:haskell/ghc?expand=0&rev=379 --- ghc.keyring | 115 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 77 insertions(+), 38 deletions(-) diff --git a/ghc.keyring b/ghc.keyring index d931204..2cbce8b 100644 --- a/ghc.keyring +++ b/ghc.keyring @@ -1,41 +1,80 @@ -----BEGIN PGP PUBLIC KEY BLOCK----- -mQGNBGC7eIUBDAC5xWztdYHAHMraJcy555udPgGyw36KOIH0/Sp6mRS5YJCwSp86 -yNzuJTo/zZfZc7oDoQX5c8/tNi9BsDL0f/XEBiYEtfXmSTeN9R0NU/3THjdCz9t9 -H9bD52l1nOwyawwanIjktfB7qZU97agcMHyl8VVmEH9kCTHTKkGxvDwtL4MHANsz -ZcFQggMvNKE/uxc8CARIdYM1G1PxxxnyPrKry461s6Q9tNmiOyxAjv5t72qGHGZh -d+jKq31zI+VPuXB1UuMqvQMwhvplHlWEZOeazSpt361ryuUHDWdKkiKrzSRDK1JV -Gsi3Exdioa4HSNQVv3bX4q1pmVneyTPSjF3rge5Qe77ogok1ba92PvJqe6VG+2yD -gIbug15mnLspySqc3ukvPUBUyJx5y7i/RY4sbElvvnQfiGwITGEeA81ejOUrbKKD -czEI2a2cLNFINn5En4+M2PCkc9tOuRU4PE/fS4qfUWknPn0+rW6PaE/AR7aGaqaq -11jQQzxX/gZtrU0AEQEAAbQ1WnViaW4gRHVnZ2FsIChHSEMgc2lnbmluZyBrZXkp -IDx6dWJpbkB3ZWxsLXR5cGVkLmNvbT6JAdQEEwEIAD4WIQSItX/PfbU7TbO/pLFY -h2T74i0ZxAUCYLt4hQIbAwUJA8JnAAULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAK -CRBYh2T74i0ZxNTCC/9sfAWRr8GjI0HtN2dkGtMFCgyM0YNR472wEsquR1g3oabD -pFptsKDxcL2V9NFTEReim9MsOYcQyJuiszk2KiWfSuPxuPvsTbo3vrk4XX2WC37o -X4MT02DPYp40jBF8Vc4jfMLoPkzQD82Lzpq2qqowc8RWKRY9U+EgfXywmTL3++ri -GeYkIijjbqipaLDUustMugIyr/SH/6qpBmrKdFYt9vAdOWF2yxNTiCTYDTYERX87 -T4bmTEYvPj1Vl44/flU6tzTSwbXtF8Ns/QL9Rrm+2GoSGfhY2wHpbeRC2fTB/H3L -avkZ9kjO64xjXNmrCHI93jJ4MlSEyJPsVDsrgsTXHhCy5ms69dlpQ+Dn3c1DmwIK -UzTSdqitXCxEKZV6drbb/ITTwcg+JT1uEv1sTb0WYkoWenJzNtSTiinfcW9GeiYJ -6OzCFWuC/AstCABJhfXjSNuGwYss2W7ly98gqibL9Rpth+MfcOGwxrrOPLMb4zyG -bt9SJYGfUsHDq6M6fBS5AY0EYLt4hQEMAM0gd3FflmjwJ/Hmq6GWO4R1nm6doQ5t -uuIaSLapOVqXLSEX2zS/qy5uvNvq9cWtq4JFlNiVC0ZFpBULLjB06CGcwCbKe/f8 -S2/Dx4Q6PVorP6yIx/jQawlT8jz4rS76p2xeUyWK/wKqoCItk2aMeqBLFlo69Xt2 -XTDtgaENehWE/r5fqr0ubMqYC9yjqmsRWceyNeM9zoP3rWKVtgyhQGv6wZ8/9gAQ -FLi92mCjNjQyisoqOSv8FReJNYYk8pwUQHjlS1Gxo9APBT8Pfi7Crt0VaHXKQQRC -IjKFWKmDAZZJG3SKcWaGYbtTrg4oIi3ARKKcg+3hM+WRBgOkfvrDVSd/f+swH54e -1qHf/ysLLKqNBmciqamSBIhez66wIHksXLRB/ZR8XFsWN3uTJkiMoo1NoiKNtoPG -Ek+HFf3peWmXuBKGTerBUSVBtZRXKGI9aMFQDhgi96lEi1qammQOwUyymPha1qzl -w3EJpcz2Uh9zXTPtx2ImKvDZE91Xv/HrYwARAQABiQG8BBgBCAAmFiEEiLV/z321 -O02zv6SxWIdk++ItGcQFAmC7eIUCGwwFCQPCZwAACgkQWIdk++ItGcSVqAwAnJHT -1hTyOjFxJdLVr2R+Y6BO8/hBCvCcW1CL+8mMBAVIM9Eu1TEViKG5n3972qbBurvC -jUt8j1Wa0//FrFV+3q5wkJ2+2qyJ1esTYwU1o54kSLMwj2bXG8N4K3XrXxGScJm6 -vCzbLToTyQ/wZfB0iYA7Jwoxww8FoYmrTo/iqXVI6pIVK4xZVpR1pQZgc0wOoFku -5p58DJlr4somcysEh8HlwC8NcVF1FDILkT6q4jAybU8Mw7pmk7hQlla7CtR3pf/n -Q0jbbfpWSdDmdaG4SMa3msjKf3nw2Vo+VOWSGvxxzDw/abhY3z85SUR3WU4QWlNN -SIUy5xE56Do4a21hMwc/x8SjMgK8h8u7hoP6ebJNzhwVWruQqha2+ADzTOVhvsfy -G8N3uv6qSJdzhg7QH9MFiHydXaQVGBqX6IEwjghcP+bI7BgC87dUD/OQ3HF81S3A -QJeQnApm+4zYUl2nhR16E8rtQ8aZpZDoDSI2fWjUPQ7uRDxW9/LuA9VO7yoq -=AZOC +xsFNBFWvRX0BEACnMXaAVVueyQABaaV7QyrLVeIPqvOHiLCyK/XkIwF3FtJAw2rY +QE+p8r+fOhtOsARQSZlOToEL/8had2qWGigVU/zrGs/dpE1TfrLZtdCfUefg0G3t +lYgk4fGPtJrAIjICPaiGis/NLACsmme9DuffZ8oVG1oJ7xgM/2OhKxmqQQsvJXyX +Arej2Zd89728ovkN8txlqebbU7hkRCIWqLdgogpONREB59waUHYmVkH3onaU2E2A +t1RgIRHmSBDUx532tr02v31GD5lGGQjDlL0uSdFYEQRV15pjGQzaWE9Kxm/IoX4H +802eEtzP9OHq0fyNCnwJILhbrN5m0vBrggKN6OEFMRNiKCLPRhDoI9m/ZvOOi1sC +OV5gcJ1YGJKht1znlQGqiHZ3E2LitE/8yrxlcEBU75g4FiZmZcjDJXiR92phcBxd ++jDVr+y8yNThqVZVVnW3AN7X2ikqf3D3Ca76q5j7kTY9B4FhDNVYyA1c0aN9A6N0 +e672fQMmx1JJoHSXxwSO5Yyne0luwdLHTYHu1WlycjzYwRuAXRI8y/U2TedLBSvf +FwdY6F0e0UDna5BYiwPNppk3WgIZtF0QdPNEfwQtCIjopQ/kPW61EzZtkDFTvJJo +G3IT4NwH8LJxluVzp1S1I32/odPVdED/wWgdFpar/T/G13DDDk92hYpStQARAQAB +zSRCZW5qYW1pbiBHYW1hcmkgPGJlbkB3ZWxsLXR5cGVkLmNvbT7CwXgEEwECACIF +AlWvRX0CGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEC3gTU6X22StDgMQ +AJxjsGdXwxVu5PM1bihR2ikLSgbEokI2PjK1b+ikBoEfAT9YI3KE2BUZlZXGiyHe +5cQgrONBsL+WGcHaIlox2tIe07IpVzKaCW0O6fRbf3b6gbFabA2qmFb7OUohJzrl +l0cKiYrT6nmwve7NHgNRfttHKmGzJJPxFLr1i680N6CtZawmL2QuvYjlCSjmY6YK +T+cOiGJ8tZoUnkPjEvGhhFjXaP5rtvs6EWOWnrmudhvSZBdYCJnQBhohQ2C6DvK6 +EH2wLgFYeuYb1D13vIqZ2CY/dHPqYL+42sJorU+jhdENHOOPggD7jlVLol3EBP5r +AdUaRQNBIdwatFbz/kAP/I+q1+cc1NSINIK2V89hLNOwWaQPEqdnvxazy6HEisG4 +coCTmlmdXIBeWL4QbILwtzJHebb9YnoHEHDurQWDiy1JhP5nRo4buO4FhaHtyc6w +tlkdu7Xri5DbZLoVSVewM5CW1f5obM/xTFODDttJrrRuLDFRgoR51H6YU3C1h2Tm +XxrvgVnwgxNZqtS7MQZMZ7yrdj9hMnFJqdkzgfhNqe/XfK75XnlA8Pf68W6uhwrs +Y3qnCf5qdTTzpFfmh6pFHaYEdOxaxiXRBAyRj92gSDFkbh0vbRXEYBOkryXpFzvm +7P6sYPZrM7aZ5IPxGbu03R3fUYpSIH9/7iOcCsPHwRAxwsFcBBABAgAGBQJV85Nc +AAoJECGaGJdBXOhehXcQAIKNvCZHntH/FkYge7Y/mKBd609M/O1jHKOPxJ73xKdk +uzmcWJqyPjN4ZqfGCfxYcayZ248a8dIntPpznscy+JfWC2On9b+h5L0fSf9I9rej +H2W9kjP7a/zNMNHfCKyv2ieuoC3lMW3/MxFCiG62FX/p2ZJfenTQwJn5feAFhZOj +9tmp3FQRiFKsnrrOtCjr87cwjHHeocid1RjJ6jdVzA+pvSIA+aUi8B3/Org16WuD +AxxGWE1mZhfacZ7C2Gi/sSfXApph50PFjm0lRdBJNo1AU+BjTS7qAHe+Bs1G/in4 +FN+0VlKsGrJ3tFa62nIYusEEJMe597FaN7HBn/6ugbux4JWjRJq81ZqvtiZxJUWq +hzYYCpAZd/TDztCZB9tQCGyzgZ2WQXhQLhlKKpVjixxYMlZFjPu9xjEJ7fIcQhXI +lD9FQ7vsO1uKe9T1Npe5zR+WejRPRmIYSIj9YGxi5RalhbaimmLv0iCxCOzGjQe4 +fcTwx3iGhtK2tgPS8mL56GQp+I1tc0835NnkJBNEA4xtF+saVD/Ut5PQ+bN61fM3 +XeCpoRb9Q9C2sCvgFG8QpGM7EEE0XBh5M0Ot4EluZMW75RKG+5JjHd4xE3pLftSX +BpwenswOvKy/Q6NCq/XMC+lPJRkOm/hyHdoV+6ybQO3ZsEtCPzVkGcdCg7y7vW2R +wsBcBBABCAAGBQJWofYmAAoJEHPt6ejPuu8BMnEIAJza05JpSWDcdDLnAN4kUj6m +yu0e2ehZnSaJuNARi883jTmWDLAlc2hFEmfgjCByJvuC6Njny62HbbNFys/3oQ7W +s4IARsG2cj4N0j90bTRL/cgQHnhSa+l96bKMX+Z/DEpHHMXem6BT1npqc/oRwC4T +kqMxsOFF4qm/C7PtdBQMC/bhrxd8uiRAKwg22dX8cP3sBua4OMEvPfeKwAwgF4hx +4bwvcdAOyZk8Z1Y52IW4+qdSFmodpP8+SPv7i7mzMExPp2uDyS5lXlOTspj3N9oc +Whs6aSpFVWjR7ifVzDqgS4a7AUkGQx154GwK/N5eY+T439d/ufO9T4gpAA4Yx4vC +wXMEEAEKAB0WIQQFcF5Q6ifSVmmchkK1W5po5t2JsgUCW9voCgAKCRC1W5po5t2J +sueqD/9k18vueAKquJp52im49PiEYhjlWZUriHIr281W6pv9gUQ8RdhyVzA6UQ/r +oklsAn7yjrKYgIeLFCa1BRFX4hgGqugI5BIjLJqZYZ4d4aXwObNr8hUJTJRaInsU +0UTX5NwmqWeNojRADxRk+D1nFxNrf168yNDmvVLyvjrBrV3sHEAn0vjTYe1grWOy +VLLY/1QfDAN97a90oaoqwgsl2gcAlF3PgdvRgEOxN3IVewOecjWTB4je55Qu2Kxq +8vhs+AeYuroDyADiTNKB7IrzF/pfvUHpvCArjRhEggT3Jyn/Y0vuYL2+8FvIurzB +TH7kjRgw4tD0wTSR4of6DHvlEfqYGZIecLY2jYzCimsQgoae1mrh6fWzvmFOLeM3 +wyBMp1lI+RWTDZBZGKalSu5xb1cT+kUZyxQ19fpYS77JShv48+m/eYv/Xl+j/DsE +uK0jwMiOlbhgd/gIDR0bkVt5PKnDwKrlsFP0Bwh6nqwyCbUdeap8eINd1OTI10gt +e0dYaz2/OFPNRh8HkraYISxh6nj/TG4gGddc6ie2H556IkKaXRPsMrC4RAXh+jtm +i3gPnrtqxRrkYRCt5sXCRbTBsonzryQ42DqKLDnFuqVg/7sgYQ8bGMOeljVBcA97 +bwiC1JJClHp/yj8wZgiYcYRUc1oX8gdBRyQT8jxgcvPoHKGvjM7BTQRVr0V9ARAA +s8GykB5AdwU/2HqM37ZjZe0DRwd6/YYa3FWbTSivB14rxt+QSLHt99neC6gJ2V5j +eJXXYRcZvGZuZp3C4HLhvGQJgpDEbhIMz6Xhzf4fXsbNmXSiB0z/ZqYXLjhFe4ni +9c/UorQRAfOqHgxpPpGouEGKafeAUP5p4kwyie53/89qHLiBsI3VUPMR8HO6RWM8 +KCsHZpHUS+bmx532JozShwIkCNpyWJUZAZG6EJUkWay4VtHM8RfYDh0MMEbB7CAe +HIIbi1neN4GyRZ4/qKWbnXvr8CT4oa99o9d7mxwS5Hs+Mo/rdB0d/8GrRr8YwKg3 +mny+Ieapoi4wq66qEoIiyrNfOkii47bRodd1P6wXBmo5D/xkZZ+G0Zh+KD/dsPfj +mHiH9vbnhBK8k4pxd789lvsrz7LB7peEaR8XUow+WyXCHfMI76twTvRJSn2GHwMG +FRxH8tcVJVfq7QT2wfUCELthYTWJcYD6zTkZfFJu48GIOSboZQiGt7IJiMm7i2un +hkNcfaHKoUCBKbflvrTuAiNQGhPBpUt7RI+VcLRWBHNH2I/xebxI/UWhhaYwB8g2 +nlela0PuXzn9a2jUDC4uYw2uNleezEF8GMcicTlmFDyRmF5dQ19abfu8hmD8gs7P +BtiHYX/9D7ogxxxFeo/ZoSVeru4S9oqEei9ni5aeF80AEQEAAcLBXwQYAQIACQUC +Va9FfQIbDAAKCRAt4E1Ol9tkrckJD/9l/cW+9cyJ03DhYEGV0iTXnzRf0j77vvvP +n7r6qqX0+YNFve0NYJM46Qv/H3celQUttzpwH0se+B0IhZzBtJhrD7RHEa8j9xTU +ze59wBR5Pl5yFxdbMVLsqoUnwOdTmq0TKY5KjJ8yDQ4wUEvMkNy4puza5p6neopc +Ipij33HuMZlw0BTUA0gzqddrhqIR/Af5cD9dYguURp6BWHMNdnFNSCpDq6sUDeQe +4/2jltSYAV2YgOipLoXmCGmbW/5rAC585DjQSG6QyVOM/o3AnSvb/8/dbCUXINgw +D3GEkqybhGT6EdE0krFc2H6scJbOuaMOVL0K2uo8QAi8FrlzVAREqX/5Z4lHyOXe +2hAToaH7zoLl86mme+YVHjSSNJgiStALhBymSHMFqtNhPgQqNHfEA7EUH4DwfuZ5 +HyshZ0zZotNcE+804vDXlCKeqm4kXdOHe9GcIPUCKoOIveMUyABGHKKRIWduRbkP +LjxqsDalGCrh/Anrqniruz7L0sAzLwbG6E6CNVz+oDTl4IQmRiHEkMxKJXccr/8p +GQL5aGUiHpn0Hcgf+VuIEovAMEKBksJ1+4F3wz1sbsT8xb6CscKsaQMSA3hbbKqs +LYYjIclg/s5YQxPjOKG9JVV4593RcWin/lpEdA4zCT6P4hJSyOGorLe9UCgynUz/ +hDhK1n518A== +=jcSs -----END PGP PUBLIC KEY BLOCK----- From 0db117758b6b90a11eb01d7fc40b8e3ce71ee3ebafe5d503896a3a36be506a98 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Fri, 31 Mar 2023 07:24:00 +0000 Subject: [PATCH 7/9] osc copypac from project:devel:languages:haskell:ghc-9.4.x package:ghc revision:17, using keep-link OBS-URL: https://build.opensuse.org/package/show/devel:languages:haskell/ghc?expand=0&rev=380 --- ghc.changes | 126 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 123 insertions(+), 3 deletions(-) diff --git a/ghc.changes b/ghc.changes index d48de4c..ff8d0d5 100644 --- a/ghc.changes +++ b/ghc.changes @@ -16,10 +16,10 @@ Fri Mar 17 11:09:29 UTC 2023 - Ondřej Súkup - added patches: * ghc-gen_contents_index-haddock-path.patch * ghc-Cabal-install-PATH-warning.patch - * execstack.patch + * execstack.patch * libatomic.patch - * riscv-tntc.patch - + * riscv-tntc.patch + ------------------------------------------------------------------- Tue Jan 31 09:37:15 UTC 2023 - Peter Simons @@ -55,6 +55,126 @@ Wed Feb 9 13:50:45 UTC 2022 - Peter Simons - add environ.patch to fix build errors with recent gcc +------------------------------------------------------------------- +Thu Jan 19 12:39:27 UTC 2023 - Guillaume GARDET + +- Do not require unversionned llvm since ghc needs a specific + llvm version. [boo#1207265] + +------------------------------------------------------------------- +Tue Jan 17 11:45:32 UTC 2023 - Peter Simons + +- Apply "fix_extlinks.patch" to work around a bug in Sphinx 6.1.x + that broke our documentation build. Remove this patch once Sphinx + is fixed. This patch is a variant of the ghc-9.4.4 patch from + https://gitlab.haskell.org/ghc/ghc/-/issues/22766. Upstream's + https://github.com/sphinx-doc/sphinx/issues/11094 has further + details. [boo#1207214] + +------------------------------------------------------------------- +Mon Jun 27 17:04:51 UTC 2022 - Dirk Müller + +- add ghc.keyring to have source validation enabled +- limit to use llvm12 for Factory as newer versions are not supported + +------------------------------------------------------------------- +Fri Apr 29 13:49:29 UTC 2022 - Martin Liška + +- Remove dependency on binutils-gold as the package will be removed + in the future. Gold linker is unmaintained by the upstream project. + +------------------------------------------------------------------- +Tue Mar 8 22:35:07 UTC 2022 - Dirk Müller + +- add ghc-armv7-VFPv3D16--NEON.patch to use vfpv3-d16 on armv7hl + +------------------------------------------------------------------- +Fri Sep 3 20:57:29 UTC 2021 - Ondřej Súkup + +- update to 8.10.7 +- drop 4134.patch and refresh ghc-pie.patch + * portabilit yfixes + * Export some RTS symbols required for static builds of GHC + * Fix LLVM version checking logic so it no longer complains + about supported LLVM versions. + * Fix some RTS crashes on Darwin due to mixing up the closure + sizes of the aarch64 and x86-64 backends. + * Fix a crash on the non-moving GC due to incorrect logic + for calculating the header size for array write barries + * Fix a bug in base leading to a high likelihood of space + leaks when using lazy bytestrings + * Fix some timer races in the RTS possibly manifesting in #18033 and #20132 + * Fix a number of bugs affecting the RTS m32 allocator + * Fix a bug where code may be unloaded prematurely + when using the parallel garbage collector + * Fix a bug where the linker may during shutdown unload code before + libraries’ atexit handlers have a chance to run + * Improve code layout by distiguishing conditional and unconditional branches + * Add hs-boot file support for -ddump-minimal-imports + * Ensure hs-boot files are built before source files in GHCs -M mode + * Fix a long standing GHC API bug affecting clients like HLS where + async exceptions used to cancel threads during typechecking would be + caught by the Template Haskell evaluator and reported as compile errors + * Improve error messages when looking up packages fails + * Fix a number of quirks in GC accounting + * Fix a code generation bug which could result in entry of unlifted + objects in some programs using unboxed sums + * Ensure that POSIX signals are not delivered to the ticker thread + when using the pthread itimer implementation. + * Fix a specialiser bug which could result in the construction + of recursive dictionaries in some programs + * Bump containers to 0.6.4.1 + * Do not treat -Winferred-safe-imports warnings as errors. + * Fix a bug where typechecker plugins could be run with + an inconsistent typechecker environment + * Fix a simplifier bug which lead to an exponential + blow up and excessive memory usage in certain cases + +------------------------------------------------------------------- +Fri Jun 25 10:02:25 UTC 2021 - Ondřej Súkup + +- add 4134.patch to fix build with Sphinx4 + +------------------------------------------------------------------- +Mon Mar 15 20:33:24 UTC 2021 - Dirk Müller + +- always build against llvm9, also on SLE15 (suse_version == 1500) + otherwise the resulting build is not working (llvm is 7.x there) (bsc#1181571) + +------------------------------------------------------------------- +Tue Feb 9 01:29:46 UTC 2021 - Ondřej Súkup + +- update to 8.10.4 + * Fix a crash caused by inappropriate garbage of heap-allocated data + reachable from foreign exports + +------------------------------------------------------------------- +Sun Dec 20 00:29:27 UTC 2020 - Ondřej Súkup + +- update to 8.10.3 + * More robust support for architectures with weak memory ordering + guarantees (e.g. modern ARM hardware). + * GHC can now split dynamic objects to accomodate macOS' RPATH size + limitation when building large projects (#14444) + * Several correctness bugs in the new low-latency garbage collector + * Many, many other bug-fixes)) + +------------------------------------------------------------------- +Thu Dec 17 12:20:00 UTC 2020 - Ondřej Súkup + +- disable %{ix86} build + +------------------------------------------------------------------- +Wed Oct 14 12:20:00 UTC 2020 - Ondřej Súkup + +- force multiversion for subpackages + +------------------------------------------------------------------- +Sat Oct 3 15:58:52 UTC 2020 - Ondřej Súkup + +- add --enable-unregistered to configure phase on unregistered + architectures + ------------------------------------------------------------------- Sun Aug 9 11:27:32 UTC 2020 - Ondřej Súkup From 4e659676b64b2c7b2063a4fbb3db0aa689cccd8aafe777fa81153db57bea7608 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Fri, 31 Mar 2023 15:31:02 +0000 Subject: [PATCH 8/9] osc copypac from project:devel:languages:haskell:ghc-9.4.x package:ghc revision:18, using keep-link OBS-URL: https://build.opensuse.org/package/show/devel:languages:haskell/ghc?expand=0&rev=381 --- ghc.changes | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ghc.changes b/ghc.changes index ff8d0d5..b8c0c68 100644 --- a/ghc.changes +++ b/ghc.changes @@ -45,16 +45,6 @@ Tue Jan 31 09:37:15 UTC 2023 - Peter Simons that causes, we just copy some random LICENSE file into the place where our build would expect it. -------------------------------------------------------------------- -Fri Jul 8 11:48:57 UTC 2022 - Andreas Schwab - -- execstack.patch: add missing stack note - -------------------------------------------------------------------- -Wed Feb 9 13:50:45 UTC 2022 - Peter Simons - -- add environ.patch to fix build errors with recent gcc - ------------------------------------------------------------------- Thu Jan 19 12:39:27 UTC 2023 - Guillaume GARDET @@ -71,6 +61,11 @@ Tue Jan 17 11:45:32 UTC 2023 - Peter Simons https://github.com/sphinx-doc/sphinx/issues/11094 has further details. [boo#1207214] +------------------------------------------------------------------- +Fri Jul 8 11:48:57 UTC 2022 - Andreas Schwab + +- execstack.patch: add missing stack note + ------------------------------------------------------------------- Mon Jun 27 17:04:51 UTC 2022 - Dirk Müller @@ -88,6 +83,11 @@ Tue Mar 8 22:35:07 UTC 2022 - Dirk Müller - add ghc-armv7-VFPv3D16--NEON.patch to use vfpv3-d16 on armv7hl +------------------------------------------------------------------- +Wed Feb 9 13:50:45 UTC 2022 - Peter Simons + +- add environ.patch to fix build errors with recent gcc + ------------------------------------------------------------------- Fri Sep 3 20:57:29 UTC 2021 - Ondřej Súkup From 12cc594410096bd0c3a2e4e4de0e57438ebc1f04fb716058d013685697b0054f Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Fri, 31 Mar 2023 15:44:48 +0000 Subject: [PATCH 9/9] osc copypac from project:devel:languages:haskell:ghc-9.4.x package:ghc revision:19, using keep-link OBS-URL: https://build.opensuse.org/package/show/devel:languages:haskell/ghc?expand=0&rev=382 --- ghc.changes | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ghc.changes b/ghc.changes index b8c0c68..72e9fc2 100644 --- a/ghc.changes +++ b/ghc.changes @@ -19,6 +19,7 @@ Fri Mar 17 11:09:29 UTC 2023 - Ondřej Súkup * execstack.patch * libatomic.patch * riscv-tntc.patch + * ghc-hadrian-s390x-rts--qg.patch ------------------------------------------------------------------- Tue Jan 31 09:37:15 UTC 2023 - Peter Simons @@ -128,12 +129,12 @@ Fri Sep 3 20:57:29 UTC 2021 - Ondřej Súkup * Fix a bug where typechecker plugins could be run with an inconsistent typechecker environment * Fix a simplifier bug which lead to an exponential - blow up and excessive memory usage in certain cases + blow up and excessive memory usage in certain cases ------------------------------------------------------------------- Fri Jun 25 10:02:25 UTC 2021 - Ondřej Súkup -- add 4134.patch to fix build with Sphinx4 +- add 4134.patch to fix build with Sphinx4 ------------------------------------------------------------------- Mon Mar 15 20:33:24 UTC 2021 - Dirk Müller @@ -161,13 +162,13 @@ Sun Dec 20 00:29:27 UTC 2020 - Ondřej Súkup ------------------------------------------------------------------- Thu Dec 17 12:20:00 UTC 2020 - Ondřej Súkup - + - disable %{ix86} build - + ------------------------------------------------------------------- Wed Oct 14 12:20:00 UTC 2020 - Ondřej Súkup -- force multiversion for subpackages +- force multiversion for subpackages ------------------------------------------------------------------- Sat Oct 3 15:58:52 UTC 2020 - Ondřej Súkup