Compare commits

...

18 Commits
master ... f36

Author SHA1 Message Date
Fedora Release Engineering 43ca3c7195 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-20 04:22:41 +00:00
Miro Hrončok 379a3830ce Rebuilt for https://fedoraproject.org/wiki/Changes/LIBFFI34 2022-01-08 11:11:19 +01:00
Jens Petersen 9d34518bd2 move zlib-devel Recommends to cabal-install 2021-09-17 18:50:11 +08:00
Jens Petersen 09b2d1dfd3 Revert "opt-out of F35 mass rebuild with noautobuild"
This reverts commit 0c5dec5b3c.
2021-08-04 23:50:04 +08:00
Jens Petersen d010494668 revert back to 8.10.5 with rts patch and without s390x llvm
reduce cpus for post %install scripts for armv7hl
2021-07-23 10:44:05 +08:00
Jens Petersen 0c5dec5b3c opt-out of F35 mass rebuild with noautobuild 2021-07-21 20:22:00 +08:00
Jens Petersen 2c08099dac turn off llvm for s390x again
https://gitlab.haskell.org/ghc/ghc/-/issues/20120
2021-07-19 19:53:53 +08:00
Jens Petersen 872f1cef00 enable llvm backend for s390x and perf build 2021-07-16 00:01:59 +08:00
Jens Petersen a4101c0be4 remove old unused patches 2021-07-15 20:17:29 +08:00
Jens Petersen 499775baf0 revert to ghc-8.10.4 (since ghc-8.10.5 fails to rebuild on s390x) 2021-07-15 20:16:05 +08:00
Jens Petersen f2172368be enable llvm for s390x 2021-07-12 10:26:19 +08:00
Jens Petersen 055d1f9b29 enable quick build for s390x llvm bootstrap 2021-07-12 01:11:07 +08:00
Jens Petersen cc98c023ef remove the debian x32 patch 2021-07-11 23:24:28 +08:00
Jens Petersen a1a8a89e7c rebase to 8.10.5 from ghc:8.10 2021-07-11 21:27:39 +08:00
Jens Petersen bad2a2b5a9 fix build with sphinx4 (#1977317)
use rawstring in conf.py (already in ghc-9)
2021-07-01 00:37:53 +08:00
Jens Petersen 71ccb69965 ghc-compiler now requires ghc-filesystem for html docdirs 2021-05-25 11:44:26 +08:00
Fedora Release Engineering e1bee79cdc - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-26 06:44:33 +00:00
Jens Petersen 58f71ccc9b Add riscv64 to ghc_unregisterized_arches (David Abdurachmanov) 2020-12-12 23:42:02 +08:00
11 changed files with 144 additions and 493 deletions

3
.gitignore vendored
View File

@ -31,3 +31,6 @@ testsuite-6.12.3.tar.bz2
/ghc-8.8.3-src.tar.xz.sig
/ghc-8.8.4-src.tar.xz.sig
/ghc-8.8.4-src.tar.xz
/ghc-8.10.5-src.tar.xz.sig
/ghc-8.10.5-src.tar.xz
/ghc-8.10.4-src.tar.xz.sig

View File

@ -0,0 +1,39 @@
From 296f25fa5f0fce033b529547e0658076e26f4cda Mon Sep 17 00:00:00 2001
From: Adam Sandberg Ericsson <adam@sandbergericsson.se>
Date: Wed, 28 Apr 2021 20:11:52 +0100
Subject: [PATCH] rts: export allocateWrite, freeWrite and markExec #19763
(cherry picked from commit 2d2985a79eec3d6ae9aee96b264c97c2b158f196)
---
rts/RtsSymbols.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/rts/RtsSymbols.c b/rts/RtsSymbols.c
index 9ca696c27c4..d5b8cc5fece 100644
--- a/rts/RtsSymbols.c
+++ b/rts/RtsSymbols.c
@@ -539,11 +539,21 @@
#define RTS_PROF_SYMBOLS /* empty */
#endif
+#if RTS_LINKER_USE_MMAP
+#define RTS_LINKER_USE_MMAP_SYMBOLS \
+ SymI_HasProto(allocateWrite) \
+ SymI_HasProto(freeWrite) \
+ SymI_HasProto(markExec)
+#else
+#define RTS_LINKER_USE_MMAP_SYMBOLS /* empty */
+#endif
+
#define RTS_SYMBOLS \
Maybe_Stable_Names \
RTS_TICKY_SYMBOLS \
RTS_PROF_SYMBOLS \
RTS_LIBDW_SYMBOLS \
+ RTS_LINKER_USE_MMAP_SYMBOLS \
SymI_HasProto(StgReturn) \
SymI_HasProto(stg_gc_noregs) \
SymI_HasProto(stg_ret_v_info) \
--
GitLab

View File

@ -1,277 +0,0 @@
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,8 +1,10 @@
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
Index: ghc-8.10.1/compiler/iface/MkIface.hs
===================================================================
--- ghc-8.10.1.orig/compiler/iface/MkIface.hs
+++ ghc-8.10.1/compiler/iface/MkIface.hs
@@ -679,7 +679,7 @@
iface_hash <- computeFingerprint putNameLiterally
(mod_hash,
ann_fn (mkVarOcc "module"), -- See mkIfaceAnnCache
@ -11,9 +13,9 @@ Forwarded to https://ghc.haskell.org/trac/ghc/ticket/10424
sorted_deps,
mi_hpc iface0)
@@ -714,6 +714,9 @@ addFingerprints hsc_env mb_old_fingerpri
@@ -714,6 +714,9 @@
(non_orph_rules, orph_rules) = mkOrphMap ifRuleOrph (mi_rules iface0)
(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 ]

View File

@ -1,31 +0,0 @@
Description: Allow unregisterised ghc-8.6 to build newer GHC
Commit af9b744bbf1 introduced a regression stopping existing unregisterised
compilers from being able to compile newer versions of GHC. The problem is
that the bootstrap compiler uses the newer `includes/stg/MiscClosures.h` file
where some defines have been renamed, resulting in the following error:
.
error: stg_atomicModifyMutVarzh undeclared (first use in this function); did you mean stg_atomicModifyMutVar2zh?
.
For more information, see https://gitlab.haskell.org/ghc/ghc/issues/17111.
.
This patch can be removed, once ghc-8.6 is no longer the bootstrap compiler.
Author: Ilias Tsitsimpis <iliastsi@debian.org>
Bug: https://gitlab.haskell.org/ghc/ghc/issues/17111
Index: b/includes/stg/MiscClosures.h
===================================================================
--- a/includes/stg/MiscClosures.h
+++ b/includes/stg/MiscClosures.h
@@ -390,8 +390,12 @@ RTS_FUN_DECL(stg_copySmallMutableArrayzh
RTS_FUN_DECL(stg_casSmallArrayzh);
RTS_FUN_DECL(stg_newMutVarzh);
+#if __GLASGOW_HASKELL__ < 808
+RTS_FUN_DECL(stg_atomicModifyMutVarzh);
+#else
RTS_FUN_DECL(stg_atomicModifyMutVar2zh);
RTS_FUN_DECL(stg_atomicModifyMutVarzuzh);
+#endif
RTS_FUN_DECL(stg_casMutVarzh);
RTS_FUN_DECL(stg_isEmptyMVarzh);

View File

@ -1,51 +0,0 @@
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

@ -1,58 +0,0 @@
Description: Allow unregisterised ghc-8.4 to build newer GHC
Commit 4075656e8bb introduced a regression stopping existing unregisteristed
compilers from being able to compile newer versions of GHC. The problem is
that the bootstrap compiler uses the newer `rts/storage/ClosureTypes.h` file
where some defines have been renamed, resulting in the following error:
.
error: stg_MUT_ARR_PTRS_FROZEN0_info undeclared (first use in this function); did you mean stg_MUT_ARR_PTRS_FROZEN_DIRTY_info?
.
For more information, see https://gitlab.haskell.org/ghc/ghc/issues/15913.
.
This patch can be removed, once ghc-8.4 is no longer the bootstrap compiler.
Author: Ilias Tsitsimpis <iliastsi@debian.org>
Bug: https://gitlab.haskell.org/ghc/ghc/issues/15913
Bug-Debian: https://bugs.debian.org/932941
Index: b/includes/rts/storage/ClosureTypes.h
===================================================================
--- a/includes/rts/storage/ClosureTypes.h
+++ b/includes/rts/storage/ClosureTypes.h
@@ -82,5 +82,11 @@
#define SMALL_MUT_ARR_PTRS_DIRTY 60
#define SMALL_MUT_ARR_PTRS_FROZEN_DIRTY 61
#define SMALL_MUT_ARR_PTRS_FROZEN_CLEAN 62
+#if __GLASGOW_HASKELL__ < 806
+#define SMALL_MUT_ARR_PTRS_FROZEN0 SMALL_MUT_ARR_PTRS_FROZEN_DIRTY
+#define SMALL_MUT_ARR_PTRS_FROZEN SMALL_MUT_ARR_PTRS_FROZEN_CLEAN
+#define MUT_ARR_PTRS_FROZEN0 MUT_ARR_PTRS_FROZEN_DIRTY
+#define MUT_ARR_PTRS_FROZEN MUT_ARR_PTRS_FROZEN_CLEAN
+#endif
#define COMPACT_NFDATA 63
#define N_CLOSURE_TYPES 64
Index: b/includes/stg/MiscClosures.h
===================================================================
--- a/includes/stg/MiscClosures.h
+++ b/includes/stg/MiscClosures.h
@@ -116,12 +116,22 @@ RTS_ENTRY(stg_ARR_WORDS);
RTS_ENTRY(stg_MUT_ARR_WORDS);
RTS_ENTRY(stg_MUT_ARR_PTRS_CLEAN);
RTS_ENTRY(stg_MUT_ARR_PTRS_DIRTY);
+#if __GLASGOW_HASKELL__ < 806
+RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN);
+RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN0);
+#else
RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN_CLEAN);
RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN_DIRTY);
+#endif
RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_CLEAN);
RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_DIRTY);
+#if __GLASGOW_HASKELL__ < 806
+RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_FROZEN);
+RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_FROZEN0);
+#else
RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_FROZEN_CLEAN);
RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_FROZEN_DIRTY);
+#endif
RTS_ENTRY(stg_MUT_VAR_CLEAN);
RTS_ENTRY(stg_MUT_VAR_DIRTY);
RTS_ENTRY(stg_END_TSO_QUEUE);

View File

@ -0,0 +1,11 @@
--- ghc-8.8.4/docs/users_guide/conf.py~ 2020-07-09 00:43:03.000000000 +0800
+++ ghc-8.8.4/docs/users_guide/conf.py 2021-07-01 00:09:03.537324304 +0800
@@ -77,7 +77,7 @@
latex_elements = {
'inputenc': '',
'utf8extra': '',
- 'preamble': '''
+ 'preamble': r'''
\usepackage{fontspec}
\usepackage{makeidx}
\setsansfont{DejaVu Sans}

124
ghc.spec
View File

@ -8,7 +8,7 @@
# to handle RCs
%global ghc_release %{version}
%global base_ver 4.13.0.0
%global base_ver 4.14.2.0
# build profiling libraries
# build haddock
@ -19,6 +19,7 @@
%bcond_with perf_build
%undefine _enable_debug_packages
%else
%bcond_without ghc_prof
%bcond_without haddock
%bcond_without perf_build
%endif
@ -37,19 +38,19 @@
# no longer build testsuite (takes time and not really being used)
%bcond_with testsuite
# 8.8 needs llvm-7.0
%global llvm_major 7.0
# 8.10.5 can use llvm 9-12
%global llvm_major 11
%global ghc_llvm_archs armv7hl aarch64
%global ghc_unregisterized_arches s390 s390x %{mips}
%global ghc_unregisterized_arches s390 s390x %{mips} riscv64
Name: ghc
Version: 8.8.4
Version: 8.10.5
# Since library subpackages are versioned:
# - release can only be reset if *all* library versions get bumped simultaneously
# (sometimes after a major release)
# - minor release numbers for a branch should be incremented monotonically
Release: 108%{?dist}
Release: 117%{?dist}
Summary: Glasgow Haskell Compiler
License: BSD and HaskellReport
@ -63,21 +64,24 @@ Source5: ghc-pkg.man
Source6: haddock.man
Source7: runghc.man
# absolute haddock path (was for html/libraries -> libraries)
Patch1: ghc-gen_contents_index-haddock-path.patch
Patch2: ghc-Cabal-install-PATH-warning.patch
Patch3: ghc-gen_contents_index-nodocs.patch
Patch1: ghc-gen_contents_index-haddock-path.patch
Patch2: ghc-Cabal-install-PATH-warning.patch
Patch3: ghc-gen_contents_index-nodocs.patch
# https://phabricator.haskell.org/rGHC4eebc8016f68719e1ccdf460754a97d1f4d6ef05
Patch6: ghc-8.6.3-sphinx-1.8.patch
# https://gitlab.haskell.org/ghc/ghc/-/issues/19763
# https://gitlab.haskell.org/ghc/ghc/-/merge_requests/5915
Patch7: https://gitlab.haskell.org/ghc/ghc/-/commit/296f25fa5f0fce033b529547e0658076e26f4cda.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1977317
Patch8: ghc-userguide-sphinx4.patch
# Arch dependent patches
# arm
Patch12: ghc-armv7-VFPv3D16--NEON.patch
# for unregisterized (s390x)
# for unregisterized
# https://ghc.haskell.org/trac/ghc/ticket/15689
Patch15: ghc-warnings.mk-CC-Wall.patch
Patch16: fix-build-using-unregisterised-v8.6.patch
# bigendian (s390x and ppc64)
# https://gitlab.haskell.org/ghc/ghc/issues/15411
@ -91,19 +95,18 @@ Patch18: Disable-unboxed-arrays.patch
# Debian patches:
Patch24: buildpath-abi-stability.patch
Patch26: no-missing-haddock-file-warning.patch
Patch28: x32-use-native-x86_64-insn.patch
# fedora ghc has been bootstrapped on
# %%{ix86} x86_64 ppc ppc64 armv7hl s390 s390x ppc64le aarch64
# and retired arches: alpha sparcv9 armv5tel
# see also deprecated ghc_arches defined in /etc/rpm/macros.ghc-srpm by redhat-rpm-macros
BuildRequires: ghc-compiler > 8.4
BuildRequires: ghc-compiler > 8.6
# for ABI hash checking
%if %{with abicheck}
BuildRequires: ghc
%endif
BuildRequires: ghc-rpm-macros-extra >= 2.0.6
BuildRequires: ghc-rpm-macros-extra
BuildRequires: ghc-binary-devel
BuildRequires: ghc-bytestring-devel
BuildRequires: ghc-containers-devel
@ -113,6 +116,7 @@ BuildRequires: ghc-process-devel
BuildRequires: ghc-transformers-devel
BuildRequires: alex
BuildRequires: gmp-devel
BuildRequires: hscolour
BuildRequires: libffi-devel
BuildRequires: make
# for terminfo
@ -138,8 +142,8 @@ BuildRequires: autoconf, automake
#BuildRequires: gnupg2
%endif
Requires: ghc-compiler = %{version}-%{release}
Requires: ghc-ghc-devel = %{version}-%{release}
Requires: ghc-devel = %{version}-%{release}
Requires: ghc-ghc-devel = %{version}-%{release}
%if %{with haddock}
Suggests: ghc-doc = %{version}-%{release}
Suggests: ghc-doc-index = %{version}-%{release}
@ -150,7 +154,6 @@ Suggests: ghc-manual = %{version}-%{release}
%if %{with ghc_prof}
Suggests: ghc-prof = %{version}-%{release}
%endif
Recommends: zlib-devel
%description
GHC is a state-of-the-art, open source, compiler and interactive environment
@ -180,6 +183,7 @@ Summary: GHC compiler and utilities
License: BSD
Requires: gcc%{?_isa}
Requires: ghc-base-devel%{?_isa} = %{base_ver}-%{release}
Requires: ghc-filesystem
%if %{without haddock}
# added during f31
Obsoletes: ghc-doc-index < %{version}-%{release}
@ -236,41 +240,42 @@ This package provides the User Guide and Haddock manual.
# use "./libraries-versions.sh" to check versions
%if %{defined ghclibdir}
%ghc_lib_subpackage -d -l BSD Cabal-3.0.1.0
%ghc_lib_subpackage -d -l BSD Cabal-3.2.1.0
%ghc_lib_subpackage -d -l %BSDHaskellReport array-0.5.4.0
%ghc_lib_subpackage -d -l %BSDHaskellReport -c gmp-devel%{?_isa},libffi-devel%{?_isa} base-%{base_ver}
%ghc_lib_subpackage -d -l BSD binary-0.8.7.0
%ghc_lib_subpackage -d -l BSD bytestring-0.10.10.1
%ghc_lib_subpackage -d -l %BSDHaskellReport containers-0.6.2.1
%ghc_lib_subpackage -d -l BSD binary-0.8.8.0
%ghc_lib_subpackage -d -l BSD bytestring-0.10.12.0
%ghc_lib_subpackage -d -l %BSDHaskellReport containers-0.6.4.1
%ghc_lib_subpackage -d -l %BSDHaskellReport deepseq-1.4.4.0
%ghc_lib_subpackage -d -l %BSDHaskellReport directory-1.3.6.0
%ghc_lib_subpackage -d -l %BSDHaskellReport exceptions-0.10.4
%ghc_lib_subpackage -d -l BSD filepath-1.4.2.1
# in ghc not ghc-libraries:
%ghc_lib_subpackage -d -x ghc-%{ghc_version_override}
%ghc_lib_subpackage -d -x -l BSD ghc-boot-%{ghc_version_override}
%ghc_lib_subpackage -d -l BSD ghc-boot-th-%{ghc_version_override}
%ghc_lib_subpackage -d -l BSD ghc-compact-0.1.0.0
%ghc_lib_subpackage -d -l BSD ghc-heap-%{ghc_version_override}
# see below for ghc-prim
%ghc_lib_subpackage -d -l BSD haskeline-0.7.5.0
%ghc_lib_subpackage -d -l BSD hpc-0.6.0.3
%ghc_lib_subpackage -d -l BSD -x ghci-%{ghc_version_override}
%ghc_lib_subpackage -d -l BSD haskeline-0.8.0.1
%ghc_lib_subpackage -d -l BSD hpc-0.6.1.0
# see below for integer-gmp
%ghc_lib_subpackage -d -l %BSDHaskellReport libiserv-%{ghc_version_override}
%ghc_lib_subpackage -d -l BSD mtl-2.2.2
%ghc_lib_subpackage -d -l BSD parsec-3.1.14.0
%ghc_lib_subpackage -d -l BSD pretty-1.1.3.6
%ghc_lib_subpackage -d -l %BSDHaskellReport process-1.6.9.0
%ghc_lib_subpackage -d -l BSD stm-2.5.0.0
%ghc_lib_subpackage -d -l BSD template-haskell-2.15.0.0
%ghc_lib_subpackage -d -l BSD stm-2.5.0.1
%ghc_lib_subpackage -d -l BSD template-haskell-2.16.0.0
%ghc_lib_subpackage -d -l BSD -c ncurses-devel%{?_isa} terminfo-0.4.1.4
%ghc_lib_subpackage -d -l BSD text-1.2.4.0
%ghc_lib_subpackage -d -l BSD text-1.2.4.1
%ghc_lib_subpackage -d -l BSD time-1.9.3
%ghc_lib_subpackage -d -l BSD transformers-0.5.6.2
%ghc_lib_subpackage -d -l BSD unix-2.7.2.2
%if %{with haddock}
%ghc_lib_subpackage -d -l BSD xhtml-3000.2.2.1
%endif
# in ghc not ghc-devel:
%ghc_lib_subpackage -d -x ghc-%{ghc_version_override}
%ghc_lib_subpackage -d -x -l BSD ghc-boot-%{ghc_version_override}
%ghc_lib_subpackage -d -x -l BSD ghci-%{ghc_version_override}
%endif
%global version %{ghc_version_override}
@ -311,6 +316,8 @@ packages to be automatically installed too.
%patch2 -p1 -b .orig
%patch6 -p1 -b .orig
%patch7 -p1 -b .orig
%patch8 -p1 -b .orig
rm -r libffi-tarballs
@ -318,9 +325,9 @@ rm -r libffi-tarballs
%patch12 -p1 -b .orig
%endif
%ifarch %{ghc_unregisterized_arches}
# remove s390x after switching to llvm
%ifarch %{ghc_unregisterized_arches} s390x
%patch15 -p1 -b .orig
%patch16 -p1 -b .orig
%endif
# bigendian
@ -331,7 +338,6 @@ rm -r libffi-tarballs
# debian
%patch24 -p1 -b .orig
%patch26 -p1 -b .orig
%patch28 -p1 -b .orig
%global gen_contents_index gen_contents_index.orig
%if %{with haddock}
@ -444,8 +450,8 @@ echo "%{ghclibdir}/include" >> ghc-base-devel.files
%ghc_gen_filelists ghc-boot %{ghc_version_override}
%ghc_gen_filelists ghc %{ghc_version_override}
%ghc_gen_filelists ghci %{ghc_version_override}
%ghc_gen_filelists ghc-prim 0.5.3
%ghc_gen_filelists integer-gmp 1.0.2.0
%ghc_gen_filelists ghc-prim 0.6.1
%ghc_gen_filelists integer-gmp 1.0.3.0
%define merge_filelist()\
cp -p libraries/%1/LICENSE libraries/LICENSE.%1\
@ -481,6 +487,11 @@ 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
%ifarch armv7hl
export RPM_BUILD_NCPUS=1
%endif
%check
export LANG=en_US.utf8
# stolen from ghc6/debian/rules:
@ -562,7 +573,7 @@ env -C %{ghc_html_libraries_dir} ./gen_contents_index
%files compiler
%license LICENSE
%doc ANNOUNCE
%doc README.md
%{_bindir}/ghc
%{_bindir}/ghc-%{version}
%{_bindir}/ghc-pkg
@ -586,9 +597,6 @@ env -C %{ghc_html_libraries_dir} ./gen_contents_index
%{ghclibdir}/bin/ghc-iserv-prof
%endif
%{ghclibdir}/bin/runghc
%ifnarch %{ghc_unregisterized_arches}
%{ghclibdir}/bin/ghc-split
%endif
%{ghclibdir}/bin/hp2ps
%{ghclibdir}/bin/unlit
%{ghclibdir}/ghc-usage.txt
@ -601,8 +609,6 @@ env -C %{ghc_html_libraries_dir} ./gen_contents_index
%{ghclibdir}/platformConstants
%{ghclibdir}/settings
%{ghclibdir}/template-hsc.h
%dir %{_docdir}/ghc
%dir %{ghc_html_dir}
%{_mandir}/man1/ghc-pkg.1*
%{_mandir}/man1/haddock.1*
%{_mandir}/man1/runghc.1*
@ -613,7 +619,6 @@ env -C %{ghc_html_libraries_dir} ./gen_contents_index
%{ghclibdir}/bin/haddock
%{ghclibdir}/html
%{ghclibdir}/latex
%dir %{ghc_html_dir}/libraries
%{ghc_html_dir}/libraries/gen_contents_index
%{ghc_html_dir}/libraries/prologue.txt
%ghost %{ghc_html_dir}/libraries/doc-index*.html
@ -623,6 +628,7 @@ env -C %{ghc_html_libraries_dir} ./gen_contents_index
%ghost %{ghc_html_dir}/libraries/index*.html
%ghost %{ghc_html_dir}/libraries/linuwial.css
%ghost %{ghc_html_dir}/libraries/minus.gif
%ghost %{ghc_html_dir}/libraries/new-ocean.css
%ghost %{ghc_html_dir}/libraries/ocean.css
%ghost %{ghc_html_dir}/libraries/plus.gif
%ghost %{ghc_html_dir}/libraries/quick-jump.css
@ -657,6 +663,40 @@ env -C %{ghc_html_libraries_dir} ./gen_contents_index
%changelog
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 8.10.5-117
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Sat Jan 08 2022 Miro Hrončok <mhroncok@redhat.com> - 8.10.5-116
- Rebuilt for https://fedoraproject.org/wiki/Changes/LIBFFI34
* Fri Sep 17 2021 Jens Petersen <petersen@redhat.com>
- move zlib-devel Recommends to cabal-install
* Thu Jul 22 2021 Jens Petersen <petersen@redhat.com> - 8.10.5-115
- update to 8.10.5 with patch for missing rts symbols
- use llvm 11 for ARM
- https://downloads.haskell.org/~ghc/8.10.5/docs/html/users_guide/8.10.5-notes.html
* Thu Jul 15 2021 Jens Petersen <petersen@redhat.com> - 8.10.4-114
- perf build
* Thu Jul 15 2021 Jens Petersen <petersen@redhat.com> - 8.10.4-113
- rebase to 8.10.4 from ghc:8.10 module stream
- https://downloads.haskell.org/ghc/8.10.4/docs/html/users_guide/8.10.1-notes.html
- use llvm10 for ARM
* Wed Jun 30 2021 Jens Petersen <petersen@redhat.com> - 8.8.4-111
- fix build with sphinx4 (#1977317)
* Tue May 25 2021 Jens Petersen <petersen@redhat.com> - 8.8.4-110
- ghc-compiler now requires ghc-filesystem for html docdirs
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 8.8.4-109
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Dec 02 2020 David Abdurachmanov <david.abdurachmanov@sifive.com>
- Add riscv64 to ghc_unregisterized_arches
* Tue Aug 18 2020 Troy Dawson <tdawson@redhat.com> - 8.8.4-108
- Cleanup old %if statements

View File

@ -1,2 +1,2 @@
SHA512 (ghc-8.8.4-src.tar.xz.sig) = 1ed2e64e8b75a147d7c66b0018119f54ac740131b6f74612aa975c9120d8f7a8a2286829cef22ef2cd16262af0604659daa41c09ef3bdec6c22b8d086fbc1166
SHA512 (ghc-8.8.4-src.tar.xz) = efd23bd819f7429486696a3a929a040471db7ea8a2d1f1d832e4cf0825b9e1e0c5e6ecad0ab8376f58b74e9c28c1d2f773bd126596d6d853c9e57d57e5ceb090
SHA512 (ghc-8.10.5-src.tar.xz.sig) = c9d1abf8f4065c1935be877b4978638130307afbfef988ac16d7c972e502b71056a5e5acc1b54b903d8f939a0f2e3ec4ad953cdc7a9ce21024f398ce84cfb2da
SHA512 (ghc-8.10.5-src.tar.xz) = b5f39be0accd5c1cecf1cc326ba3142f561d2ac93e9abf366fe46307d7c0712aac244836e659e1a4d9d0fb98299ea96edc8e8a06f3a81b528b14914b94057ffe

View File

@ -1,27 +0,0 @@
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) \