Compare commits
100 Commits
master
...
main-riscv
Author | SHA1 | Date | |
---|---|---|---|
437025a4db | |||
0a7f7b22d5 | |||
|
63a2061ee7 | ||
|
2c11fbebc0 | ||
|
c1d77a5759 | ||
|
5bda6f7d57 | ||
21c896f4bc | |||
ebb2ee7214 | |||
|
3797e2ad85 | ||
|
b9119ce1a9 | ||
|
6253449ed3 | ||
|
f3741279b3 | ||
|
204697fda0 | ||
3a0e032d3f | |||
1f4e4e2818 | |||
2f5be1a71c | |||
69494acec6 | |||
|
af12036cab | ||
|
24eeb06d7d | ||
|
afd169846d | ||
|
029e0a3682 | ||
|
7b4a7ac6f8 | ||
|
751bee0355 | ||
|
d003c8c955 | ||
|
2b31b684ce | ||
|
624ff1fac9 | ||
|
0f90ec3d22 | ||
|
d7c965e2be | ||
|
7fa56d508e | ||
|
1b7335d495 | ||
|
f7e9d694be | ||
|
74ee6275c8 | ||
|
ff8deba8f3 | ||
|
97598e8801 | ||
|
407afb0113 | ||
|
b5cf727954 | ||
|
17c6346a25 | ||
|
80e2008e81 | ||
|
aa1f6bd3d7 | ||
|
b5d643a65e | ||
|
1026d3dcb9 | ||
|
12e492c7ee | ||
|
fc6aef5532 | ||
|
5d91d09b6f | ||
|
f0b4448eb6 | ||
|
6ad54b8225 | ||
|
1c6ff01623 | ||
|
9b70e66d38 | ||
|
0b223c6fe8 | ||
|
e9399b13bb | ||
|
eea1f6cad7 | ||
|
608b9ae719 | ||
|
e3d6c97334 | ||
|
ce8a0ee17f | ||
|
5cbb28b98c | ||
|
a028d88f6f | ||
|
2a8e5b4268 | ||
|
c7637d9d11 | ||
|
eef765975c | ||
|
639b07bccd | ||
|
d8c7935735 | ||
|
46f60c5540 | ||
|
0c150de12d | ||
|
04d947cd74 | ||
|
24f60eba3d | ||
|
206ca11ac0 | ||
|
a33ef3fd51 | ||
|
feb7f7069e | ||
|
c315c79429 | ||
|
f92afecbee | ||
|
a15483db6e | ||
|
2cf80b12e6 | ||
|
fbe8f0f8e3 | ||
|
ba0880ec2a | ||
|
d85561818a | ||
|
682df27912 | ||
|
5dfb2bd4d6 | ||
|
d695d12eb5 | ||
|
4a785f1067 | ||
|
08f84177dc | ||
|
88eb3f9143 | ||
|
aafa21cdc2 | ||
|
43ca3c7195 | ||
|
379a3830ce | ||
|
9d34518bd2 | ||
|
09b2d1dfd3 | ||
|
d010494668 | ||
|
0c5dec5b3c | ||
|
2c08099dac | ||
|
872f1cef00 | ||
|
a4101c0be4 | ||
|
499775baf0 | ||
|
f2172368be | ||
|
055d1f9b29 | ||
|
cc98c023ef | ||
|
a1a8a89e7c | ||
|
bad2a2b5a9 | ||
|
71ccb69965 | ||
|
e1bee79cdc | ||
|
58f71ccc9b |
13
.gitignore
vendored
13
.gitignore
vendored
@ -31,3 +31,16 @@ testsuite-6.12.3.tar.bz2
|
|||||||
/ghc-8.8.3-src.tar.xz.sig
|
/ghc-8.8.3-src.tar.xz.sig
|
||||||
/ghc-8.8.4-src.tar.xz.sig
|
/ghc-8.8.4-src.tar.xz.sig
|
||||||
/ghc-8.8.4-src.tar.xz
|
/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
|
||||||
|
/ghc-8.10.7-src.tar.xz
|
||||||
|
/ghc-8.10.7-src.tar.xz.sig
|
||||||
|
/ghc-9.0.2-src.tar.xz
|
||||||
|
/ghc-9.0.2-src.tar.xz.sig
|
||||||
|
/ghc-9.2.5-src.tar.xz
|
||||||
|
/ghc-9.2.5-src.tar.xz.sig
|
||||||
|
/ghc-9.2.6-src.tar.xz
|
||||||
|
/ghc-9.2.6-src.tar.xz.sig
|
||||||
|
/ghc-9.4.5-src.tar.xz
|
||||||
|
/ghc-9.4.5-src.tar.xz.sig
|
||||||
|
44
00dc51060881df81258ba3b3bdf447294618a4de.patch
Normal file
44
00dc51060881df81258ba3b3bdf447294618a4de.patch
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
From 00dc51060881df81258ba3b3bdf447294618a4de Mon Sep 17 00:00:00 2001
|
||||||
|
From: Matthew Pickering <matthewtpickering@gmail.com>
|
||||||
|
Date: Tue, 3 Jan 2023 15:56:37 +0000
|
||||||
|
Subject: [PATCH] sphinx: Use modern syntax for extlinks
|
||||||
|
|
||||||
|
This fixes the following build error:
|
||||||
|
|
||||||
|
```
|
||||||
|
Command line: /opt/homebrew/opt/sphinx-doc/bin/sphinx-build -b man -d /private/tmp/extra-dir-55768274273/.doctrees-man -n -w /private/tmp/extra-dir-55768274273/.log docs/users_guide /private/tmp/extra-dir-55768274273
|
||||||
|
===> Command failed with error code: 2
|
||||||
|
|
||||||
|
Exception occurred:
|
||||||
|
File "/opt/homebrew/Cellar/sphinx-doc/6.0.0/libexec/lib/python3.11/site-packages/sphinx/ext/extlinks.py", line 101, in role
|
||||||
|
title = caption % part
|
||||||
|
~~~~~~~~^~~~~~
|
||||||
|
TypeError: not all arguments converted during string formatting
|
||||||
|
```
|
||||||
|
|
||||||
|
I tested on Sphinx-5.1.1 and Sphinx-6.0.0
|
||||||
|
|
||||||
|
Thanks for sterni for providing instructions about how to test using
|
||||||
|
sphinx-6.0.0.
|
||||||
|
|
||||||
|
Fixes #22690
|
||||||
|
---
|
||||||
|
docs/users_guide/ghc_config.py.in | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/docs/users_guide/ghc_config.py.in b/docs/users_guide/ghc_config.py.in
|
||||||
|
index dcc7fbaef62..c9888a13adc 100644
|
||||||
|
--- a/docs/users_guide/ghc_config.py.in
|
||||||
|
+++ b/docs/users_guide/ghc_config.py.in
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
extlinks = {
|
||||||
|
- 'ghc-ticket': ('https://gitlab.haskell.org/ghc/ghc/issues/%s', '#'),
|
||||||
|
- 'ghc-wiki': ('https://gitlab.haskell.org/ghc/ghc/wikis/%s', '#'),
|
||||||
|
+ 'ghc-ticket': ('https://gitlab.haskell.org/ghc/ghc/issues/%s', '#%s'),
|
||||||
|
+ 'ghc-wiki': ('https://gitlab.haskell.org/ghc/ghc/wikis/%s', '%s'),
|
||||||
|
}
|
||||||
|
|
||||||
|
libs_base_uri = '../libraries'
|
||||||
|
--
|
||||||
|
GitLab
|
||||||
|
|
2380
10453.patch
Normal file
2380
10453.patch
Normal file
File diff suppressed because it is too large
Load Diff
37
10922.patch
Normal file
37
10922.patch
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
From 2e6447e073144b9b1352d5167f67ccd07460444a Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jens Petersen <petersen@redhat.com>
|
||||||
|
Date: Thu, 20 Jul 2023 13:16:03 +0800
|
||||||
|
Subject: [PATCH] user_guide/flags.py: python-3.12 no longer includes distutils
|
||||||
|
|
||||||
|
packaging.version seems able to handle this fine
|
||||||
|
---
|
||||||
|
docs/users_guide/flags.py | 6 +++---
|
||||||
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/docs/users_guide/flags.py b/docs/users_guide/flags.py
|
||||||
|
index f6927d59817..474d1b65d4b 100644
|
||||||
|
--- a/docs/users_guide/flags.py
|
||||||
|
+++ b/docs/users_guide/flags.py
|
||||||
|
@@ -50,7 +50,7 @@ import sphinx
|
||||||
|
from sphinx import addnodes
|
||||||
|
from sphinx.domains.std import GenericObject
|
||||||
|
from sphinx.errors import SphinxError
|
||||||
|
-from distutils.version import LooseVersion
|
||||||
|
+from packaging.version import parse
|
||||||
|
from utils import build_table_from_list
|
||||||
|
|
||||||
|
import os.path
|
||||||
|
@@ -628,8 +628,8 @@ def purge_flags(app, env, docname):
|
||||||
|
|
||||||
|
def setup(app):
|
||||||
|
# The override argument to add_directive_to_domain is only supported by >= 1.8
|
||||||
|
- sphinx_version = LooseVersion(sphinx.__version__)
|
||||||
|
- override_arg = {'override': True} if sphinx_version >= LooseVersion('1.8') else {}
|
||||||
|
+ sphinx_version = parse(sphinx.__version__)
|
||||||
|
+ override_arg = {'override': True} if sphinx_version >= parse('1.8') else {}
|
||||||
|
|
||||||
|
# Add ghc-flag directive, and override the class with our own
|
||||||
|
app.add_object_type('ghc-flag', 'ghc-flag')
|
||||||
|
--
|
||||||
|
GitLab
|
||||||
|
|
42
10928.patch
Normal file
42
10928.patch
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
From 5ce7496dba3368faa5088c88168f0f4d69cff32b Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jens Petersen <petersen@redhat.com>
|
||||||
|
Date: Fri, 21 Jul 2023 15:26:16 +0800
|
||||||
|
Subject: [PATCH] make hadrian buildable with Cabal-3.8
|
||||||
|
|
||||||
|
---
|
||||||
|
hadrian/hadrian.cabal | 2 +-
|
||||||
|
hadrian/src/Hadrian/Haskell/Cabal/Parse.hs | 4 ++++
|
||||||
|
2 files changed, 5 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/hadrian/hadrian.cabal b/hadrian/hadrian.cabal
|
||||||
|
index c37974914a9..eb5690bbd1a 100644
|
||||||
|
--- a/hadrian/hadrian.cabal
|
||||||
|
+++ b/hadrian/hadrian.cabal
|
||||||
|
@@ -147,7 +147,7 @@ executable hadrian
|
||||||
|
, BangPatterns
|
||||||
|
other-extensions: MultiParamTypeClasses
|
||||||
|
, TypeFamilies
|
||||||
|
- build-depends: Cabal >= 3.2 && < 3.7
|
||||||
|
+ build-depends: Cabal >= 3.2 && < 3.9
|
||||||
|
, base >= 4.8 && < 5
|
||||||
|
, bytestring >= 0.10 && < 0.12
|
||||||
|
, containers >= 0.5 && < 0.7
|
||||||
|
diff --git a/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs b/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs
|
||||||
|
index 079f675b6ea..2d262a36445 100644
|
||||||
|
--- a/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs
|
||||||
|
+++ b/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs
|
||||||
|
@@ -23,7 +23,11 @@ import qualified Distribution.ModuleName as C
|
||||||
|
import qualified Distribution.Package as C
|
||||||
|
import qualified Distribution.PackageDescription as C
|
||||||
|
import qualified Distribution.PackageDescription.Configuration as C
|
||||||
|
+#if MIN_VERSION_Cabal(3,8,0)
|
||||||
|
+import qualified Distribution.Simple.PackageDescription as C
|
||||||
|
+#else
|
||||||
|
import qualified Distribution.PackageDescription.Parsec as C
|
||||||
|
+#endif
|
||||||
|
import qualified Distribution.Simple.Compiler as C
|
||||||
|
import qualified Distribution.Simple.Program.Db as C
|
||||||
|
import qualified Distribution.Simple as C
|
||||||
|
--
|
||||||
|
GitLab
|
||||||
|
|
31
11662.patch
Normal file
31
11662.patch
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
From bed85f7bc358fdca4677a3070b94ea544bb9e7ff Mon Sep 17 00:00:00 2001
|
||||||
|
From: Stefan Schulze Frielinghaus <stefansf@linux.ibm.com>
|
||||||
|
Date: Mon, 27 Nov 2023 12:34:47 +0100
|
||||||
|
Subject: [PATCH] llvmGen: Align objects in the data section
|
||||||
|
|
||||||
|
Objects in the data section may be referenced via tagged pointers.
|
||||||
|
Thus, align those objects to a 4- or 8-byte boundary for 32- or 64-bit
|
||||||
|
platforms, respectively. Note, this may need to be reconsidered if
|
||||||
|
objects with a greater natural alignment requirement are emitted as e.g.
|
||||||
|
128-bit atomics.
|
||||||
|
|
||||||
|
Fixes #24163.
|
||||||
|
---
|
||||||
|
compiler/GHC/CmmToLlvm/Data.hs | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
diff --git a/compiler/GHC/CmmToLlvm/Data.hs b/compiler/GHC/CmmToLlvm/Data.hs
|
||||||
|
index caac121413c..5e8912e3bc7 100644
|
||||||
|
--- a/compiler/GHC/CmmToLlvm/Data.hs
|
||||||
|
+++ b/compiler/GHC/CmmToLlvm/Data.hs
|
||||||
|
@@ -89,6 +89,7 @@ genLlvmData (sec, CmmStaticsRaw lbl xs) = do
|
||||||
|
align = case sec of
|
||||||
|
Section CString _ -> if (platformArch platform == ArchS390X)
|
||||||
|
then Just 2 else Just 1
|
||||||
|
+ Section Data _ -> Just $ platformWordSizeInBytes platform
|
||||||
|
_ -> Nothing
|
||||||
|
const = if sectionProtection sec == ReadOnlySection
|
||||||
|
then Constant else Global
|
||||||
|
--
|
||||||
|
GitLab
|
||||||
|
|
35
5725.patch
Normal file
35
5725.patch
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
From 7cfa6f3114168797cf1fa7faa4ffe6c06b73f149 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Peter Trommler <ptrommler@acm.org>
|
||||||
|
Date: Tue, 11 May 2021 20:52:01 +0200
|
||||||
|
Subject: [PATCH] Hadrian: Enable SMP on powerpc64{le}
|
||||||
|
|
||||||
|
Fixes #19825
|
||||||
|
---
|
||||||
|
hadrian/src/Oracles/Flag.hs | 11 ++++++++++-
|
||||||
|
1 file changed, 10 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/hadrian/src/Oracles/Flag.hs b/hadrian/src/Oracles/Flag.hs
|
||||||
|
index 86521e4aa8a..1b3aff693eb 100644
|
||||||
|
--- a/hadrian/src/Oracles/Flag.hs
|
||||||
|
+++ b/hadrian/src/Oracles/Flag.hs
|
||||||
|
@@ -70,7 +70,16 @@ targetSupportsSMP :: Action Bool
|
||||||
|
targetSupportsSMP = do
|
||||||
|
unreg <- flag GhcUnregisterised
|
||||||
|
armVer <- targetArmVersion
|
||||||
|
- goodArch <- anyTargetArch ["i386", "x86_64", "sparc", "powerpc", "arm", "aarch64", "s390x", "riscv64"]
|
||||||
|
+ goodArch <- anyTargetArch ["i386"
|
||||||
|
+ , "x86_64"
|
||||||
|
+ , "sparc"
|
||||||
|
+ , "powerpc"
|
||||||
|
+ , "powerpc64"
|
||||||
|
+ , "powerpc64le"
|
||||||
|
+ , "arm"
|
||||||
|
+ , "aarch64"
|
||||||
|
+ , "s390x"
|
||||||
|
+ , "riscv64"]
|
||||||
|
if -- The THREADED_RTS requires `BaseReg` to be in a register and the
|
||||||
|
-- Unregisterised mode doesn't allow that.
|
||||||
|
| unreg -> return False
|
||||||
|
--
|
||||||
|
GitLab
|
||||||
|
|
48
6e12e3c178fe9ad16131eb3c089bd6578976f5d6.patch
Normal file
48
6e12e3c178fe9ad16131eb3c089bd6578976f5d6.patch
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
From 6e12e3c178fe9ad16131eb3c089bd6578976f5d6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Ben Gamari <ben@smart-cactus.org>
|
||||||
|
Date: Tue, 3 May 2022 13:48:56 -0400
|
||||||
|
Subject: [PATCH] configure: Check for ffi.h
|
||||||
|
|
||||||
|
As noted in #21485, we checked for ffi.h yet then failed to throw an
|
||||||
|
error if it is missing.
|
||||||
|
|
||||||
|
Fixes #21485.
|
||||||
|
---
|
||||||
|
m4/fp_find_libffi.m4 | 13 ++++++++++---
|
||||||
|
1 file changed, 10 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/m4/fp_find_libffi.m4 b/m4/fp_find_libffi.m4
|
||||||
|
index ddc511553c8..bf52afefbb8 100644
|
||||||
|
--- a/m4/fp_find_libffi.m4
|
||||||
|
+++ b/m4/fp_find_libffi.m4
|
||||||
|
@@ -49,6 +49,7 @@ AC_DEFUN([FP_FIND_LIBFFI],
|
||||||
|
CFLAGS="$LIBFFI_CFLAGS $CFLAGS"
|
||||||
|
LDFLAGS2="$LDFLAGS"
|
||||||
|
LDFLAGS="$LIBFFI_LDFLAGS $LDFLAGS"
|
||||||
|
+
|
||||||
|
if test "$HostOS" = "openbsd";
|
||||||
|
then
|
||||||
|
# OpenBSD's libffi is not directly linked to the libpthread but
|
||||||
|
@@ -58,10 +59,16 @@ AC_DEFUN([FP_FIND_LIBFFI],
|
||||||
|
# symbols.
|
||||||
|
LDFLAGS="$LDFLAGS -lpthread"
|
||||||
|
fi
|
||||||
|
+
|
||||||
|
AC_CHECK_LIB(ffi, ffi_call,
|
||||||
|
- [AC_CHECK_HEADERS([ffi.h], [break], [])
|
||||||
|
- AC_DEFINE([HAVE_SYSTEM_LIBFFI], [1], [Define to 1 if you have libffi.])],
|
||||||
|
- [AC_MSG_ERROR([Cannot find system libffi])])
|
||||||
|
+ [AC_CHECK_HEADERS(
|
||||||
|
+ [ffi.h],
|
||||||
|
+ [AC_DEFINE([HAVE_SYSTEM_LIBFFI], [1], [Define to 1 if you have libffi.])],
|
||||||
|
+ [AC_MSG_ERROR([Cannot find ffi.h for system libffi])]
|
||||||
|
+ )],
|
||||||
|
+ [AC_MSG_ERROR([Cannot find system libffi])]
|
||||||
|
+ )
|
||||||
|
+
|
||||||
|
CFLAGS="$CFLAGS2"
|
||||||
|
LDFLAGS="$LDFLAGS2"
|
||||||
|
])
|
||||||
|
--
|
||||||
|
GitLab
|
||||||
|
|
@ -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"
|
|
||||||
|
|
43
9394.patch
Normal file
43
9394.patch
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
From 480b5d6440bbbd0b89dabdb2dc957333056aa2a7 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Florian Weimer <fweimer@redhat.com>
|
||||||
|
Date: Tue, 22 Nov 2022 15:23:50 +0100
|
||||||
|
Subject: [PATCH] m4/fp_leading_underscore.m4: Avoid implicit exit function
|
||||||
|
declaration
|
||||||
|
|
||||||
|
And switch to a new-style function definition.
|
||||||
|
|
||||||
|
Fixes build issues with compilers that do not accept implicit function
|
||||||
|
declarations.
|
||||||
|
---
|
||||||
|
m4/fp_leading_underscore.m4 | 10 ++++------
|
||||||
|
1 file changed, 4 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/m4/fp_leading_underscore.m4 b/m4/fp_leading_underscore.m4
|
||||||
|
index fde57c7625d..939cee3b69f 100644
|
||||||
|
--- a/m4/fp_leading_underscore.m4
|
||||||
|
+++ b/m4/fp_leading_underscore.m4
|
||||||
|
@@ -32,17 +32,15 @@ struct nlist xYzzY1[] = {{"xYzzY1", 0},{0}};
|
||||||
|
struct nlist xYzzY2[] = {{"_xYzzY2", 0},{0}};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-int main(argc, argv)
|
||||||
|
-int argc;
|
||||||
|
-char **argv;
|
||||||
|
+int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
#if defined(HAVE_NLIST_H)
|
||||||
|
if(nlist(argv[0], xYzzY1) == 0 && xYzzY1[0].n_value != 0)
|
||||||
|
- exit(1);
|
||||||
|
+ return 1;
|
||||||
|
if(nlist(argv[0], xYzzY2) == 0 && xYzzY2[0].n_value != 0)
|
||||||
|
- exit(0);
|
||||||
|
+ return 0;
|
||||||
|
#endif
|
||||||
|
- exit(1);
|
||||||
|
+ return 1;
|
||||||
|
}]])],[fptools_cv_leading_underscore=yes],[fptools_cv_leading_underscore=no],[fptools_cv_leading_underscore=no])
|
||||||
|
;;
|
||||||
|
esac]);
|
||||||
|
--
|
||||||
|
GitLab
|
||||||
|
|
93
9aace0eaf6279f17368a1753b65afbdc466e8291.patch
Normal file
93
9aace0eaf6279f17368a1753b65afbdc466e8291.patch
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
From 9aace0eaf6279f17368a1753b65afbdc466e8291 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Sylvain Henry <sylvain@haskus.fr>
|
||||||
|
Date: Sat, 10 Apr 2021 14:48:16 +0200
|
||||||
|
Subject: [PATCH] Produce constant file atomically (#19684)
|
||||||
|
|
||||||
|
---
|
||||||
|
utils/deriveConstants/Main.hs | 21 ++++++++++++++++-----
|
||||||
|
utils/deriveConstants/deriveConstants.cabal | 3 ++-
|
||||||
|
2 files changed, 18 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/utils/deriveConstants/Main.hs b/utils/deriveConstants/Main.hs
|
||||||
|
index 8bf8ae7b44d..9db673a9852 100644
|
||||||
|
--- a/utils/deriveConstants/Main.hs
|
||||||
|
+++ b/utils/deriveConstants/Main.hs
|
||||||
|
@@ -34,9 +34,10 @@ import Data.Maybe (catMaybes, mapMaybe, fromMaybe)
|
||||||
|
import Numeric (readHex)
|
||||||
|
import System.Environment (getArgs)
|
||||||
|
import System.Exit (ExitCode(ExitSuccess), exitFailure)
|
||||||
|
-import System.FilePath ((</>))
|
||||||
|
+import System.FilePath ((</>),(<.>))
|
||||||
|
import System.IO (stderr, hPutStrLn)
|
||||||
|
import System.Process (showCommandForUser, readProcess, rawSystem)
|
||||||
|
+import System.Directory (renameFile)
|
||||||
|
|
||||||
|
main :: IO ()
|
||||||
|
main = do opts <- parseArgs
|
||||||
|
@@ -79,6 +80,16 @@ data Options = Options {
|
||||||
|
o_targetOS :: Maybe String
|
||||||
|
}
|
||||||
|
|
||||||
|
+-- | Write a file atomically
|
||||||
|
+--
|
||||||
|
+-- This avoids other processes seeing the file while it is being written into.
|
||||||
|
+atomicWriteFile :: FilePath -> String -> IO ()
|
||||||
|
+atomicWriteFile fn s = do
|
||||||
|
+ let tmp = fn <.> "tmp"
|
||||||
|
+ writeFile tmp s
|
||||||
|
+ renameFile tmp fn
|
||||||
|
+
|
||||||
|
+
|
||||||
|
parseArgs :: IO Options
|
||||||
|
parseArgs = do args <- getArgs
|
||||||
|
opts <- f emptyOptions args
|
||||||
|
@@ -670,7 +681,7 @@ getWanted verbose os tmpdir gccProgram gccFlags nmProgram mobjdumpProgram
|
||||||
|
= do let cStuff = unlines (headers ++ concatMap (doWanted . snd) (wanteds os))
|
||||||
|
cFile = tmpdir </> "tmp.c"
|
||||||
|
oFile = tmpdir </> "tmp.o"
|
||||||
|
- writeFile cFile cStuff
|
||||||
|
+ atomicWriteFile cFile cStuff
|
||||||
|
execute verbose gccProgram (gccFlags ++ ["-c", cFile, "-o", oFile])
|
||||||
|
xs <- case os of
|
||||||
|
"openbsd" -> readProcess objdumpProgam ["--syms", oFile] ""
|
||||||
|
@@ -855,7 +866,7 @@ getWanted verbose os tmpdir gccProgram gccFlags nmProgram mobjdumpProgram
|
||||||
|
= return (w, FieldTypeGcptrMacro name)
|
||||||
|
|
||||||
|
writeHaskellType :: FilePath -> [What Fst] -> IO ()
|
||||||
|
-writeHaskellType fn ws = writeFile fn xs
|
||||||
|
+writeHaskellType fn ws = atomicWriteFile fn xs
|
||||||
|
where xs = unlines [header, body, footer, parser]
|
||||||
|
header = "module GHC.Platform.Constants where\n\n\
|
||||||
|
\import Prelude\n\
|
||||||
|
@@ -920,7 +931,7 @@ writeHaskellType fn ws = writeFile fn xs
|
||||||
|
|
||||||
|
|
||||||
|
writeHaskellValue :: FilePath -> [What Snd] -> IO ()
|
||||||
|
-writeHaskellValue fn rs = writeFile fn xs
|
||||||
|
+writeHaskellValue fn rs = atomicWriteFile fn xs
|
||||||
|
where xs = unlines [header, body, footer]
|
||||||
|
header = "PlatformConstants {"
|
||||||
|
footer = " }"
|
||||||
|
@@ -937,7 +948,7 @@ writeHaskellValue fn rs = writeFile fn xs
|
||||||
|
doWhat (FieldTypeGcptrMacro {}) = []
|
||||||
|
|
||||||
|
writeHeader :: FilePath -> [(Where, What Snd)] -> IO ()
|
||||||
|
-writeHeader fn rs = writeFile fn xs
|
||||||
|
+writeHeader fn rs = atomicWriteFile fn xs
|
||||||
|
where xs = headers ++ hs ++ unlines body
|
||||||
|
headers = "/* This file is created automatically. Do not edit by hand.*/\n\n"
|
||||||
|
haskellRs = fmap snd $ filter (\r -> fst r `elem` [Haskell,Both]) rs
|
||||||
|
diff --git a/utils/deriveConstants/deriveConstants.cabal b/utils/deriveConstants/deriveConstants.cabal
|
||||||
|
index 50b5b695c30..36ba7ebe1f7 100644
|
||||||
|
--- a/utils/deriveConstants/deriveConstants.cabal
|
||||||
|
+++ b/utils/deriveConstants/deriveConstants.cabal
|
||||||
|
@@ -20,4 +20,5 @@ Executable deriveConstants
|
||||||
|
Build-Depends: base >= 4 && < 5,
|
||||||
|
containers,
|
||||||
|
process,
|
||||||
|
- filepath
|
||||||
|
+ filepath,
|
||||||
|
+ directory
|
||||||
|
--
|
||||||
|
GitLab
|
||||||
|
|
87
buildpath-abi-stability-2.patch
Normal file
87
buildpath-abi-stability-2.patch
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
Description: Don't include BufPos in interface files
|
||||||
|
Author: Matthew Pickering
|
||||||
|
Origin: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/8972
|
||||||
|
Bug: https://gitlab.haskell.org/ghc/ghc/-/issues/22162
|
||||||
|
Index: b/compiler/GHC/Iface/Ext/Types.hs
|
||||||
|
===================================================================
|
||||||
|
--- a/compiler/GHC/Iface/Ext/Types.hs
|
||||||
|
+++ b/compiler/GHC/Iface/Ext/Types.hs
|
||||||
|
@@ -746,5 +746,5 @@ toHieName name
|
||||||
|
| isKnownKeyName name = KnownKeyName (nameUnique name)
|
||||||
|
| isExternalName name = ExternalName (nameModule name)
|
||||||
|
(nameOccName name)
|
||||||
|
- (nameSrcSpan name)
|
||||||
|
- | otherwise = LocalName (nameOccName name) (nameSrcSpan name)
|
||||||
|
+ (removeBufSpan $ nameSrcSpan name)
|
||||||
|
+ | otherwise = LocalName (nameOccName name) (removeBufSpan $ nameSrcSpan name)
|
||||||
|
Index: b/compiler/GHC/Types/SrcLoc.hs
|
||||||
|
===================================================================
|
||||||
|
--- a/compiler/GHC/Types/SrcLoc.hs
|
||||||
|
+++ b/compiler/GHC/Types/SrcLoc.hs
|
||||||
|
@@ -72,6 +72,7 @@ module GHC.Types.SrcLoc (
|
||||||
|
getBufPos,
|
||||||
|
BufSpan(..),
|
||||||
|
getBufSpan,
|
||||||
|
+ removeBufSpan,
|
||||||
|
|
||||||
|
-- * Located
|
||||||
|
Located,
|
||||||
|
@@ -397,6 +398,10 @@ data UnhelpfulSpanReason
|
||||||
|
| UnhelpfulOther !FastString
|
||||||
|
deriving (Eq, Show)
|
||||||
|
|
||||||
|
+removeBufSpan :: SrcSpan -> SrcSpan
|
||||||
|
+removeBufSpan (RealSrcSpan s _) = RealSrcSpan s Nothing
|
||||||
|
+removeBufSpan s = s
|
||||||
|
+
|
||||||
|
{- Note [Why Maybe BufPos]
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
In SrcLoc we store (Maybe BufPos); in SrcSpan we store (Maybe BufSpan).
|
||||||
|
Index: b/compiler/GHC/Utils/Binary.hs
|
||||||
|
===================================================================
|
||||||
|
--- a/compiler/GHC/Utils/Binary.hs
|
||||||
|
+++ b/compiler/GHC/Utils/Binary.hs
|
||||||
|
@@ -1444,19 +1444,6 @@ instance Binary RealSrcSpan where
|
||||||
|
return (mkRealSrcSpan (mkRealSrcLoc f sl sc)
|
||||||
|
(mkRealSrcLoc f el ec))
|
||||||
|
|
||||||
|
-instance Binary BufPos where
|
||||||
|
- put_ bh (BufPos i) = put_ bh i
|
||||||
|
- get bh = BufPos <$> get bh
|
||||||
|
-
|
||||||
|
-instance Binary BufSpan where
|
||||||
|
- put_ bh (BufSpan start end) = do
|
||||||
|
- put_ bh start
|
||||||
|
- put_ bh end
|
||||||
|
- get bh = do
|
||||||
|
- start <- get bh
|
||||||
|
- end <- get bh
|
||||||
|
- return (BufSpan start end)
|
||||||
|
-
|
||||||
|
instance Binary UnhelpfulSpanReason where
|
||||||
|
put_ bh r = case r of
|
||||||
|
UnhelpfulNoLocationInfo -> putByte bh 0
|
||||||
|
@@ -1475,10 +1462,11 @@ instance Binary UnhelpfulSpanReason wher
|
||||||
|
_ -> UnhelpfulOther <$> get bh
|
||||||
|
|
||||||
|
instance Binary SrcSpan where
|
||||||
|
- put_ bh (RealSrcSpan ss sb) = do
|
||||||
|
+ put_ bh (RealSrcSpan ss _sb) = do
|
||||||
|
putByte bh 0
|
||||||
|
+ -- BufSpan doesn't ever get serialised because the positions depend
|
||||||
|
+ -- on build location.
|
||||||
|
put_ bh ss
|
||||||
|
- put_ bh sb
|
||||||
|
|
||||||
|
put_ bh (UnhelpfulSpan s) = do
|
||||||
|
putByte bh 1
|
||||||
|
@@ -1488,8 +1476,7 @@ instance Binary SrcSpan where
|
||||||
|
h <- getByte bh
|
||||||
|
case h of
|
||||||
|
0 -> do ss <- get bh
|
||||||
|
- sb <- get bh
|
||||||
|
- return (RealSrcSpan ss sb)
|
||||||
|
+ return (RealSrcSpan ss Nothing)
|
||||||
|
_ -> do s <- get bh
|
||||||
|
return (UnhelpfulSpan s)
|
||||||
|
|
@ -1,8 +1,10 @@
|
|||||||
Forwarded to https://ghc.haskell.org/trac/ghc/ticket/10424
|
Forwarded to https://ghc.haskell.org/trac/ghc/ticket/10424
|
||||||
|
|
||||||
--- a/compiler/iface/MkIface.hs
|
Index: b/compiler/GHC/Iface/Recomp.hs
|
||||||
+++ b/compiler/iface/MkIface.hs
|
===================================================================
|
||||||
@@ -681,7 +681,7 @@ addFingerprints hsc_env mb_old_fingerpri
|
--- a/compiler/GHC/Iface/Recomp.hs
|
||||||
|
+++ b/compiler/GHC/Iface/Recomp.hs
|
||||||
|
@@ -1071,7 +1071,7 @@ addFingerprints hsc_env iface0
|
||||||
iface_hash <- computeFingerprint putNameLiterally
|
iface_hash <- computeFingerprint putNameLiterally
|
||||||
(mod_hash,
|
(mod_hash,
|
||||||
ann_fn (mkVarOcc "module"), -- See mkIfaceAnnCache
|
ann_fn (mkVarOcc "module"), -- See mkIfaceAnnCache
|
||||||
@ -11,13 +13,12 @@ Forwarded to https://ghc.haskell.org/trac/ghc/ticket/10424
|
|||||||
sorted_deps,
|
sorted_deps,
|
||||||
mi_hpc iface0)
|
mi_hpc iface0)
|
||||||
|
|
||||||
@@ -714,6 +714,9 @@ addFingerprints hsc_env mb_old_fingerpri
|
@@ -1106,6 +1106,8 @@ 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)
|
(non_orph_fis, orph_fis) = mkOrphMap ifFamInstOrph (mi_fam_insts iface0)
|
||||||
fix_fn = mi_fix_fn iface0
|
|
||||||
ann_fn = mkIfaceAnnCache (mi_anns iface0)
|
ann_fn = mkIfaceAnnCache (mi_anns iface0)
|
||||||
+ -- Do not allow filenames to affect the interface
|
+ -- Do not allow filenames to affect the interface
|
||||||
+ usages = [ case u of UsageFile _ fp -> UsageFile "" fp; _ -> u | u <- mi_usages iface0 ]
|
+ 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
|
-- | Retrieve the orphan hashes 'mi_orphan_hash' for a list of modules
|
||||||
-- (in particular, the orphan modules which are transitively imported by the
|
-- (in particular, the orphan modules which are transitively imported by the
|
||||||
|
43
cabal-add-riscv64.patch
Normal file
43
cabal-add-riscv64.patch
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
diff --git a/libraries/Cabal/Cabal-syntax/src/Distribution/System.hs b/libraries/Cabal/Cabal-syntax/src/Distribution/System.hs
|
||||||
|
index 68bda63..6521464 100644
|
||||||
|
--- a/libraries/Cabal/Cabal-syntax/src/Distribution/System.hs
|
||||||
|
+++ b/libraries/Cabal/Cabal-syntax/src/Distribution/System.hs
|
||||||
|
@@ -159,7 +159,7 @@ buildOS = classifyOS Permissive System.Info.os
|
||||||
|
|
||||||
|
-- | These are the known Arches: I386, X86_64, PPC, PPC64, Sparc,
|
||||||
|
-- Arm, AArch64, Mips, SH, IA64, S390, S390X, Alpha, Hppa, Rs6000,
|
||||||
|
--- M68k, Vax, JavaScript and Wasm32.
|
||||||
|
+-- M68k, Vax, RISCV64, JavaScript and Wasm32.
|
||||||
|
--
|
||||||
|
-- The following aliases can also be used:
|
||||||
|
-- * PPC alias: powerpc
|
||||||
|
@@ -173,7 +173,7 @@ data Arch = I386 | X86_64 | PPC | PPC64 | Sparc
|
||||||
|
| Arm | AArch64 | Mips | SH
|
||||||
|
| IA64 | S390 | S390X
|
||||||
|
| Alpha | Hppa | Rs6000
|
||||||
|
- | M68k | Vax
|
||||||
|
+ | M68k | Vax | RISCV64
|
||||||
|
| JavaScript
|
||||||
|
| Wasm32
|
||||||
|
| OtherArch String
|
||||||
|
@@ -188,7 +188,7 @@ knownArches = [I386, X86_64, PPC, PPC64, Sparc
|
||||||
|
,Arm, AArch64, Mips, SH
|
||||||
|
,IA64, S390, S390X
|
||||||
|
,Alpha, Hppa, Rs6000
|
||||||
|
- ,M68k, Vax
|
||||||
|
+ ,M68k, Vax, RISCV64
|
||||||
|
,JavaScript
|
||||||
|
,Wasm32]
|
||||||
|
|
||||||
|
diff --git a/libraries/Cabal/Cabal/src/Distribution/Simple/PreProcess.hs b/libraries/Cabal/Cabal/src/Distribution/Simple/PreProcess.hs
|
||||||
|
index fbe5710..a53b33d 100644
|
||||||
|
--- a/libraries/Cabal/Cabal/src/Distribution/Simple/PreProcess.hs
|
||||||
|
+++ b/libraries/Cabal/Cabal/src/Distribution/Simple/PreProcess.hs
|
||||||
|
@@ -729,6 +729,7 @@ platformDefines lbi =
|
||||||
|
Rs6000 -> ["rs6000"]
|
||||||
|
M68k -> ["m68k"]
|
||||||
|
Vax -> ["vax"]
|
||||||
|
+ RISCV64 -> ["riscv64"]
|
||||||
|
JavaScript -> ["javascript"]
|
||||||
|
Wasm32 -> ["wasm32"]
|
||||||
|
OtherArch _ -> []
|
26
dd38aca95ac25adc9888083669b32ff551151259.patch
Normal file
26
dd38aca95ac25adc9888083669b32ff551151259.patch
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
From dd38aca95ac25adc9888083669b32ff551151259 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andreas Schwab <schwab@suse.de>
|
||||||
|
Date: Mon, 19 Jun 2023 10:38:26 +0200
|
||||||
|
Subject: [PATCH] Hadrian: enable GHCi support on riscv64
|
||||||
|
|
||||||
|
---
|
||||||
|
hadrian/src/Oracles/Setting.hs | 3 ++-
|
||||||
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/hadrian/src/Oracles/Setting.hs b/hadrian/src/Oracles/Setting.hs
|
||||||
|
index b9e5d312074..93561a94fe4 100644
|
||||||
|
--- a/hadrian/src/Oracles/Setting.hs
|
||||||
|
+++ b/hadrian/src/Oracles/Setting.hs
|
||||||
|
@@ -302,7 +302,8 @@ ghcWithInterpreter = do
|
||||||
|
, "darwin", "kfreebsdgnu" ]
|
||||||
|
goodArch <- anyTargetArch [ "i386", "x86_64", "powerpc"
|
||||||
|
, "arm", "aarch64", "s390x"
|
||||||
|
- , "powerpc64", "powerpc64le" ]
|
||||||
|
+ , "powerpc64", "powerpc64le"
|
||||||
|
+ , "riscv64" ]
|
||||||
|
return $ goodOs && goodArch
|
||||||
|
|
||||||
|
-- | Variants of the ARM architecture.
|
||||||
|
--
|
||||||
|
GitLab
|
||||||
|
|
@ -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);
|
|
@ -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
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
@ -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);
|
|
@ -1,35 +0,0 @@
|
|||||||
--- ghc-8.6.3/docs/users_guide/flags.py~ 2018-09-21 06:18:23.000000000 +0800
|
|
||||||
+++ ghc-8.6.3/docs/users_guide/flags.py 2019-03-05 10:20:38.639782096 +0800
|
|
||||||
@@ -49,6 +49,8 @@
|
|
||||||
import sphinx
|
|
||||||
from sphinx import addnodes
|
|
||||||
from sphinx.domains.std import GenericObject
|
|
||||||
+from sphinx.domains import ObjType
|
|
||||||
+from sphinx.roles import XRefRole
|
|
||||||
from sphinx.errors import SphinxError
|
|
||||||
from distutils.version import LooseVersion
|
|
||||||
from utils import build_table_from_list
|
|
||||||
@@ -603,14 +605,21 @@
|
|
||||||
sphinx_version = LooseVersion(sphinx.__version__)
|
|
||||||
override_arg = {'override': True} if sphinx_version >= LooseVersion('1.8') else {}
|
|
||||||
|
|
||||||
+ # Yuck: We can't use app.add_object_type since we need to provide the
|
|
||||||
+ # Directive instance ourselves.
|
|
||||||
+ std_object_types = app.registry.domain_object_types.setdefault('std', {})
|
|
||||||
+
|
|
||||||
# Add ghc-flag directive, and override the class with our own
|
|
||||||
- app.add_object_type('ghc-flag', 'ghc-flag')
|
|
||||||
app.add_directive_to_domain('std', 'ghc-flag', Flag, **override_arg)
|
|
||||||
+ app.add_role_to_domain('std', 'ghc-flag', XRefRole())
|
|
||||||
+ std_object_types['ghc-flag'] = ObjType('ghc-flag', 'ghc-flag')
|
|
||||||
|
|
||||||
# Add extension directive, and override the class with our own
|
|
||||||
- app.add_object_type('extension', 'extension')
|
|
||||||
app.add_directive_to_domain('std', 'extension', LanguageExtension,
|
|
||||||
**override_arg)
|
|
||||||
+ app.add_role_to_domain('std', 'extension', XRefRole())
|
|
||||||
+ std_object_types['extension'] = ObjType('ghc-flag', 'ghc-flag')
|
|
||||||
+
|
|
||||||
# NB: language-extension would be misinterpreted by sphinx, and produce
|
|
||||||
# lang="extensions" XML attributes
|
|
||||||
|
|
9
ghc-9.2.1-hadrian-s390x-rts--qg.patch
Normal file
9
ghc-9.2.1-hadrian-s390x-rts--qg.patch
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
--- ghc-9.2.1/hadrian/hadrian.cabal~ 2021-10-29 04:41:34.000000000 +0800
|
||||||
|
+++ ghc-9.2.1/hadrian/hadrian.cabal 2021-11-01 15:02:49.625656704 +0800
|
||||||
|
@@ -162,5 +162,5 @@
|
||||||
|
-- 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
|
@ -1,5 +1,5 @@
|
|||||||
--- ghc-8.2.2/libraries/Cabal/Cabal/Distribution/Simple/Install.hs~ 2017-05-05 23:51:43.000000000 +0900
|
--- ghc/libraries/Cabal/Cabal/src/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
|
+++ ghc/libraries/Cabal/Cabal/src/Distribution/Simple/Install.hs 2018-02-27 12:22:13.159432104 +0900
|
||||||
@@ -215,8 +215,7 @@
|
@@ -215,8 +215,7 @@
|
||||||
++ " in " ++ binPref)
|
++ " in " ++ binPref)
|
||||||
inPath <- isInSearchPath binPref
|
inPath <- isInSearchPath binPref
|
||||||
|
11
ghc-compiler-enable-build-id.patch
Normal file
11
ghc-compiler-enable-build-id.patch
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
--- ghc-9.4.1/compiler/GHC/Driver/Pipeline/Execute.hs~ 2022-08-07 12:00:38.000000000 +0800
|
||||||
|
+++ ghc-9.4.1/compiler/GHC/Driver/Pipeline/Execute.hs 2022-08-16 18:31:48.638516201 +0800
|
||||||
|
@@ -1161,7 +1161,7 @@
|
||||||
|
-- suppress the generation of the .note.gnu.build-id section,
|
||||||
|
-- which we don't need and sometimes causes ld to emit a
|
||||||
|
-- warning:
|
||||||
|
- ld_build_id | toolSettings_ldSupportsBuildId toolSettings' = ["--build-id=none"]
|
||||||
|
+ ld_build_id {-| toolSettings_ldSupportsBuildId toolSettings' = ["--build-id=none"]-}
|
||||||
|
| otherwise = []
|
||||||
|
|
||||||
|
if ldIsGnuLd
|
70
ghc-configure-c99.patch
Normal file
70
ghc-configure-c99.patch
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
Submitted upstream:
|
||||||
|
|
||||||
|
<https://gitlab.haskell.org/ghc/ghc/-/merge_requests/9394>
|
||||||
|
|
||||||
|
From 6b218717ac85d6dc9104f470cac0b4fb594104f4 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Florian Weimer <fweimer@redhat.com>
|
||||||
|
Date: Tue, 22 Nov 2022 15:23:50 +0100
|
||||||
|
Subject: [PATCH] m4/fp_leading_underscore.m4: Avoid implicit exit function
|
||||||
|
declaration
|
||||||
|
Content-type: text/plain
|
||||||
|
|
||||||
|
And switch to a new-style function definition.
|
||||||
|
|
||||||
|
Fixes build issues with compilers that do not accept implicit function
|
||||||
|
declarations.
|
||||||
|
---
|
||||||
|
m4/fp_leading_underscore.m4 | 10 ++++------
|
||||||
|
1 file changed, 4 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/m4/fp_leading_underscore.m4 b/m4/fp_leading_underscore.m4
|
||||||
|
index fde57c7625..939cee3b69 100644
|
||||||
|
--- a/m4/fp_leading_underscore.m4
|
||||||
|
+++ b/m4/fp_leading_underscore.m4
|
||||||
|
@@ -32,17 +32,15 @@ struct nlist xYzzY1[] = {{"xYzzY1", 0},{0}};
|
||||||
|
struct nlist xYzzY2[] = {{"_xYzzY2", 0},{0}};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-int main(argc, argv)
|
||||||
|
-int argc;
|
||||||
|
-char **argv;
|
||||||
|
+int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
#if defined(HAVE_NLIST_H)
|
||||||
|
if(nlist(argv[0], xYzzY1) == 0 && xYzzY1[0].n_value != 0)
|
||||||
|
- exit(1);
|
||||||
|
+ return 1;
|
||||||
|
if(nlist(argv[0], xYzzY2) == 0 && xYzzY2[0].n_value != 0)
|
||||||
|
- exit(0);
|
||||||
|
+ return 0;
|
||||||
|
#endif
|
||||||
|
- exit(1);
|
||||||
|
+ return 1;
|
||||||
|
}]])],[fptools_cv_leading_underscore=yes],[fptools_cv_leading_underscore=no],[fptools_cv_leading_underscore=no])
|
||||||
|
;;
|
||||||
|
esac]);
|
||||||
|
diff -ur ghc-9.4.3.orig/configure ghc-9.4.3/configure
|
||||||
|
--- ghc-9.4.3.orig/configure 2022-11-03 04:46:32.000000000 +0100
|
||||||
|
+++ ghc-9.4.3/configure 2022-11-22 16:37:07.812512120 +0100
|
||||||
|
@@ -17095,17 +17101,15 @@
|
||||||
|
struct nlist xYzzY2[] = {{"_xYzzY2", 0},{0}};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-int main(argc, argv)
|
||||||
|
-int argc;
|
||||||
|
-char **argv;
|
||||||
|
+int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
#if defined(HAVE_NLIST_H)
|
||||||
|
if(nlist(argv[0], xYzzY1) == 0 && xYzzY1[0].n_value != 0)
|
||||||
|
- exit(1);
|
||||||
|
+ return 1;
|
||||||
|
if(nlist(argv[0], xYzzY2) == 0 && xYzzY2[0].n_value != 0)
|
||||||
|
- exit(0);
|
||||||
|
+ return 0;
|
||||||
|
#endif
|
||||||
|
- exit(1);
|
||||||
|
+ return 1;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
if ac_fn_c_try_run "$LINENO"; then :
|
11
ghc-hadrian-s390x-rts--qg.patch
Normal file
11
ghc-hadrian-s390x-rts--qg.patch
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
--- ghc-9.4.1/hadrian/hadrian.cabal~ 2022-08-07 12:00:38.000000000 +0800
|
||||||
|
+++ ghc-9.4.1/hadrian/hadrian.cabal 2022-08-10 19:54:33.335164261 +0800
|
||||||
|
@@ -173,7 +173,7 @@
|
||||||
|
-- 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)
|
26
haddock-remove-googleapis-fonts.patch
Normal file
26
haddock-remove-googleapis-fonts.patch
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
Description: Remove hard-coded googleapis font URL
|
||||||
|
Bug: https://github.com/haskell/haddock/issues/1211
|
||||||
|
Bug-Debian: https://bugs.debian.org/963690
|
||||||
|
|
||||||
|
Index: b/utils/haddock/haddock-api/src/Haddock/Backends/Xhtml.hs
|
||||||
|
===================================================================
|
||||||
|
--- a/utils/haddock/haddock-api/src/Haddock/Backends/Xhtml.hs
|
||||||
|
+++ b/utils/haddock/haddock-api/src/Haddock/Backends/Xhtml.hs
|
||||||
|
@@ -137,7 +137,7 @@ headHtml docTitle themes mathjax_url bas
|
||||||
|
, thetype "text/css"
|
||||||
|
, href (withBaseURL base_url quickJumpCssFile) ]
|
||||||
|
<< noHtml
|
||||||
|
- , thelink ! [ rel "stylesheet", thetype "text/css", href fontUrl] << noHtml
|
||||||
|
+ -- , thelink ! [ rel "stylesheet", thetype "text/css", href fontUrl] << noHtml
|
||||||
|
, script ! [ src (withBaseURL base_url haddockJsFile)
|
||||||
|
, emptyAttr "async"
|
||||||
|
, thetype "text/javascript" ]
|
||||||
|
@@ -146,7 +146,7 @@ headHtml docTitle themes mathjax_url bas
|
||||||
|
, script ! [src mjUrl, thetype "text/javascript"] << noHtml
|
||||||
|
]
|
||||||
|
where
|
||||||
|
- fontUrl = "https://fonts.googleapis.com/css?family=PT+Sans:400,400i,700"
|
||||||
|
+ -- fontUrl = "https://fonts.googleapis.com/css?family=PT+Sans:400,400i,700"
|
||||||
|
mjUrl = fromMaybe "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" mathjax_url
|
||||||
|
mjConf = unwords [ "MathJax.Hub.Config({"
|
||||||
|
, "tex2jax: {"
|
@ -7,4 +7,4 @@ fi
|
|||||||
|
|
||||||
cd libraries
|
cd libraries
|
||||||
|
|
||||||
grep -i ^version: Cabal/Cabal/Cabal.cabal */*.cabal | grep -v -e "\(Win32\|gmp.old\|gmp2\|integer-simple\)" | sed -e "s!/.*: \+!-!"
|
grep -i ^version: Cabal/Cabal/Cabal.cabal containers/containers/containers.cabal template-haskell/template-haskell.cabal.in */*.cabal | grep -v -e "\(Win32\|gmp.old\|gmp2\|integer-simple\)" | sed -e "s!/.*: \+!-!" | sort
|
||||||
|
4
sources
4
sources
@ -1,2 +1,2 @@
|
|||||||
SHA512 (ghc-8.8.4-src.tar.xz.sig) = 1ed2e64e8b75a147d7c66b0018119f54ac740131b6f74612aa975c9120d8f7a8a2286829cef22ef2cd16262af0604659daa41c09ef3bdec6c22b8d086fbc1166
|
SHA512 (ghc-9.4.5-src.tar.xz) = 6e469558433e9d1d83ae348fb242a178ee7008fcb5c9707f0bdf93f17c394dc05d993b9cd7f9cd65d20c32fadcd1276ed49c3a74ade98235735de5268c3c1315
|
||||||
SHA512 (ghc-8.8.4-src.tar.xz) = efd23bd819f7429486696a3a929a040471db7ea8a2d1f1d832e4cf0825b9e1e0c5e6ecad0ab8376f58b74e9c28c1d2f773bd126596d6d853c9e57d57e5ceb090
|
SHA512 (ghc-9.4.5-src.tar.xz.sig) = a46b41f21760dbeb5078af3ca1a8bb1acbc3404c54bd201122e4ee06a3bf21d772b88751c8dd7e16891a9a5d2545e5f2894e2fe79922a5e20f7235106dddf1a1
|
||||||
|
26
sphinx7.patch
Normal file
26
sphinx7.patch
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
From 52d701b31dc4427b7e321a04be3f5f13a5fc271e Mon Sep 17 00:00:00 2001
|
||||||
|
From: "mimi.vx" <mimi.vx@gmail.com>
|
||||||
|
Date: Wed, 24 May 2023 12:42:15 +0000
|
||||||
|
Subject: [PATCH] Fix for Sphinx 7 removed style key
|
||||||
|
|
||||||
|
Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/23444
|
||||||
|
---
|
||||||
|
docs/users_guide/rtd-theme/layout.html | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/docs/users_guide/rtd-theme/layout.html b/docs/users_guide/rtd-theme/layout.html
|
||||||
|
index 2a61142514a..7ffeff7befc 100644
|
||||||
|
--- a/docs/users_guide/rtd-theme/layout.html
|
||||||
|
+++ b/docs/users_guide/rtd-theme/layout.html
|
||||||
|
@@ -64,7 +64,7 @@
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
{# CSS #}
|
||||||
|
- <link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
|
||||||
|
+ <link rel="stylesheet" href="{{ pathto('_static/' + styles[-1], 1) }}" type="text/css" />
|
||||||
|
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
|
||||||
|
{%- for css in css_files %}
|
||||||
|
{%- if css|attr("rel") %}
|
||||||
|
--
|
||||||
|
GitLab
|
||||||
|
|
6
tests/smoke/runtest.sh
Executable file
6
tests/smoke/runtest.sh
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo 'main = return ()' > test.hs
|
||||||
|
ghc test.hs && ./test
|
11
tests/tests.yml
Normal file
11
tests/tests.yml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
- hosts: localhost
|
||||||
|
tags:
|
||||||
|
- classic
|
||||||
|
roles:
|
||||||
|
- role: standard-test-basic
|
||||||
|
required_packages:
|
||||||
|
- ghc
|
||||||
|
tests:
|
||||||
|
- smoke
|
||||||
|
...
|
12
text2-allow-ghc8-arm.patch
Normal file
12
text2-allow-ghc8-arm.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
--- ghc-9.4.0.20220501/libraries/text/text.cabal~ 2022-04-30 02:50:06.000000000 +0800
|
||||||
|
+++ ghc-9.4.0.20220501/libraries/text/text.cabal 2022-05-06 23:55:56.091521266 +0800
|
||||||
|
@@ -121,9 +121,6 @@
|
||||||
|
if os(windows) && impl(ghc >= 8.2 && < 8.4 || == 8.6.3 || == 8.10.1)
|
||||||
|
build-depends: base < 0
|
||||||
|
|
||||||
|
- -- GHC 8.10 has linking issues (probably TH-related) on ARM.
|
||||||
|
- if (arch(aarch64) || arch(arm)) && impl(ghc == 8.10.*)
|
||||||
|
- build-depends: base < 0
|
||||||
|
|
||||||
|
-- Subword primitives in GHC 9.2.1 are broken on ARM platforms.
|
||||||
|
if (arch(aarch64) || arch(arm)) && impl(ghc == 9.2.1)
|
@ -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) \
|
|
Loading…
Reference in New Issue
Block a user