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 b0404f7..0000000 Binary files a/ghc-8.10.7-src.tar.xz.sig and /dev/null differ 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 0000000..9513a3c Binary files /dev/null and b/ghc-9.4.4-src.tar.xz.sig differ diff --git a/ghc-Cabal-install-PATH-warning.patch b/ghc-Cabal-install-PATH-warning.patch new file mode 100644 index 0000000..e59d86d --- /dev/null +++ b/ghc-Cabal-install-PATH-warning.patch @@ -0,0 +1,14 @@ +Index: ghc-9.2.0.20210331/libraries/Cabal/Cabal/src/Distribution/Simple/Install.hs +=================================================================== +--- ghc-9.2.0.20210331.orig/libraries/Cabal/Cabal/src/Distribution/Simple/Install.hs ++++ ghc-9.2.0.20210331/libraries/Cabal/Cabal/src/Distribution/Simple/Install.hs +@@ -206,8 +206,7 @@ copyComponent verbosity pkg_descr lbi (C + ++ " in " ++ binPref) + inPath <- isInSearchPath binPref + when (not inPath) $ +- warn verbosity ("The directory " ++ binPref +- ++ " is not in the system search path.") ++ warn verbosity ("Executable installed in " ++ binPref) + case compilerFlavor (compiler lbi) of + GHC -> 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. +