Compare commits

...

26 Commits
master ... 8.4

Author SHA1 Message Date
Jens Petersen 7cb427ad37 revert upstream llvm changes (6e361d89/ghc)
https://ghc.haskell.org/trac/ghc/ticket/15780
2018-10-19 16:15:42 +09:00
Jens Petersen 7861fb68d3 update to 8.4.4 bugfix release 2018-10-17 17:09:08 +09:00
Jens Petersen 0254fdd904 changelog for recent changes 2018-10-17 13:04:29 +09:00
Jens Petersen ef53860e3f Update alternatives dependencies, from master (pbrobinson) 2018-10-17 12:46:43 +09:00
Jens Petersen c8eef02d68 ghc-iserv-prof at least conditional for quickbuild 2018-10-17 08:04:23 +09:00
Jens Petersen 1d50ff9597 extend quickbuild to handle perf_build (from master) 2018-10-17 01:21:07 +09:00
Jens Petersen 2613929166 mv ghc-8.4.3-warnings.mk-test.patch -> ghc-warnings.mk-CC-Wall.patch 2018-10-16 23:28:56 +09:00
Jens Petersen af43ccbb10 BR python3-sphinx instead python-sphinx 2018-10-16 22:33:50 +09:00
Jens Petersen 51cddbe2d4 use with_prof instead of without_prof 2018-10-16 22:32:48 +09:00
Jens Petersen d3086740e0 include ABI check code from main Fedora 2018-10-16 22:29:36 +09:00
Jens Petersen 57426d9786 add commented out D4159.patch
since it is included in 8.4 but not 8.6 iirc
2018-10-16 22:28:46 +09:00
Jens Petersen da1c217540 remove reproducible-tmp-names.patch
seems deprecated for 8.4 (not in debian)
2018-10-16 22:27:51 +09:00
Jens Petersen fb6e70e30b bump release in changelog 2018-09-30 18:26:36 +09:00
Jens Petersen 79d7c46293 add quickbuild switch for fast test builds without docs and prof 2018-09-30 12:15:04 +09:00
Jens Petersen 54d9cf250b drop the arch nonsense for CFLAGS and LDFLAGS
later we can replace with %ghc_set_gcc_flags if useful
2018-09-30 12:09:56 +09:00
Jens Petersen 7a14191c60 s390x: Debian patch for Stg.h to fix build with ghc-8.2
https://ghc.haskell.org/trac/ghc/ticket/15201
2018-09-29 19:48:52 +09:00
Jens Petersen c317309757 silence flood of -Wunused-label warnings on s390x 2018-09-29 19:48:05 +09:00
Jens Petersen 094634c995 ghc-iserv-prof seems built without prof; use %with docs for xhtml 2018-09-05 21:50:03 +09:00
Jens Petersen 96a003d686 use without_prof and without_docs (instead of without_haddock)
- without_prof is backcompat
2018-09-03 16:32:02 +09:00
Jens Petersen 43d598c766 --with-llc and --with-opt deprecated (gone) 2018-09-03 16:31:25 +09:00
Jens Petersen 11a0f144f5 set LDFLAGS conditional on arch, like CFLAGS
this should prevent gcc configure fails on s390x etc
2018-09-03 16:29:09 +09:00
Jens Petersen b979ca9d84 use %ghc_set_cflags also for f28 2018-09-03 16:28:19 +09:00
Jens Petersen 13ac46a0ed add armv7l to llvm-targets (patch from OpenSuse/Debian) 2018-07-25 15:57:43 +09:00
Jens Petersen abf5d93554 (aarch64/s390) remove -Wall and -Werror=format-security separately 2018-07-24 19:23:54 +09:00
Jens Petersen f55f2d752d ghc manpage is built now 2018-07-09 12:04:21 +02:00
Jens Petersen 9189b38f6a import 8.4.3 from Fedora copr 2018-07-08 07:53:29 +02:00
21 changed files with 2861 additions and 21 deletions

View File

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/ghc-8.4.3-src.tar.xz
/ghc-8.4.4-src.tar.xz

View File

@ -0,0 +1,277 @@
From 6e361d895dda4600a85e01c72ff219474b5c7190 Mon Sep 17 00:00:00 2001
From: Kavon Farvardin <kavon@farvard.in>
Date: Thu, 4 Oct 2018 13:44:55 -0400
Subject: [PATCH] Multiple fixes / improvements for LLVM backend
- Fix for #13904 -- stop "trashing" callee-saved registers, since it is
not actually doing anything useful.
- Fix for #14251 -- fixes the calling convention for functions passing
raw SSE-register values by adding padding as needed to get the values
in the right registers. This problem cropped up when some args were
unused an dropped from the live list.
- Fixed a typo in 'readnone' attribute
- Added 'lower-expect' pass to level 0 LLVM optimization passes to
improve block layout in LLVM for stack checks, etc.
Test Plan: `make test WAYS=optllvm` and `make test WAYS=llvm`
Reviewers: bgamari, simonmar, angerman
Reviewed By: angerman
Subscribers: rwbarton, carter
GHC Trac Issues: #13904, #14251
Differential Revision: https://phabricator.haskell.org/D5190
(cherry picked from commit adcb5fb47c0942671d409b940d8884daa9359ca4)
---
compiler/llvmGen/Llvm/Types.hs | 2 +-
compiler/llvmGen/LlvmCodeGen/Base.hs | 62 ++++++++++++++++++++----
compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 59 +++++-----------------
compiler/main/DriverPipeline.hs | 2 +-
testsuite/tests/codeGen/should_run/all.T | 4 +-
5 files changed, 67 insertions(+), 62 deletions(-)
diff --git a/compiler/llvmGen/Llvm/Types.hs b/compiler/llvmGen/Llvm/Types.hs
index 87111499fc0..c1c51afcf0f 100644
--- a/compiler/llvmGen/Llvm/Types.hs
+++ b/compiler/llvmGen/Llvm/Types.hs
@@ -560,7 +560,7 @@ instance Outputable LlvmFuncAttr where
ppr OptSize = text "optsize"
ppr NoReturn = text "noreturn"
ppr NoUnwind = text "nounwind"
- ppr ReadNone = text "readnon"
+ ppr ReadNone = text "readnone"
ppr ReadOnly = text "readonly"
ppr Ssp = text "ssp"
ppr SspReq = text "ssqreq"
diff --git a/compiler/llvmGen/LlvmCodeGen/Base.hs b/compiler/llvmGen/LlvmCodeGen/Base.hs
index 6e20da48c1b..ec91bacc4c8 100644
--- a/compiler/llvmGen/LlvmCodeGen/Base.hs
+++ b/compiler/llvmGen/LlvmCodeGen/Base.hs
@@ -26,7 +26,7 @@ module LlvmCodeGen.Base (
cmmToLlvmType, widthToLlvmFloat, widthToLlvmInt, llvmFunTy,
llvmFunSig, llvmFunArgs, llvmStdFunAttrs, llvmFunAlign, llvmInfAlign,
- llvmPtrBits, tysToParams, llvmFunSection,
+ llvmPtrBits, tysToParams, llvmFunSection, padLiveArgs, isSSE,
strCLabel_llvm, strDisplayName_llvm, strProcedureName_llvm,
getGlobalPtr, generateExternDecls,
@@ -58,6 +58,8 @@ import ErrUtils
import qualified Stream
import Control.Monad (ap)
+import Data.List (sort)
+import Data.Maybe (mapMaybe)
-- ----------------------------------------------------------------------------
-- * Some Data Types
@@ -147,16 +149,58 @@ llvmFunSection dflags lbl
-- | A Function's arguments
llvmFunArgs :: DynFlags -> LiveGlobalRegs -> [LlvmVar]
llvmFunArgs dflags live =
- map (lmGlobalRegArg dflags) (filter isPassed (activeStgRegs platform))
+ map (lmGlobalRegArg dflags) (filter isPassed allRegs)
where platform = targetPlatform dflags
- isLive r = not (isSSE r) || r `elem` alwaysLive || r `elem` live
+ allRegs = activeStgRegs platform
+ paddedLive = map (\(_,r) -> r) $ padLiveArgs live
+ isLive r = r `elem` alwaysLive || r `elem` paddedLive
isPassed r = not (isSSE r) || isLive r
- isSSE (FloatReg _) = True
- isSSE (DoubleReg _) = True
- isSSE (XmmReg _) = True
- isSSE (YmmReg _) = True
- isSSE (ZmmReg _) = True
- isSSE _ = False
+
+
+isSSE :: GlobalReg -> Bool
+isSSE (FloatReg _) = True
+isSSE (DoubleReg _) = True
+isSSE (XmmReg _) = True
+isSSE (YmmReg _) = True
+isSSE (ZmmReg _) = True
+isSSE _ = False
+
+sseRegNum :: GlobalReg -> Maybe Int
+sseRegNum (FloatReg i) = Just i
+sseRegNum (DoubleReg i) = Just i
+sseRegNum (XmmReg i) = Just i
+sseRegNum (YmmReg i) = Just i
+sseRegNum (ZmmReg i) = Just i
+sseRegNum _ = Nothing
+
+-- the bool indicates whether the global reg was added as padding.
+-- the returned list is not sorted in any particular order,
+-- but does indicate the set of live registers needed, with SSE padding.
+padLiveArgs :: LiveGlobalRegs -> [(Bool, GlobalReg)]
+padLiveArgs live = allRegs
+ where
+ sseRegNums = sort $ mapMaybe sseRegNum live
+ (_, padding) = foldl assignSlots (1, []) $ sseRegNums
+ allRegs = padding ++ map (\r -> (False, r)) live
+
+ assignSlots (i, acc) regNum
+ | i == regNum = -- don't need padding here
+ (i+1, acc)
+ | i < regNum = let -- add padding for slots i .. regNum-1
+ numNeeded = regNum-i
+ acc' = genPad i numNeeded ++ acc
+ in
+ (regNum+1, acc')
+ | otherwise = error "padLiveArgs -- i > regNum ??"
+
+ genPad start n =
+ take n $ flip map (iterate (+1) start) (\i ->
+ (True, FloatReg i))
+ -- NOTE: Picking float should be fine for the following reasons:
+ -- (1) Float aliases with all the other SSE register types on
+ -- the given platform.
+ -- (2) The argument is not live anyways.
+
-- | Llvm standard fun attributes
llvmStdFunAttrs :: [LlvmFuncAttr]
diff --git a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
index e812dd445f1..a7121b7909a 100644
--- a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
+++ b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
@@ -14,7 +14,7 @@ import LlvmCodeGen.Base
import LlvmCodeGen.Regs
import BlockId
-import CodeGen.Platform ( activeStgRegs, callerSaves )
+import CodeGen.Platform ( activeStgRegs )
import CLabel
import Cmm
import PprCmm
@@ -211,7 +211,6 @@ genCall t@(PrimTarget (MO_Prefetch_Data localityInt)) [] args
fptr <- liftExprData $ getFunPtr funTy t
argVars' <- castVarsW Signed $ zip argVars argTy
- doTrashStmts
let argSuffix = [mkIntLit i32 0, mkIntLit i32 localityInt, mkIntLit i32 1]
statement $ Expr $ Call StdCall fptr (argVars' ++ argSuffix) []
| otherwise = panic $ "prefetch locality level integer must be between 0 and 3, given: " ++ (show localityInt)
@@ -294,7 +293,6 @@ genCall t@(PrimTarget op) [] args
fptr <- getFunPtrW funTy t
argVars' <- castVarsW Signed $ zip argVars argTy
- doTrashStmts
let alignVal = mkIntLit i32 align
arguments = argVars' ++ (alignVal:isVolVal)
statement $ Expr $ Call StdCall fptr arguments []
@@ -446,7 +444,6 @@ genCall target res args = runStmtsDecls $ do
| never_returns = statement $ Unreachable
| otherwise = return ()
- doTrashStmts
-- make the actual call
case retTy of
@@ -1759,12 +1756,9 @@ genLit _ CmmHighStackMark
funPrologue :: LiveGlobalRegs -> [CmmBlock] -> LlvmM StmtData
funPrologue live cmmBlocks = do
- trash <- getTrashRegs
let getAssignedRegs :: CmmNode O O -> [CmmReg]
getAssignedRegs (CmmAssign reg _) = [reg]
- -- Calls will trash all registers. Unfortunately, this needs them to
- -- be stack-allocated in the first place.
- getAssignedRegs (CmmUnsafeForeignCall _ rs _) = map CmmGlobal trash ++ map CmmLocal rs
+ getAssignedRegs (CmmUnsafeForeignCall _ rs _) = map CmmLocal rs
getAssignedRegs _ = []
getRegsBlock (_, body, _) = concatMap getAssignedRegs $ blockToList body
assignedRegs = nub $ concatMap (getRegsBlock . blockSplit) cmmBlocks
@@ -1794,14 +1788,9 @@ funPrologue live cmmBlocks = do
funEpilogue :: LiveGlobalRegs -> LlvmM ([LlvmVar], LlvmStatements)
funEpilogue live = do
- -- Have information and liveness optimisation is enabled?
- let liveRegs = alwaysLive ++ live
- isSSE (FloatReg _) = True
- isSSE (DoubleReg _) = True
- isSSE (XmmReg _) = True
- isSSE (YmmReg _) = True
- isSSE (ZmmReg _) = True
- isSSE _ = False
+ -- the bool indicates whether the register is padding.
+ let alwaysNeeded = map (\r -> (False, r)) alwaysLive
+ livePadded = alwaysNeeded ++ padLiveArgs live
-- Set to value or "undef" depending on whether the register is
-- actually live
@@ -1813,39 +1802,17 @@ funEpilogue live = do
let ty = (pLower . getVarType $ lmGlobalRegVar dflags r)
return (Just $ LMLitVar $ LMUndefLit ty, nilOL)
platform <- getDynFlag targetPlatform
- loads <- flip mapM (activeStgRegs platform) $ \r -> case () of
- _ | r `elem` liveRegs -> loadExpr r
- | not (isSSE r) -> loadUndef r
+ let allRegs = activeStgRegs platform
+ loads <- flip mapM allRegs $ \r -> case () of
+ _ | (False, r) `elem` livePadded
+ -> loadExpr r -- if r is not padding, load it
+ | not (isSSE r) || (True, r) `elem` livePadded
+ -> loadUndef r
| otherwise -> return (Nothing, nilOL)
let (vars, stmts) = unzip loads
return (catMaybes vars, concatOL stmts)
-
--- | A series of statements to trash all the STG registers.
---
--- In LLVM we pass the STG registers around everywhere in function calls.
--- So this means LLVM considers them live across the entire function, when
--- in reality they usually aren't. For Caller save registers across C calls
--- the saving and restoring of them is done by the Cmm code generator,
--- using Cmm local vars. So to stop LLVM saving them as well (and saving
--- all of them since it thinks they're always live, we trash them just
--- before the call by assigning the 'undef' value to them. The ones we
--- need are restored from the Cmm local var and the ones we don't need
--- are fine to be trashed.
-getTrashStmts :: LlvmM LlvmStatements
-getTrashStmts = do
- regs <- getTrashRegs
- stmts <- flip mapM regs $ \ r -> do
- reg <- getCmmReg (CmmGlobal r)
- let ty = (pLower . getVarType) reg
- return $ Store (LMLitVar $ LMUndefLit ty) reg
- return $ toOL stmts
-
-getTrashRegs :: LlvmM [GlobalReg]
-getTrashRegs = do plat <- getLlvmPlatform
- return $ filter (callerSaves plat) (activeStgRegs plat)
-
-- | Get a function pointer to the CLabel specified.
--
-- This is for Haskell functions, function type is assumed, so doesn't work
@@ -1967,7 +1934,3 @@ getCmmRegW = lift . getCmmReg
genLoadW :: Atomic -> CmmExpr -> CmmType -> WriterT LlvmAccum LlvmM LlvmVar
genLoadW atomic e ty = liftExprData $ genLoad atomic e ty
-doTrashStmts :: WriterT LlvmAccum LlvmM ()
-doTrashStmts = do
- stmts <- lift getTrashStmts
- tell $ LlvmAccum stmts mempty
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index 86dd913461c..f4d5e7f553c 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -1465,7 +1465,7 @@ runPhase (RealPhase LlvmOpt) input_fn dflags
-- we always (unless -optlo specified) run Opt since we rely on it to
-- fix up some pretty big deficiencies in the code we generate
llvmOpts = case optLevel dflags of
- 0 -> "-mem2reg -globalopt"
+ 0 -> "-mem2reg -globalopt -lower-expect"
1 -> "-O1 -globalopt"
_ -> "-O2"

View File

@ -1,21 +0,0 @@
# Makefile for source rpm: ghc
# $Id$
NAME := ghc
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attept a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

View File

@ -0,0 +1,23 @@
Forwarded to https://ghc.haskell.org/trac/ghc/ticket/10424
--- a/compiler/iface/MkIface.hs
+++ b/compiler/iface/MkIface.hs
@@ -681,7 +681,7 @@ addFingerprints hsc_env mb_old_fingerpri
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 mb_old_fingerpri
(non_orph_fis, orph_fis) = mkOrphMap ifFamInstOrph (mi_fam_insts iface0)
fix_fn = mi_fix_fn 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

View File

@ -0,0 +1,51 @@
Description: Allow unregisterised ghc-8.2 to build newer GHC
Commit b68697e579d38ca29c2b84377dc2affa04659a28 introduced a regression
stopping existing unregisteristed compilers from being used to compile a newer
version of GHC. The problem is that the bootstrap compiler uses the newer Stg.h
where EB_, IB_, etc, definitions have changed resulting in the following error:
.
error: conflicting types for 'ghc_GhcPrelude_zdtrModule4_bytes'
note: in definition of macro 'EB_'
#define EB_(X) extern const char X[]
note: previous definition of 'ghc_GhcPrelude_zdtrModule4_bytes' was here
char ghc_GhcPrelude_zdtrModule4_bytes[] = "ghc";
.
For more information about the problem, see https://phabricator.haskell.org/D4114.
.
This patch is a rework of https://phabricator.haskell.org/D3741.
It modifies Stg.h to include the old definitions, if a compiler older than
8.4 is being used.
.
This patch can be removed, once ghc-8.2 is no longer the bootstrap compiler.
Author: Ilias Tsitsimpis <iliastsi@debian.org>
Bug: https://ghc.haskell.org/trac/ghc/ticket/15201
Index: b/includes/Stg.h
===================================================================
--- a/includes/Stg.h
+++ b/includes/Stg.h
@@ -232,6 +232,16 @@ typedef StgInt I_;
typedef StgWord StgWordArray[];
typedef StgFunPtr F_;
+#if __GLASGOW_HASKELL__ < 804
+#define EB_(X) extern char X[]
+#define IB_(X) static char X[]
+#define EI_(X) extern StgWordArray (X) GNU_ATTRIBUTE(aligned (8))
+#define II_(X) static StgWordArray (X) GNU_ATTRIBUTE(aligned (8))
+#define IF_(f) static StgFunPtr GNUC3_ATTRIBUTE(used) f(void)
+#define FN_(f) StgFunPtr f(void)
+#define EF_(f) StgFunPtr f(void) /* External Cmm functions */
+#define EFF_(f) void f() /* See Note [External function prototypes] */
+#else
/* byte arrays (and strings): */
#define EB_(X) extern const char X[]
#define IB_(X) static const char X[]
@@ -250,6 +260,7 @@ typedef StgFunPtr F_;
#define EF_(f) StgFunPtr f(void) /* External Cmm functions */
/* foreign functions: */
#define EFF_(f) void f() /* See Note [External function prototypes] */
+#endif /* __GLASGOW_HASKELL__ < 804 */
/* Note [External function prototypes] See Trac #8965, #11395
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -0,0 +1,12 @@
--- ghc-8.2.2/libraries/Cabal/Cabal/Distribution/Simple/Install.hs~ 2017-05-05 23:51:43.000000000 +0900
+++ ghc-8.2.2/libraries/Cabal/Cabal/Distribution/Simple/Install.hs 2018-02-27 12:22:13.159432104 +0900
@@ -215,8 +215,7 @@
++ " 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

View File

@ -0,0 +1,11 @@
--- ghc-7.8.3/aclocal.m4~ 2014-07-10 13:27:16.000000000 +0900
+++ ghc-7.8.3/aclocal.m4 2014-11-05 12:19:08.530044128 +0900
@@ -408,7 +408,7 @@
)],
[changequote(, )dnl
ARM_ISA=ARMv7
- ARM_ISA_EXT="[VFPv3,NEON]"
+ ARM_ISA_EXT="[VFPv3D16]"
changequote([, ])dnl
])
])

View File

@ -0,0 +1,11 @@
--- ghc-8.2.2/configure.ac~ 2017-11-21 05:22:42.000000000 +0900
+++ ghc-8.2.2/configure.ac 2018-05-28 12:37:35.296728423 +0900
@@ -745,7 +745,7 @@
AC_CACHE_CHECK([for version of sphinx-build], fp_cv_sphinx_version,
changequote(, )dnl
[if test -n "$SPHINXBUILD"; then
- fp_cv_sphinx_version=`"$SPHINXBUILD" --version 2>&1 | sed 's/Sphinx\( (sphinx-build)\)\? v\?\([0-9]\.[0-9]\.[0-9]\)/\2/' | head -n1`;
+ fp_cv_sphinx_version=`"$SPHINXBUILD" --version 2>&1 | sed 's/.* v\?\([0-9]\.[0-9]\.[0-9]\)/\1/' | head -n1`;
fi;
changequote([, ])dnl
])

38
ghc-doc-index Executable file
View File

@ -0,0 +1,38 @@
#!/bin/sh
LOCKFILE=/var/lock/ghc-doc-index.lock
# the lockfile is not meant to be perfect, it's just in case
# two cron scripts get run close to each other to keep
# them from stepping on each other's toes.
if [ -f $LOCKFILE ]; then
echo "Locked with $LOCKFILE"
exit 0
fi
if [ "$(id -u)" != "0" ]; then
echo Need to be root!
exit 1
fi
trap "{ rm -f $LOCKFILE ; exit 255; }" EXIT
touch $LOCKFILE
PKGDIRCACHE=/var/lib/ghc/pkg-dir.cache
LISTING="env LANG=C ls -dl"
# only re-index ghc docs when there are changes
cd /usr/share/doc/ghc/html/libraries
if [ -r "$PKGDIRCACHE" ]; then
$LISTING */ > $PKGDIRCACHE.new
DIR_DIFF=$(diff $PKGDIRCACHE $PKGDIRCACHE.new)
else
$LISTING */ > $PKGDIRCACHE
fi
if [ -x "gen_contents_index" -a ! -r "$PKGDIRCACHE.new" -o -n "$DIR_DIFF" ]; then
./gen_contents_index
fi
if [ -f $PKGDIRCACHE.new ]; then
mv -f $PKGDIRCACHE.new $PKGDIRCACHE
fi

9
ghc-doc-index.cron Executable file
View File

@ -0,0 +1,9 @@
#! /bin/bash
# updates the library documentation index after updates
# This can be disabled by uninstalling ghc-doc-index
# or adding ghc-doc-index to "./jobs-deny".
/usr/bin/ghc-doc-index
exit 0

View File

@ -0,0 +1,10 @@
--- ghc-7.6.3/libraries/gen_contents_index~ 2013-04-19 06:22:46.000000000 +0900
+++ ghc-7.6.3/libraries/gen_contents_index 2013-04-22 12:07:48.922152864 +0900
@@ -60,6 +60,6 @@
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"

228
ghc-pkg.man Normal file
View File

@ -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 <kaol@debian.org>, for the
Debian project (and may be used by others).

View File

@ -0,0 +1,12 @@
--- ghc-8.4.3/mk/warnings.mk~ 2018-02-04 02:30:11.000000000 +0900
+++ ghc-8.4.3/mk/warnings.mk 2018-09-29 14:33:37.607884921 +0900
@@ -1,6 +1,6 @@
# 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.
# It would be better to only exclude certain warnings from becoming errors
Diff finished. Sat Sep 29 14:35:43 2018

1841
ghc.spec Normal file

File diff suppressed because it is too large Load Diff

231
haddock.man Normal file
View File

@ -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 <simonmar@microsoft.com>, Dawid Waern <david.waern@gmail.com>.
All rights reserved.
.SH AUTHOR
This manual page was written by Michael Weber <michaelw@debian.org>
for the Debian GNU/Linux system (but may be used by others).
.\" Local variables:
.\" mode: nroff
.\" End:

10
libraries-versions.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
if [ ! -d libraries ]; then
echo Is CWD a ghc source tree?
exit 1
fi
cd libraries
grep -i ^version: Cabal/Cabal/Cabal.cabal */*.cabal | grep -v -e "\(Win32\|gmp.old\|gmp2\|integer-simple\)" | sed -e "s!/.*: \+!-!"

View File

@ -0,0 +1,22 @@
Description: Do not emit a warning if the .haddock file is missing
As it is quite common on Debian installations to install the -dev package
without the -doc package.
Author: Joachim Breitner <nomeata@debian.org>
Index: ghc-8.0.2/utils/ghc-pkg/Main.hs
===================================================================
--- ghc-8.0.2.orig/utils/ghc-pkg/Main.hs
+++ ghc-8.0.2/utils/ghc-pkg/Main.hs
@@ -1588,8 +1588,10 @@
mapM_ (checkDir True "dynamic-library-dirs") (libraryDynDirs pkg)
mapM_ (checkDir True "include-dirs") (includeDirs pkg)
mapM_ (checkDir True "framework-dirs") (frameworkDirs pkg)
- mapM_ (checkFile True "haddock-interfaces") (haddockInterfaces pkg)
- mapM_ (checkDirURL True "haddock-html") (haddockHTMLs pkg)
+ -- In Debian, it is quite normal that the package is installed without the
+ -- documentation. Do not print a warning there.
+ -- mapM_ (checkFile True "haddock-interfaces") (haddockInterfaces pkg)
+ -- mapM_ (checkDirURL True "haddock-html") (haddockHTMLs pkg)
checkDuplicateModules pkg
checkExposedModules db_stack pkg
checkOtherModules pkg

45
runghc.man Normal file
View File

@ -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 <effie.jayx@gmail.com>. This is free documentation; see the GNU
General Public Licence version 2 or later for copying conditions. There is NO WARRANTY.

View File

@ -0,0 +1 @@
SHA512 (ghc-8.4.4-src.tar.xz) = 685e102eee8cf8b6a377afd7871998c8c368a5da288469367e3fb804aa6109e6f59be5945b8cd3d1e36c851190ea9a7f74c576528589589313d237b721d86da5

View File

@ -0,0 +1,27 @@
Description: Use native x86_64 instructions on x32
This patch enables a few native 64-bit integer instructions
on x32 which are available on this architecture despite using
32-bit pointers. These instructions are present on x86_64 but
not on x86 and ghc checks the size of (void *) to determine
that. This method fails on x32 since despite using 32-bit
pointers and hence sizeof(void *) == 4, it still uses the
full x86_64 instruction set and software-emulated variants
of the aforementioned 64-bit integer instructions are
therefore not present in the toolchain which will make ghc
fail to build on x32.
See: https://ghc.haskell.org/trac/ghc/ticket/11571
.
Index: ghc-8.0.2/rts/RtsSymbols.c
===================================================================
--- ghc-8.0.2.orig/rts/RtsSymbols.c
+++ ghc-8.0.2/rts/RtsSymbols.c
@@ -857,7 +857,7 @@
// 64-bit support functions in libgcc.a
-#if defined(__GNUC__) && SIZEOF_VOID_P <= 4 && !defined(_ABIN32)
+#if defined(__GNUC__) && SIZEOF_VOID_P <= 4 && !defined(_ABIN32) && !(defined(__x86_64__) && defined(__ILP32__))
#define RTS_LIBGCC_SYMBOLS \
SymI_NeedsProto(__divdi3) \
SymI_NeedsProto(__udivdi3) \