summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Mair-Keimberger <mmk@levelnine.at>2021-03-15 18:14:09 +0100
committerSergei Trofimovich <slyfox@gentoo.org>2021-03-16 08:56:05 +0000
commit6b85654a50cc2637b55053f54133613f92cfed26 (patch)
tree80cb8527420036bf1a0617ab0c1c6c77a281d168
parentnet-ftp/filezilla: Bump to version 3.53.0 (diff)
downloadgentoo-6b85654a50cc2637b55053f54133613f92cfed26.tar.gz
gentoo-6b85654a50cc2637b55053f54133613f92cfed26.tar.bz2
gentoo-6b85654a50cc2637b55053f54133613f92cfed26.zip
dev-lang/ghc: remove unused patches
Package-Manager: Portage-3.0.17, Repoman-3.0.2 Signed-off-by: Michael Mair-Keimberger <mmk@levelnine.at> Closes: https://github.com/gentoo/gentoo/pull/19940 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-rw-r--r--dev-lang/ghc/files/ghc-7.10.1-rc3-ghc-7.10-bootstrap.patch78
-rw-r--r--dev-lang/ghc/files/ghc-7.10.3-hardfloat.patch26
-rw-r--r--dev-lang/ghc/files/ghc-7.10.3-relnotes.patch45
-rw-r--r--dev-lang/ghc/files/ghc-7.6.3-preserve-inplace-xattr.patch14
-rw-r--r--dev-lang/ghc/files/ghc-7.8.1_rc1-libbfd.patch81
-rw-r--r--dev-lang/ghc/files/ghc-7.8.2-cgen-constify.patch34
-rw-r--r--dev-lang/ghc/files/ghc-7.8.3-linker-warn.patch35
-rw-r--r--dev-lang/ghc/files/ghc-7.8.3-pic-sparc.patch31
-rw-r--r--dev-lang/ghc/files/ghc-7.8.3-ppc32-fPIC.patch351
-rw-r--r--dev-lang/ghc/files/ghc-7.8.4-gold.patch27
-rw-r--r--dev-lang/ghc/files/ghc-7.8.4-ia64-CLOSUREs.patch66
-rw-r--r--dev-lang/ghc/files/ghc-8.0.1-limit-jN.patch50
-rw-r--r--dev-lang/ghc/files/ghc-8.0.1-par-g0-on-A32.patch65
-rw-r--r--dev-lang/ghc/files/ghc-8.0.1-ww-args-limit.patch127
-rw-r--r--dev-lang/ghc/files/ghc-8.0.1_rc1-cgen-constify.patch34
-rw-r--r--dev-lang/ghc/files/ghc-8.0.2-O2-unreg.patch35
-rw-r--r--dev-lang/ghc/files/ghc-8.0.2-binutils-2.30.patch65
-rw-r--r--dev-lang/ghc/files/ghc-8.0.2-libffi-alpha.patch57
-rw-r--r--dev-lang/ghc/files/ghc-8.0.2_rc2-old-sphinx.patch12
-rw-r--r--dev-lang/ghc/files/ghc-8.10.1-no-relax-everywhere.patch19
-rw-r--r--dev-lang/ghc/files/ghc-8.10.2-revert-linker-rtsSymbols_more_linker_symbols.patch296
-rw-r--r--dev-lang/ghc/files/ghc-8.2.1_rc1-cgen-constify.patch378
-rw-r--r--dev-lang/ghc/files/ghc-8.2.1_rc1-ghci-cross.patch60
-rw-r--r--dev-lang/ghc/files/ghc-8.2.1_rc1-stage2-cross.patch81
-rw-r--r--dev-lang/ghc/files/ghc-8.2.1_rc1-staged-cross.patch43
-rw-r--r--dev-lang/ghc/files/ghc-8.2.1_rc1-unphased-cross.patch30
-rw-r--r--dev-lang/ghc/files/ghc-8.2.1_rc1-win32-cross-1.patch124
-rw-r--r--dev-lang/ghc/files/ghc-8.2.1_rc2-O2-unreg.patch35
-rw-r--r--dev-lang/ghc/files/ghc-8.2.1_rc3-any-vendor.patch44
-rw-r--r--dev-lang/ghc/files/ghc-8.2.1_rc3-stginit-data.patch27
-rw-r--r--dev-lang/ghc/files/ghc-8.8.1-no-alex.patch33
31 files changed, 0 insertions, 2403 deletions
diff --git a/dev-lang/ghc/files/ghc-7.10.1-rc3-ghc-7.10-bootstrap.patch b/dev-lang/ghc/files/ghc-7.10.1-rc3-ghc-7.10-bootstrap.patch
deleted file mode 100644
index 60db34b8b362..000000000000
--- a/dev-lang/ghc/files/ghc-7.10.1-rc3-ghc-7.10-bootstrap.patch
+++ /dev/null
@@ -1,78 +0,0 @@
---- ghc-7.10.0.20150316-orig/compiler/utils/Pair.hs 2015-03-10 05:43:13.000000000 +1100
-+++ ghc-7.10.0.20150316/compiler/utils/Pair.hs 2015-03-17 09:50:48.491115080 +1100
-@@ -15,6 +15,8 @@
- import Data.Foldable
- import Data.Monoid
- import Data.Traversable
-+#else
-+import Control.Applicative ((<$>))
- #endif
-
- data Pair a = Pair { pFst :: a, pSnd :: a }
---- ghc-7.10.0.20150316-orig/compiler/types/Coercion.hs 2015-03-10 05:43:13.000000000 +1100
-+++ ghc-7.10.0.20150316/compiler/types/Coercion.hs 2015-03-17 10:11:21.636047380 +1100
-@@ -104,6 +104,8 @@
- #if __GLASGOW_HASKELL__ < 709
- import Control.Applicative hiding ( empty )
- import Data.Traversable (traverse, sequenceA)
-+#else
-+import Control.Applicative ((<$>))
- #endif
- import FastString
- import ListSetOps
---- ghc-7.10.0.20150316-orig/compiler/typecheck/TcEvidence.hs 2015-03-14 08:48:57.000000000 +1100
-+++ ghc-7.10.0.20150316/compiler/typecheck/TcEvidence.hs 2015-03-17 10:26:03.251433371 +1100
-@@ -50,6 +50,8 @@
- #if __GLASGOW_HASKELL__ < 709
- import Control.Applicative
- import Data.Traversable (traverse, sequenceA)
-+#else
-+import Control.Applicative ((<$>))
- #endif
- import qualified Data.Data as Data
- import Outputable
---- ghc-7.10.0.20150316-orig/compiler/hsSyn/HsBinds.hs 2015-03-10 05:43:13.000000000 +1100
-+++ ghc-7.10.0.20150316/compiler/hsSyn/HsBinds.hs 2015-03-17 10:42:21.459519033 +1100
-@@ -47,6 +47,8 @@
- import Data.Traversable ( Traversable(..) )
- import Data.Monoid ( mappend )
- import Control.Applicative hiding (empty)
-+#else
-+import Control.Applicative ((<$>))
- #endif
-
- {-
---- ghc-7.10.0.20150316-orig/compiler/parser/RdrHsSyn.hs 2015-03-10 05:43:13.000000000 +1100
-+++ ghc-7.10.0.20150316/compiler/parser/RdrHsSyn.hs 2015-03-17 11:17:48.950929542 +1100
-@@ -91,9 +91,7 @@
- import Util
- import ApiAnnotation
-
--#if __GLASGOW_HASKELL__ < 709
- import Control.Applicative ((<$>))
--#endif
- import Control.Monad
-
- import Text.ParserCombinators.ReadP as ReadP
---- ghc-7.10.0.20150316-orig/compiler/typecheck/TcGenDeriv.hs 2015-03-14 08:48:57.000000000 +1100
-+++ ghc-7.10.0.20150316/compiler/typecheck/TcGenDeriv.hs 2015-03-17 11:30:39.106508173 +1100
-@@ -59,6 +59,8 @@
- import Var
- #if __GLASGOW_HASKELL__ < 709
- import MonadUtils
-+#else
-+import Control.Applicative ((<$>))
- #endif
- import Outputable
- import Lexeme
---- ghc-7.10.0.20150316-orig/compiler/vectorise/Vectorise/Exp.hs 2015-03-10 05:43:13.000000000 +1100
-+++ ghc-7.10.0.20150316/compiler/vectorise/Vectorise/Exp.hs 2015-03-17 11:46:41.829481669 +1100
-@@ -46,6 +46,8 @@
- import Util
- #if __GLASGOW_HASKELL__ < 709
- import MonadUtils
-+#else
-+import Control.Applicative ((<$>))
- #endif
-
- import Control.Monad
diff --git a/dev-lang/ghc/files/ghc-7.10.3-hardfloat.patch b/dev-lang/ghc/files/ghc-7.10.3-hardfloat.patch
deleted file mode 100644
index 106d07aa31c8..000000000000
--- a/dev-lang/ghc/files/ghc-7.10.3-hardfloat.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-commit 5cc08ebf2f346992a0abd4440252165c90b5ec05
-Author: Sergei Trofimovich <siarheit@google.com>
-Date: Sat Jun 20 12:23:00 2015 +0100
-
- Recognise 'hardhloat' as a valid vendor in a host tuple
-
- Observed on a tuple armv7a-hardfloat-linux-gnueabi:
- > Unknown vendor hardfloat
-
- Reported-by: Sergey Alirzaev
- Signed-off-by: Sergei Trofimovich <siarheit@google.com>
-
-diff --git a/aclocal.m4 b/aclocal.m4
-index 590edb0..958622c 100644
---- a/aclocal.m4
-+++ b/aclocal.m4
-@@ -1966,6 +1966,9 @@ AC_DEFUN([GHC_CONVERT_VENDOR],[
- softfloat) # like armv5tel-softfloat-linux-gnueabi
- $2="unknown"
- ;;
-+ hardfloat) # like armv7a-hardfloat-linux-gnueabi
-+ $2="unknown"
-+ ;;
- *)
- #pass thru by default
- $2="$1"
diff --git a/dev-lang/ghc/files/ghc-7.10.3-relnotes.patch b/dev-lang/ghc/files/ghc-7.10.3-relnotes.patch
deleted file mode 100644
index 675037946e75..000000000000
--- a/dev-lang/ghc/files/ghc-7.10.3-relnotes.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-diff --git a/ANNOUNCE b/ANNOUNCE
-index 7812eba..0018b37 100644
---- a/ANNOUNCE
-+++ b/ANNOUNCE
-@@ -1,6 +1,6 @@
-
- ==============================================================
-- The (Interactive) Glasgow Haskell Compiler -- version 7.10.2
-+ The (Interactive) Glasgow Haskell Compiler -- version 7.10.3
- ==============================================================
-
- The GHC Team is pleased to announce a new minor release of GHC. This is a
-@@ -29,7 +29,7 @@ bug-fix release and contains a number of important fixes,
- A more thorough list of the changes in the release can be found in the release
- notes,
-
-- http://haskell.org/ghc/docs/7.10.2/html/users_guide/release-7-10-2.html
-+ http://haskell.org/ghc/docs/7.10.3/html/users_guide/release-7-10-3.html
-
-
- How to get it
-diff --git a/docs/users_guide/intro.xml b/docs/users_guide/intro.xml
-index 3292334..fb7116e 100644
---- a/docs/users_guide/intro.xml
-+++ b/docs/users_guide/intro.xml
-@@ -309,6 +309,7 @@
-
- &relnotes1;
- &relnotes2;
-+&relnotes3;
-
- </chapter>
-
-diff --git a/docs/users_guide/ug-ent.xml.in b/docs/users_guide/ug-ent.xml.in
-index b696aad..3629e93 100644
---- a/docs/users_guide/ug-ent.xml.in
-+++ b/docs/users_guide/ug-ent.xml.in
-@@ -5,6 +5,7 @@
- <!ENTITY intro SYSTEM "intro.xml" >
- <!ENTITY relnotes1 SYSTEM "7.10.1-notes.xml" >
- <!ENTITY relnotes2 SYSTEM "7.10.2-notes.xml" >
-+<!ENTITY relnotes3 SYSTEM "7.10.3-notes.xml" >
- <!ENTITY using SYSTEM "using.xml" >
- <!ENTITY code-gens SYSTEM "codegens.xml" >
- <!ENTITY runtime SYSTEM "runtime_control.xml" >
diff --git a/dev-lang/ghc/files/ghc-7.6.3-preserve-inplace-xattr.patch b/dev-lang/ghc/files/ghc-7.6.3-preserve-inplace-xattr.patch
deleted file mode 100644
index 08410fa0cd9b..000000000000
--- a/dev-lang/ghc/files/ghc-7.6.3-preserve-inplace-xattr.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-On hardened 'cp' drops out XT-pax parking.
-perfinion suggested using 'install', where portage
-might have a chance to save our marking.
-
-Reported-by: Jay Yang
-Gentoo-bug: https://bugs.gentoo.org/518734
-diff --git a/rules/build-prog.mk b/rules/build-prog.mk
-index 399369e..2ee9cd5 100644
---- a/rules/build-prog.mk
-+++ b/rules/build-prog.mk
-@@ -288,3 +288,3 @@ endif
- $$($1_$2_INPLACE) : $1/$2/build/tmp/$$($1_$2_PROG_INPLACE) | $$$$(dir $$$$@)/.
-- "$$(CP)" -p $$< $$@
-+ $$(INSTALL) -m 755 $$< $$@
diff --git a/dev-lang/ghc/files/ghc-7.8.1_rc1-libbfd.patch b/dev-lang/ghc/files/ghc-7.8.1_rc1-libbfd.patch
deleted file mode 100644
index d01cb49affbd..000000000000
--- a/dev-lang/ghc/files/ghc-7.8.1_rc1-libbfd.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-commit bb5953484579968c984d074ca1af5d21e1c9e7a0
-Author: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Mon Feb 10 12:45:58 2014 +0300
-
- rts: unrust 'libbfd' debug symbols parser
-
- Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-
-diff --git a/configure.ac b/configure.ac
-index e7fbc7f..e47979c 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -801,7 +801,8 @@ fi
- dnl ** check whether this machine has BFD and libiberty installed (used for debugging)
- dnl the order of these tests matters: bfd needs libiberty
- AC_CHECK_LIB(iberty, xmalloc)
--AC_CHECK_LIB(bfd, bfd_uncompress_section_contents)
-+dnl 'bfd_init' is a rare non-macro in libbfd
-+AC_CHECK_LIB(bfd, bfd_init)
-
- dnl ################################################################
- dnl Check for libraries
-diff --git a/rts/Printer.c b/rts/Printer.c
-index ca9ca49..ce02b02 100644
---- a/rts/Printer.c
-+++ b/rts/Printer.c
-@@ -48,6 +48,9 @@ void printPtr( StgPtr p )
- raw = lookupGHCName(p);
- if (raw != NULL) {
- printZcoded(raw);
-+ /* it can be just a C symbol, like 'stg_returnToStackTop' */
-+ debugBelch("<%s>", raw);
-+ debugBelch("[%p]", p);
- } else {
- debugBelch("%p", p);
- }
-@@ -794,7 +797,7 @@ static void printZcoded( const char *raw )
- disabling this for now.
- */
- #ifdef USING_LIBBFD
--
-+#include "../mk/config.h" /* silly BFD's requirement */
- #include <bfd.h>
-
- /* Fairly ad-hoc piece of code that seems to filter out a lot of
-@@ -863,7 +866,10 @@ extern void DEBUG_LoadSymbols( char *name )
- for( i = 0; i != number_of_symbols; ++i ) {
- symbol_info info;
- bfd_get_symbol_info(abfd,symbol_table[i],&info);
-- /*debugBelch("\t%c\t0x%x \t%s\n",info.type,(nat)info.value,info.name); */
-+ if (0)
-+ {
-+ debugBelch("\t%c\t0x%x \t%s\n",info.type,(nat)info.value,info.name);
-+ }
- if (isReal(info.type, info.name)) {
- num_real_syms += 1;
- }
-diff --git a/rts/RtsStartup.c b/rts/RtsStartup.c
-index aa7306f..5bdef94 100644
---- a/rts/RtsStartup.c
-+++ b/rts/RtsStartup.c
-@@ -19,6 +19,7 @@
- #include "RtsFlags.h"
- #include "RtsUtils.h"
- #include "Prelude.h"
-+#include "Printer.h" /* DEBUG_LoadSymbols */
- #include "Schedule.h" /* initScheduler */
- #include "Stats.h" /* initStats */
- #include "STM.h" /* initSTM */
-@@ -162,6 +163,11 @@ hs_init_ghc(int *argc, char **argv[], RtsConfig rts_config)
- rts_config.rts_opts_enabled, rts_config.rts_opts, rts_config.rts_hs_main);
- }
-
-+#ifdef DEBUG
-+ /* load debugging symbols */
-+ DEBUG_LoadSymbols((*argv)[0]);
-+#endif /* DEBUG */
-+
- /* Initialise the stats department, phase 1 */
- initStats1();
-
diff --git a/dev-lang/ghc/files/ghc-7.8.2-cgen-constify.patch b/dev-lang/ghc/files/ghc-7.8.2-cgen-constify.patch
deleted file mode 100644
index efdd54fbf3fb..000000000000
--- a/dev-lang/ghc/files/ghc-7.8.2-cgen-constify.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-commit b0cf3ab7a69b878a4335d21a347b56e4b0ca0b7b
-Author: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Mon Apr 14 19:06:24 2014 +0300
-
- compiler/cmm/PprC.hs: constify local string literals
-
- Consider one-line module
- module B (v) where v = "hello"
- in -fvia-C mode it generates code like
- static char gibberish_str[] = "hello";
-
- It uselessly eats data section (precious resource on ia64!).
- The patch switches genrator to emit:
- static const char gibberish_str[] = "hello";
-
- Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-
-diff --git a/compiler/cmm/PprC.hs b/compiler/cmm/PprC.hs
-index 2398981..fdb578d 100644
---- a/compiler/cmm/PprC.hs
-+++ b/compiler/cmm/PprC.hs
-@@ -112,6 +112,12 @@ pprTop (CmmProc infos clbl _ graph) =
-
- -- We only handle (a) arrays of word-sized things and (b) strings.
-
-+pprTop (CmmData ReadOnlyData (Statics lbl [CmmString str])) =
-+ hcat [
-+ pprLocalness lbl, ptext (sLit "const char "), ppr lbl,
-+ ptext (sLit "[] = "), pprStringInCStyle str, semi
-+ ]
-+
- pprTop (CmmData _section (Statics lbl [CmmString str])) =
- hcat [
- pprLocalness lbl, ptext (sLit "char "), ppr lbl,
diff --git a/dev-lang/ghc/files/ghc-7.8.3-linker-warn.patch b/dev-lang/ghc/files/ghc-7.8.3-linker-warn.patch
deleted file mode 100644
index c8570c06940b..000000000000
--- a/dev-lang/ghc/files/ghc-7.8.3-linker-warn.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-commit 326046739801a380c5457ef4c87bce8fb95497ba
-Author: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Sun Aug 10 22:12:28 2014 +0300
-
- systools info: fix warning about C compiler (message said about linker)
-
- Summary: Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-
- Test Plan: build-tested
-
- Reviewers: austin
-
- Reviewed By: austin
-
- Subscribers: phaskell, simonmar, relrod, ezyang, carter
-
- Differential Revision: https://phabricator.haskell.org/D132
-
-diff --git a/compiler/main/SysTools.lhs b/compiler/main/SysTools.lhs
-index 1c1c52c..72fa19b 100644
---- a/compiler/main/SysTools.lhs
-+++ b/compiler/main/SysTools.lhs
-@@ -809,10 +809,10 @@ getCompilerInfo' dflags = do
- )
- (\err -> do
- debugTraceMsg dflags 2
-- (text "Error (figuring out compiler information):" <+>
-+ (text "Error (figuring out C compiler information):" <+>
- text (show err))
- errorMsg dflags $ hang (text "Warning:") 9 $
-- text "Couldn't figure out linker information!" $$
-+ text "Couldn't figure out C compiler information!" $$
- text "Make sure you're using GNU gcc, or clang"
- return UnknownCC)
- return info
diff --git a/dev-lang/ghc/files/ghc-7.8.3-pic-sparc.patch b/dev-lang/ghc/files/ghc-7.8.3-pic-sparc.patch
deleted file mode 100644
index 16a552fdd4be..000000000000
--- a/dev-lang/ghc/files/ghc-7.8.3-pic-sparc.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-commit 78863edbb0751f5c9694ea10c6132a87cfd0ee10
-Author: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Wed Aug 27 22:20:33 2014 +0300
-
- Revert "disable shared libs on sparc (linux/solaris) (fixes #8857)"
-
- This reverts commit 623883f1ed0ee11cc925c4590fb09565403fd231.
-
- The commit a93ab43ab5f40cadbedea2f6342b93c245e91434
- driver: pass '-fPIC' option to assembler as well
- fixes shared libraries on sparc at least on linux.
-
- Properly fixes Issue #8857
-
- Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-
-diff --git a/mk/config.mk.in b/mk/config.mk.in
-index c210cd3..392237f 100644
---- a/mk/config.mk.in
-+++ b/mk/config.mk.in
-@@ -97,9 +97,7 @@ endif
- # Some platforms don't support shared libraries
- NoSharedLibsPlatformList = powerpc-unknown-linux \
- x86_64-unknown-mingw32 \
-- i386-unknown-mingw32 \
-- sparc-sun-solaris2 \
-- sparc-unknown-linux
-+ i386-unknown-mingw32
-
- ifeq "$(SOLARIS_BROKEN_SHLD)" "YES"
- NoSharedLibsPlatformList += i386-unknown-solaris2
diff --git a/dev-lang/ghc/files/ghc-7.8.3-ppc32-fPIC.patch b/dev-lang/ghc/files/ghc-7.8.3-ppc32-fPIC.patch
deleted file mode 100644
index 434be8b1bdad..000000000000
--- a/dev-lang/ghc/files/ghc-7.8.3-ppc32-fPIC.patch
+++ /dev/null
@@ -1,351 +0,0 @@
-commit fa31e8f4a0f853848d96549a429083941877bf8d
-Author: Sergei Trofimovich <siarheit@google.com>
-Date: Sun Dec 14 14:30:12 2014 +0000
-
- powerpc: fix and enable shared libraries by default on linux
-
- Summary:
- And fix things all the way down to it. Namely:
- - remove 'r30' from free registers, it's an .LCTOC1 register
- for gcc. generated .plt stubs expect it to be initialised.
- - fix PicBase computation, which originally forgot to use 'tmp'
- reg in 'initializePicBase_ppc.fetchPC'
- - mark 'ForeighTarget's as implicitly using 'PicBase' register
- (see comment for details)
- - add 64-bit MO_Sub and test on alloclimit3/4 regtests
- - fix dynamic label offsets to match with .LCTOC1 offset
-
- Signed-off-by: Sergei Trofimovich <siarheit@google.com>
-
- Test Plan: validate passes equal amount of vanilla/dyn tests
-
- Reviewers: simonmar, erikd, austin
-
- Reviewed By: erikd, austin
-
- Subscribers: carter, thomie
-
- Differential Revision: https://phabricator.haskell.org/D560
-
- GHC Trac Issues: #8024, #9831
-
-diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs
-index 0f2c0ae..37b8ada 100644
---- a/compiler/cmm/CLabel.hs
-+++ b/compiler/cmm/CLabel.hs
-@@ -1170,7 +1170,8 @@ pprDynamicLinkerAsmLabel platform dllInfo lbl
- else if osElfTarget (platformOS platform)
- then if platformArch platform == ArchPPC
- then case dllInfo of
-- CodeStub -> ppr lbl <> text "@plt"
-+ CodeStub -> -- See Note [.LCTOC1 in PPC PIC code]
-+ ppr lbl <> text "+32768@plt"
- SymbolPtr -> text ".LC_" <> ppr lbl
- _ -> panic "pprDynamicLinkerAsmLabel"
- else if platformArch platform == ArchX86_64
-diff --git a/compiler/nativeGen/PIC.hs b/compiler/nativeGen/PIC.hs
-index 9b5c080..6326a8b 100644
---- a/compiler/nativeGen/PIC.hs
-+++ b/compiler/nativeGen/PIC.hs
-@@ -54,7 +54,6 @@ import qualified X86.Instr as X86
-
- import Platform
- import Instruction
--import Size
- import Reg
- import NCGMonad
-
-@@ -468,11 +467,8 @@ pprGotDeclaration dflags ArchX86 OSDarwin
- pprGotDeclaration _ _ OSDarwin
- = empty
-
---- pprGotDeclaration
-+-- Emit GOT declaration
- -- Output whatever needs to be output once per .s file.
---- The .LCTOC1 label is defined to point 32768 bytes into the table,
---- to make the most of the PPC's 16-bit displacements.
---- Only needed for PIC.
- pprGotDeclaration dflags arch os
- | osElfTarget os
- , arch /= ArchPPC_64
-@@ -482,6 +478,7 @@ pprGotDeclaration dflags arch os
- | osElfTarget os
- , arch /= ArchPPC_64
- = vcat [
-+ -- See Note [.LCTOC1 in PPC PIC code]
- ptext (sLit ".section \".got2\",\"aw\""),
- ptext (sLit ".LCTOC1 = .+32768") ]
-
-@@ -688,12 +685,7 @@ pprImportedSymbol _ _ _
-
-
- -- Get a pointer to our own fake GOT, which is defined on a per-module basis.
---- This is exactly how GCC does it, and it's quite horrible:
---- We first fetch the address of a local label (mkPicBaseLabel).
---- Then we add a 16-bit offset to that to get the address of a .long that we
---- define in .text space right next to the proc. This .long literal contains
---- the (32-bit) offset from our local label to our global offset table
---- (.LCTOC1 aka gotOffLabel).
-+-- This is exactly how GCC does it in linux.
-
- initializePicBase_ppc
- :: Arch -> OS -> Reg
-@@ -704,18 +696,9 @@ initializePicBase_ppc ArchPPC os picReg
- (CmmProc info lab live (ListGraph blocks) : statics)
- | osElfTarget os
- = do
-- dflags <- getDynFlags
-- gotOffLabel <- getNewLabelNat
-- tmp <- getNewRegNat $ intSize (wordWidth dflags)
- let
-- gotOffset = CmmData Text $ Statics gotOffLabel [
-- CmmStaticLit (CmmLabelDiffOff gotLabel
-- mkPicBaseLabel
-- 0)
-- ]
-- offsetToOffset
-- = PPC.ImmConstantDiff
-- (PPC.ImmCLbl gotOffLabel)
-+ gotOffset = PPC.ImmConstantDiff
-+ (PPC.ImmCLbl gotLabel)
- (PPC.ImmCLbl mkPicBaseLabel)
-
- blocks' = case blocks of
-@@ -726,15 +709,23 @@ initializePicBase_ppc ArchPPC os picReg
- | bID `mapMember` info = fetchPC b
- | otherwise = b
-
-+ -- GCC does PIC prologs thusly:
-+ -- bcl 20,31,.L1
-+ -- .L1:
-+ -- mflr 30
-+ -- addis 30,30,.LCTOC1-.L1@ha
-+ -- addi 30,30,.LCTOC1-.L1@l
-+ -- TODO: below we use it over temporary register,
-+ -- it can and should be optimised by picking
-+ -- correct PIC reg.
- fetchPC (BasicBlock bID insns) =
- BasicBlock bID (PPC.FETCHPC picReg
-- : PPC.ADDIS tmp picReg (PPC.HI offsetToOffset)
-- : PPC.LD PPC.archWordSize tmp
-- (PPC.AddrRegImm tmp (PPC.LO offsetToOffset))
-- : PPC.ADD picReg picReg (PPC.RIReg picReg)
-+ : PPC.ADDIS picReg picReg (PPC.HA gotOffset)
-+ : PPC.ADDI picReg picReg (PPC.LO gotOffset)
-+ : PPC.MR PPC.r30 picReg
- : insns)
-
-- return (CmmProc info lab live (ListGraph blocks') : gotOffset : statics)
-+ return (CmmProc info lab live (ListGraph blocks') : statics)
-
-
- initializePicBase_ppc ArchPPC OSDarwin picReg
-diff --git a/compiler/nativeGen/PPC/CodeGen.hs b/compiler/nativeGen/PPC/CodeGen.hs
-index ddf483a..c1c4a74 100644
---- a/compiler/nativeGen/PPC/CodeGen.hs
-+++ b/compiler/nativeGen/PPC/CodeGen.hs
-@@ -54,7 +54,7 @@ import Outputable
- import Unique
- import DynFlags
-
--import Control.Monad ( mapAndUnzipM )
-+import Control.Monad ( mapAndUnzipM, when )
- import Data.Bits
- import Data.Word
-
-@@ -355,6 +355,19 @@ iselExpr64 (CmmMachOp (MO_Add _) [e1,e2]) = do
- ADDE rhi r1hi r2hi ]
- return (ChildCode64 code rlo)
-
-+iselExpr64 (CmmMachOp (MO_Sub _) [e1,e2]) = do
-+ ChildCode64 code1 r1lo <- iselExpr64 e1
-+ ChildCode64 code2 r2lo <- iselExpr64 e2
-+ (rlo,rhi) <- getNewRegPairNat II32
-+ let
-+ r1hi = getHiVRegFromLo r1lo
-+ r2hi = getHiVRegFromLo r2lo
-+ code = code1 `appOL`
-+ code2 `appOL`
-+ toOL [ SUBFC rlo r2lo r1lo,
-+ SUBFE rhi r2hi r1hi ]
-+ return (ChildCode64 code rlo)
-+
- iselExpr64 (CmmMachOp (MO_UU_Conv W32 W64) [expr]) = do
- (expr_reg,expr_code) <- getSomeReg expr
- (rlo, rhi) <- getNewRegPairNat II32
-@@ -918,8 +931,12 @@ genCCall' dflags gcp target dest_regs args0
- (toOL []) []
-
- (labelOrExpr, reduceToFF32) <- case target of
-- ForeignTarget (CmmLit (CmmLabel lbl)) _ -> return (Left lbl, False)
-- ForeignTarget expr _ -> return (Right expr, False)
-+ ForeignTarget (CmmLit (CmmLabel lbl)) _ -> do
-+ uses_pic_base_implicitly
-+ return (Left lbl, False)
-+ ForeignTarget expr _ -> do
-+ uses_pic_base_implicitly
-+ return (Right expr, False)
- PrimTarget mop -> outOfLineMachOp mop
-
- let codeBefore = move_sp_down finalStack `appOL` passArgumentsCode
-@@ -940,6 +957,13 @@ genCCall' dflags gcp target dest_regs args0
- where
- platform = targetPlatform dflags
-
-+ uses_pic_base_implicitly = do
-+ -- See Note [implicit register in PPC PIC code]
-+ -- on why we claim to use PIC register here
-+ when (gopt Opt_PIC dflags) $ do
-+ _ <- getPicBaseNat archWordSize
-+ return ()
-+
- initialStackOffset = case gcp of
- GCPDarwin -> 24
- GCPLinux -> 8
-@@ -1431,3 +1455,21 @@ coerceFP2Int _ toRep x = do
- -- read low word of value (high word is undefined)
- LD II32 dst (spRel dflags 3)]
- return (Any (intSize toRep) code')
-+
-+-- Note [.LCTOC1 in PPC PIC code]
-+-- The .LCTOC1 label is defined to point 32768 bytes into the GOT table
-+-- to make the most of the PPC's 16-bit displacements.
-+-- As 16-bit signed offset is used (usually via addi/lwz instructions)
-+-- first element will have '-32768' offset against .LCTOC1.
-+
-+-- Note [implicit register in PPC PIC code]
-+-- PPC generates calls by labels in assembly
-+-- in form of:
-+-- bl puts+32768@plt
-+-- in this form it's not seen directly (by GHC NCG)
-+-- that r30 (PicBaseReg) is used,
-+-- but r30 is a required part of PLT code setup:
-+-- puts+32768@plt:
-+-- lwz r11,-30484(r30) ; offset in .LCTOC1
-+-- mtctr r11
-+-- bctr
-diff --git a/compiler/nativeGen/PPC/Instr.hs b/compiler/nativeGen/PPC/Instr.hs
-index f5b9506..b7081f9 100644
---- a/compiler/nativeGen/PPC/Instr.hs
-+++ b/compiler/nativeGen/PPC/Instr.hs
-@@ -205,8 +205,11 @@ data Instr
- | ADD Reg Reg RI -- dst, src1, src2
- | ADDC Reg Reg Reg -- (carrying) dst, src1, src2
- | ADDE Reg Reg Reg -- (extend) dst, src1, src2
-+ | ADDI Reg Reg Imm -- Add Immediate dst, src1, src2
- | ADDIS Reg Reg Imm -- Add Immediate Shifted dst, src1, src2
- | SUBF Reg Reg Reg -- dst, src1, src2 ; dst = src2 - src1
-+ | SUBFC Reg Reg Reg -- (carrying) dst, src1, src2 ; dst = src2 - src1
-+ | SUBFE Reg Reg Reg -- (extend) dst, src1, src2 ; dst = src2 - src1
- | MULLW Reg Reg RI
- | DIVW Reg Reg Reg
- | DIVWU Reg Reg Reg
-@@ -284,8 +287,11 @@ ppc_regUsageOfInstr platform instr
- ADD reg1 reg2 ri -> usage (reg2 : regRI ri, [reg1])
- ADDC reg1 reg2 reg3 -> usage ([reg2,reg3], [reg1])
- ADDE reg1 reg2 reg3 -> usage ([reg2,reg3], [reg1])
-+ ADDI reg1 reg2 _ -> usage ([reg2], [reg1])
- ADDIS reg1 reg2 _ -> usage ([reg2], [reg1])
- SUBF reg1 reg2 reg3 -> usage ([reg2,reg3], [reg1])
-+ SUBFC reg1 reg2 reg3 -> usage ([reg2,reg3], [reg1])
-+ SUBFE reg1 reg2 reg3 -> usage ([reg2,reg3], [reg1])
- MULLW reg1 reg2 ri -> usage (reg2 : regRI ri, [reg1])
- DIVW reg1 reg2 reg3 -> usage ([reg2,reg3], [reg1])
- DIVWU reg1 reg2 reg3 -> usage ([reg2,reg3], [reg1])
-@@ -358,8 +364,11 @@ ppc_patchRegsOfInstr instr env
- ADD reg1 reg2 ri -> ADD (env reg1) (env reg2) (fixRI ri)
- ADDC reg1 reg2 reg3 -> ADDC (env reg1) (env reg2) (env reg3)
- ADDE reg1 reg2 reg3 -> ADDE (env reg1) (env reg2) (env reg3)
-+ ADDI reg1 reg2 imm -> ADDI (env reg1) (env reg2) imm
- ADDIS reg1 reg2 imm -> ADDIS (env reg1) (env reg2) imm
- SUBF reg1 reg2 reg3 -> SUBF (env reg1) (env reg2) (env reg3)
-+ SUBFC reg1 reg2 reg3 -> SUBFC (env reg1) (env reg2) (env reg3)
-+ SUBFE reg1 reg2 reg3 -> SUBFE (env reg1) (env reg2) (env reg3)
- MULLW reg1 reg2 ri -> MULLW (env reg1) (env reg2) (fixRI ri)
- DIVW reg1 reg2 reg3 -> DIVW (env reg1) (env reg2) (env reg3)
- DIVWU reg1 reg2 reg3 -> DIVWU (env reg1) (env reg2) (env reg3)
-diff --git a/compiler/nativeGen/PPC/Ppr.hs b/compiler/nativeGen/PPC/Ppr.hs
-index 6851769..f59d51f 100644
---- a/compiler/nativeGen/PPC/Ppr.hs
-+++ b/compiler/nativeGen/PPC/Ppr.hs
-@@ -525,6 +525,16 @@ pprInstr (BCTRL _) = hcat [
- ptext (sLit "bctrl")
- ]
- pprInstr (ADD reg1 reg2 ri) = pprLogic (sLit "add") reg1 reg2 ri
-+pprInstr (ADDI reg1 reg2 imm) = hcat [
-+ char '\t',
-+ ptext (sLit "addi"),
-+ char '\t',
-+ pprReg reg1,
-+ ptext (sLit ", "),
-+ pprReg reg2,
-+ ptext (sLit ", "),
-+ pprImm imm
-+ ]
- pprInstr (ADDIS reg1 reg2 imm) = hcat [
- char '\t',
- ptext (sLit "addis"),
-@@ -539,6 +549,8 @@ pprInstr (ADDIS reg1 reg2 imm) = hcat [
- pprInstr (ADDC reg1 reg2 reg3) = pprLogic (sLit "addc") reg1 reg2 (RIReg reg3)
- pprInstr (ADDE reg1 reg2 reg3) = pprLogic (sLit "adde") reg1 reg2 (RIReg reg3)
- pprInstr (SUBF reg1 reg2 reg3) = pprLogic (sLit "subf") reg1 reg2 (RIReg reg3)
-+pprInstr (SUBFC reg1 reg2 reg3) = pprLogic (sLit "subfc") reg1 reg2 (RIReg reg3)
-+pprInstr (SUBFE reg1 reg2 reg3) = pprLogic (sLit "subfe") reg1 reg2 (RIReg reg3)
- pprInstr (MULLW reg1 reg2 ri@(RIReg _)) = pprLogic (sLit "mullw") reg1 reg2 ri
- pprInstr (MULLW reg1 reg2 ri@(RIImm _)) = pprLogic (sLit "mull") reg1 reg2 ri
- pprInstr (DIVW reg1 reg2 reg3) = pprLogic (sLit "divw") reg1 reg2 (RIReg reg3)
-diff --git a/compiler/nativeGen/PPC/Regs.hs b/compiler/nativeGen/PPC/Regs.hs
-index 0f636bf..69e69c0 100644
---- a/compiler/nativeGen/PPC/Regs.hs
-+++ b/compiler/nativeGen/PPC/Regs.hs
-@@ -37,7 +37,8 @@ module PPC.Regs (
- fits16Bits,
- makeImmediate,
- fReg,
-- sp, r3, r4, r27, r28, f1, f20, f21,
-+ sp, r3, r4, r27, r28, r30,
-+ f1, f20, f21,
-
- allocatableRegs
-
-@@ -295,12 +296,13 @@ point registers.
- fReg :: Int -> RegNo
- fReg x = (32 + x)
-
--sp, r3, r4, r27, r28, f1, f20, f21 :: Reg
-+sp, r3, r4, r27, r28, r30, f1, f20, f21 :: Reg
- sp = regSingle 1
- r3 = regSingle 3
- r4 = regSingle 4
- r27 = regSingle 27
- r28 = regSingle 28
-+r30 = regSingle 30
- f1 = regSingle $ fReg 1
- f20 = regSingle $ fReg 20
- f21 = regSingle $ fReg 21
-diff --git a/includes/CodeGen.Platform.hs b/includes/CodeGen.Platform.hs
-index 9916e0e..1d46a01 100644
---- a/includes/CodeGen.Platform.hs
-+++ b/includes/CodeGen.Platform.hs
-@@ -881,6 +881,8 @@ freeReg 1 = fastBool False -- The Stack Pointer
- # if !MACHREGS_darwin
- -- most non-darwin powerpc OSes use r2 as a TOC pointer or something like that
- freeReg 2 = fastBool False
-+-- at least linux in -fPIC relies on r30 in PLT stubs
-+freeReg 30 = fastBool False
- # endif
- # ifdef REG_Base
- freeReg REG_Base = fastBool False
-diff --git a/mk/config.mk.in b/mk/config.mk.in
-index 0f5820f..8f134bc 100644
---- a/mk/config.mk.in
-+++ b/mk/config.mk.in
-@@ -95,7 +95,7 @@ TargetElf = YES
- endif
-
- # Some platforms don't support shared libraries
--NoSharedLibsPlatformList = powerpc-unknown-linux \
-+NoSharedLibsPlatformList = \
- x86_64-unknown-mingw32 \
- i386-unknown-mingw32
-
diff --git a/dev-lang/ghc/files/ghc-7.8.4-gold.patch b/dev-lang/ghc/files/ghc-7.8.4-gold.patch
deleted file mode 100644
index a8e9b1e6c857..000000000000
--- a/dev-lang/ghc/files/ghc-7.8.4-gold.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Gentoo-bug: https://bugs.gentoo.org/536426
-Reported-by: Eric Siegel
-commit 021b7978d14799bae779907faf7490cfd21b3f46
-Author: Austin Seipp <austin@well-typed.com>
-Date: Sun Jul 20 10:13:15 2014 -0500
-
- driver: use absolute paths in ld scripts (#7452)
-
- Patch contributed by slowmo.
-
- Signed-off-by: Austin Seipp <austin@well-typed.com>
-
-diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
-index 11427e2..49126fe 100644
---- a/compiler/main/DriverPipeline.hs
-+++ b/compiler/main/DriverPipeline.hs
-@@ -2166,7 +2166,9 @@ joinObjectFiles dflags o_files output_fn = do
- if ldIsGnuLd
- then do
- script <- newTempName dflags "ldscript"
-- writeFile script $ "INPUT(" ++ unwords o_files ++ ")"
-+ cwd <- getCurrentDirectory
-+ let o_files_abs = map (cwd </>) o_files
-+ writeFile script $ "INPUT(" ++ unwords o_files_abs ++ ")"
- ld_r [SysTools.FileOption "" script] ccInfo
- else if sLdSupportsFilelist mySettings
- then do
diff --git a/dev-lang/ghc/files/ghc-7.8.4-ia64-CLOSUREs.patch b/dev-lang/ghc/files/ghc-7.8.4-ia64-CLOSUREs.patch
deleted file mode 100644
index 9d50792bcf45..000000000000
--- a/dev-lang/ghc/files/ghc-7.8.4-ia64-CLOSUREs.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From b677ba51cf8131a6f6ddcdfee8dd2a8c4c2b4ac7 Mon Sep 17 00:00:00 2001
-From: Sergei Trofimovich <siarheit@google.com>
-Date: Sat, 17 Jan 2015 14:27:13 +0000
-Subject: [PATCH 1/3] CMM: add a mechanism to import C data labels
-
-Fixes threaded runtime on ia64.
-sm_mutex there was not referenced correctly.
-
-Signed-off-by: Sergei Trofimovich <siarheit@google.com>
----
- compiler/cmm/CmmParse.y | 4 ++++
- rts/Exception.cmm | 2 +-
- rts/PrimOps.cmm | 6 +++---
- 3 files changed, 8 insertions(+), 4 deletions(-)
-
-diff --git a/compiler/cmm/CmmParse.y.source b/compiler/cmm/CmmParse.y.source
-index 6b51e51..fd9489b 100644
---- a/compiler/cmm/CmmParse.y.source
-+++ b/compiler/cmm/CmmParse.y.source
-@@ -575,6 +575,10 @@ importName
- : NAME
- { ($1, mkForeignLabel $1 Nothing ForeignLabelInExternalPackage IsFunction) }
-
-+ -- as previous 'NAME', but 'IsData'
-+ | 'CLOSURE' NAME
-+ { ($2, mkForeignLabel $2 Nothing ForeignLabelInExternalPackage IsData) }
-+
- -- A label imported with an explicit packageId.
- | STRING NAME
- { ($2, mkCmmCodeLabel (fsToPackageKey (mkFastString $1)) $2) }
-diff --git a/rts/Exception.cmm b/rts/Exception.cmm
-index 5007ef3..8d19c14 100644
---- a/rts/Exception.cmm
-+++ b/rts/Exception.cmm
-@@ -13,7 +13,7 @@
- #include "Cmm.h"
- #include "RaiseAsync.h"
-
--import ghczmprim_GHCziTypes_True_closure;
-+import CLOSURE ghczmprim_GHCziTypes_True_closure;
-
- /* -----------------------------------------------------------------------------
- Exception Primitives
-diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm
-index 3e8612c..2e6ca46 100644
---- a/rts/PrimOps.cmm
-+++ b/rts/PrimOps.cmm
-@@ -28,12 +28,12 @@
- import pthread_mutex_lock;
- import pthread_mutex_unlock;
- #endif
--import base_ControlziExceptionziBase_nestedAtomically_closure;
-+import CLOSURE base_ControlziExceptionziBase_nestedAtomically_closure;
- import EnterCriticalSection;
- import LeaveCriticalSection;
--import ghczmprim_GHCziTypes_False_closure;
-+import CLOSURE ghczmprim_GHCziTypes_False_closure;
- #if defined(USE_MINIINTERPRETER) || !defined(mingw32_HOST_OS)
--import sm_mutex;
-+import CLOSURE sm_mutex;
- #endif
-
- /*-----------------------------------------------------------------------------
---
-2.2.1
-
diff --git a/dev-lang/ghc/files/ghc-8.0.1-limit-jN.patch b/dev-lang/ghc/files/ghc-8.0.1-limit-jN.patch
deleted file mode 100644
index dc5410da3020..000000000000
--- a/dev-lang/ghc/files/ghc-8.0.1-limit-jN.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-commit 501e05bb1b8974fc8b6c9eee86c87c367e87a211
-Author: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Tue Aug 30 12:10:47 2016 +0100
-
- GhcMake: limit Capability count to CPU count in parallel mode
-
- In Trac #9221 one of problems using high --jobs=<N>
- is amount of mutator (or GC) threads we crate.
-
- We use userspace spinning-and-yielding (see ACQUIRE_SPIN_LOCK)
- to acess work stealing queues. In case of
- N-worker-threads > N-CPUs fraction of time when
- thread holding spin lock gets descheduled by kernel
- increases. That causes other threads to waste CPU time
- before giving up CPU.
-
- Signed-off-by: Sergei Trofimovich <siarheit@google.com>
-
- Test Plan:
- ghc --make -j8 and -j80 have comparable sys time
- on a 8-core system.
-
- Reviewers: austin, gintas, bgamari, simonmar
-
- Reviewed By: bgamari, simonmar
-
- Subscribers: thomie
-
- Differential Revision: https://phabricator.haskell.org/D2482
-
- GHC Trac Issues: #9221
-
-diff --git a/compiler/main/GhcMake.hs b/compiler/main/GhcMake.hs
-index 9dc43cd..905df63 100644
---- a/compiler/main/GhcMake.hs
-+++ b/compiler/main/GhcMake.hs
-@@ -761,7 +761,12 @@ parUpsweep n_jobs old_hpt stable_mods cleanup sccs = do
-
- let updNumCapabilities = liftIO $ do
- n_capabilities <- getNumCapabilities
-- unless (n_capabilities /= 1) $ setNumCapabilities n_jobs
-+ n_cpus <- getNumProcessors
-+ -- Setting number of capabilities more than
-+ -- CPU count usually leads to high userspace
-+ -- lock contention. Trac #9221
-+ let n_caps = min n_jobs n_cpus
-+ unless (n_capabilities /= 1) $ setNumCapabilities n_caps
- return n_capabilities
- -- Reset the number of capabilities once the upsweep ends.
- let resetNumCapabilities orig_n = liftIO $ setNumCapabilities orig_n
diff --git a/dev-lang/ghc/files/ghc-8.0.1-par-g0-on-A32.patch b/dev-lang/ghc/files/ghc-8.0.1-par-g0-on-A32.patch
deleted file mode 100644
index b46e57301782..000000000000
--- a/dev-lang/ghc/files/ghc-8.0.1-par-g0-on-A32.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-commit bdfc5375f219d6def81effda4e57cb56d01fc917
-Author: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Tue Aug 30 12:10:54 2016 +0100
-
- rts: enable parallel GC scan of large (32M+) allocation area
-
- Parallel GC does not scan large allocation area (-A)
- effectively as it does not do work stealing from nursery
- by default.
-
- That leads to large imbalance when only one of threads
- overflows allocation area: most of GC threads finish
- quickly (as there is not much to collect) and sit idle
- waiting while single GC thread finishes scan of single
- allocation area for that thread.
-
- The patch enables work stealing for (equivalent of -qb0)
- allocation area of -A32M or higher.
-
- Tested on a highlighting-kate package from Trac #9221
-
- On 8-core machine the difference is around 5% faster
- of wall-clock time. On 24-core VM the speedup is 20%.
-
- Signed-off-by: Sergei Trofimovich <siarheit@google.com>
-
- Test Plan: measured wall time and GC parallelism on highlighting-kate build
-
- Reviewers: austin, bgamari, erikd, simonmar
-
- Reviewed By: bgamari, simonmar
-
- Subscribers: thomie
-
- Differential Revision: https://phabricator.haskell.org/D2483
-
- GHC Trac Issues: #9221
-
-diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c
-index fda33f0..7a719b9 100644
---- a/rts/RtsFlags.c
-+++ b/rts/RtsFlags.c
-@@ -237,1 +237,1 @@ void initRtsFlagsDefaults(void)
-- RtsFlags.ParFlags.parGcLoadBalancingGen = 1;
-+ RtsFlags.ParFlags.parGcLoadBalancingGen = ~0u; /* auto, based on -A */
-@@ -1398,2 +1390,19 @@ static void normaliseRtsOpts (void)
- }
-
-+#ifdef THREADED_RTS
-+ if (RtsFlags.ParFlags.parGcLoadBalancingGen == ~0u) {
-+ StgWord alloc_area_bytes
-+ = RtsFlags.GcFlags.minAllocAreaSize * BLOCK_SIZE;
-+
-+ // If allocation area is larger that CPU cache
-+ // we can finish scanning quicker doing work-stealing
-+ // scan. Trac #9221
-+ // 32M looks big enough not to fit into L2 cache
-+ // of popular modern CPUs.
-+ if (alloc_area_bytes >= 32 * 1024 * 1024) {
-+ RtsFlags.ParFlags.parGcLoadBalancingGen = 0;
-+ } else {
-+ RtsFlags.ParFlags.parGcLoadBalancingGen = 1;
-+ }
-+ }
-+#endif
diff --git a/dev-lang/ghc/files/ghc-8.0.1-ww-args-limit.patch b/dev-lang/ghc/files/ghc-8.0.1-ww-args-limit.patch
deleted file mode 100644
index 4752f4482678..000000000000
--- a/dev-lang/ghc/files/ghc-8.0.1-ww-args-limit.patch
+++ /dev/null
@@ -1,127 +0,0 @@
-commit 5efbf0d243984444cf352ad6f0d147e226c64498
-Author: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Thu Sep 1 17:34:58 2016 +0100
-
- restore -fmax-worker-args handling (Trac #11565)
-
- maxWorkerArgs handling was accidentally lost 3 years ago
- in a major update of demand analysis
- commit 0831a12ea2fc73c33652eeec1adc79fa19700578
-
- Old regression is noticeable as:
- - code bloat (requires stack reshuffling)
- - compilation slowdown (more code to optimise/generate)
- - and increased heap usage (DynFlags unboxing/reboxing?)
-
- On a simple compile benchmark this change causes heap
- allocation drop from 70G don to 67G (ghc perf build).
-
- Signed-off-by: Sergei Trofimovich <siarheit@google.com>
-
- Reviewers: simonpj, ezyang, goldfire, austin, bgamari
-
- Reviewed By: simonpj, ezyang
-
- Subscribers: thomie
-
- Differential Revision: https://phabricator.haskell.org/D2503
-
- GHC Trac Issues: #11565
-
-diff --git a/compiler/specialise/SpecConstr.hs b/compiler/specialise/SpecConstr.hs
-index 10d5614..7166f57 100644
---- a/compiler/specialise/SpecConstr.hs
-+++ b/compiler/specialise/SpecConstr.hs
-@@ -29,7 +29,7 @@ import CoreFVs ( exprsFreeVarsList )
- import CoreMonad
- import Literal ( litIsLifted )
- import HscTypes ( ModGuts(..) )
--import WwLib ( mkWorkerArgs )
-+import WwLib ( isWorkerSmallEnough, mkWorkerArgs )
- import DataCon
- import Coercion hiding( substCo )
- import Rules
-@@ -1533,10 +1533,14 @@ specialise env bind_calls (RI { ri_fn = fn, ri_lam_bndrs = arg_bndrs
-
- | Just all_calls <- lookupVarEnv bind_calls fn
- = -- pprTrace "specialise entry {" (ppr fn <+> ppr (length all_calls)) $
-- do { (boring_call, pats) <- callsToPats env specs arg_occs all_calls
--
-+ do { (boring_call, all_pats) <- callsToPats env specs arg_occs all_calls
- -- Bale out if too many specialisations
-- ; let n_pats = length pats
-+ ; let pats = filter (is_small_enough . fst) all_pats
-+ is_small_enough vars = isWorkerSmallEnough (sc_dflags env) vars
-+ -- We are about to construct w/w pair in 'spec_one'.
-+ -- Omit specialisation leading to high arity workers.
-+ -- See Note [Limit w/w arity]
-+ n_pats = length pats
- spec_count' = n_pats + spec_count
- ; case sc_count env of
- Just max | not (sc_force env) && spec_count' > max
-diff --git a/compiler/stranal/WwLib.hs b/compiler/stranal/WwLib.hs
-index 09bc204..d9460d9 100644
---- a/compiler/stranal/WwLib.hs
-+++ b/compiler/stranal/WwLib.hs
-@@ -8,6 +8,7 @@
-
- module WwLib ( mkWwBodies, mkWWstr, mkWorkerArgs
- , deepSplitProductType_maybe, findTypeShape
-+ , isWorkerSmallEnough
- ) where
-
- #include "HsVersions.h"
-@@ -144,7 +145,8 @@ mkWwBodies dflags fam_envs fun_ty demands res_info one_shots
- wrapper_body = wrap_fn_args . wrap_fn_cpr . wrap_fn_str . applyToVars work_call_args . Var
- worker_body = mkLams work_lam_args. work_fn_str . work_fn_cpr . work_fn_args
-
-- ; if useful1 && not (only_one_void_argument) || useful2
-+ ; if isWorkerSmallEnough dflags work_args
-+ && (useful1 && not only_one_void_argument || useful2)
- then return (Just (worker_args_dmds, wrapper_body, worker_body))
- else return Nothing
- }
-@@ -165,6 +167,12 @@ mkWwBodies dflags fam_envs fun_ty demands res_info one_shots
- | otherwise
- = False
-
-+-- See Note [Limit w/w arity]
-+isWorkerSmallEnough :: DynFlags -> [Var] -> Bool
-+isWorkerSmallEnough dflags vars = count isId vars <= maxWorkerArgs dflags
-+ -- We count only Free variables (isId) to skip Type, Kind
-+ -- variables which have no runtime representation.
-+
- {-
- Note [Always do CPR w/w]
- ~~~~~~~~~~~~~~~~~~~~~~~~
-@@ -178,6 +186,30 @@ a disaster, because then the enclosing function might say it has the CPR
- property, but now doesn't and there a cascade of disaster. A good example
- is Trac #5920.
-
-+Note [Limit w/w arity]
-+~~~~~~~~~~~~~~~~~~~~~~~~
-+Guard against high worker arity as it generates a lot of stack traffic.
-+A simplified example is Trac #11565#comment:6
-+
-+Current strategy is very simple: don't perform w/w transformation at all
-+if the result produces a wrapper with arity higher than -fmax-worker-args=.
-+
-+It is a bit all or nothing, consider
-+
-+ f (x,y) (a,b,c,d,e ... , z) = rhs
-+
-+Currently we will remove all w/w ness entirely. But actually we could
-+w/w on the (x,y) pair... it's the huge product that is the problem.
-+
-+Could we instead refrain from w/w on an arg-by-arg basis? Yes, that'd
-+solve f. But we can get a lot of args from deeply-nested products:
-+
-+ g (a, (b, (c, (d, ...)))) = rhs
-+
-+This is harder to spot on an arg-by-arg basis. Previously mkWwStr was
-+given some "fuel" saying how many arguments it could add; when we ran
-+out of fuel it would stop w/wing.
-+Still not very clever because it had a left-right bias.
-
- ************************************************************************
- * *
diff --git a/dev-lang/ghc/files/ghc-8.0.1_rc1-cgen-constify.patch b/dev-lang/ghc/files/ghc-8.0.1_rc1-cgen-constify.patch
deleted file mode 100644
index 877a5827e4ea..000000000000
--- a/dev-lang/ghc/files/ghc-8.0.1_rc1-cgen-constify.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-commit b0cf3ab7a69b878a4335d21a347b56e4b0ca0b7b
-Author: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Mon Apr 14 19:06:24 2014 +0300
-
- compiler/cmm/PprC.hs: constify local string literals
-
- Consider one-line module
- module B (v) where v = "hello"
- in -fvia-C mode it generates code like
- static char gibberish_str[] = "hello";
-
- It uselessly eats data section (precious resource on ia64!).
- The patch switches genrator to emit:
- static const char gibberish_str[] = "hello";
-
- Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-
-diff --git a/compiler/cmm/PprC.hs b/compiler/cmm/PprC.hs
-index 2398981..fdb578d 100644
---- a/compiler/cmm/PprC.hs
-+++ b/compiler/cmm/PprC.hs
-@@ -112,6 +112,12 @@ pprTop (CmmProc infos clbl _ graph) =
-
- -- We only handle (a) arrays of word-sized things and (b) strings.
-
-+pprTop (CmmData (Section ReadOnlyData _) (Statics lbl [CmmString str])) =
-+ hcat [
-+ pprLocalness lbl, ptext (sLit "const char "), ppr lbl,
-+ ptext (sLit "[] = "), pprStringInCStyle str, semi
-+ ]
-+
- pprTop (CmmData _section (Statics lbl [CmmString str])) =
- hcat [
- pprLocalness lbl, ptext (sLit "char "), ppr lbl,
diff --git a/dev-lang/ghc/files/ghc-8.0.2-O2-unreg.patch b/dev-lang/ghc/files/ghc-8.0.2-O2-unreg.patch
deleted file mode 100644
index b64d65b80a05..000000000000
--- a/dev-lang/ghc/files/ghc-8.0.2-O2-unreg.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-ghc -O2 generates too large C files for unregisterised compiler.
-On ia64 it causes DynFlags to compile for 60 minutes (then assembler
-crashes).
-
-To decrease C code inflation we don't use -O2 in UNREG mode.
-diff --git a/mk/config.mk.in b/mk/config.mk.in
-index bfaaa66..d8f93b3 100644
---- a/mk/config.mk.in
-+++ b/mk/config.mk.in
-@@ -72,11 +72,2 @@ GhcStage3HcOpts=-O2
-
--# Disable -O2 optimization. Otherwise amount of generated C code
--# makes things very slow to compile (~5 minutes on core-i7 for 'compiler/hsSyn/HsExpr.lhs')
--# and sometimes not compile at all (powerpc64 overflows something
--# on 'compiler/hsSyn/HsExpr.lhs').
--ifeq "$(GhcUnregisterised)" "YES"
--GhcStage1HcOpts=
--GhcStage2HcOpts=
--GhcStage3HcOpts=
--endif
-
-@@ -894 +885,13 @@ CURSES_INCLUDE_DIRS = @CURSES_INCLUDE_DIRS@
- CURSES_LIB_DIRS = @CURSES_LIB_DIRS@
-+
-+# Disable -O2 optimization. Otherwise amount of generated C code
-+# makes things very slow to compile (~5 minutes on core-i7 for 'compiler/hsSyn/HsExpr.lhs')
-+# and sometimes not compile at all (powerpc64 overflows something
-+# on 'compiler/hsSyn/HsExpr.lhs').
-+ifeq "$(GhcUnregisterised)" "YES"
-+GhcStage1HcOpts=
-+GhcStage2HcOpts=
-+GhcStage3HcOpts=
-+
-+GhcLibHcOpts=
-+endif
diff --git a/dev-lang/ghc/files/ghc-8.0.2-binutils-2.30.patch b/dev-lang/ghc/files/ghc-8.0.2-binutils-2.30.patch
deleted file mode 100644
index f02cb238c6b9..000000000000
--- a/dev-lang/ghc/files/ghc-8.0.2-binutils-2.30.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-From 358b508051333882d4099acca8f269e6fb2b7d65 Mon Sep 17 00:00:00 2001
-From: Bertram Felgenhauer <int-e@gmx.de>
-Date: Thu, 3 May 2018 18:03:53 +0300
-Subject: [PATCH] Compute DW_FORM_block length correctly; also fixes #15068
-
-Before this patch, the pprUnwindwExpr function computed the length of
-by the following assembly fragment:
-
- .uleb128 1f-.-1
- <expression data>
-1:
-
-That is, to compute the length, it takes the difference of the label 1
-and the address of the .uleb128 directive, and subtracts 1.
-
-In #15068 it was reported that `as` from binutils 4.30 has trouble with
-evaluating the `.` part of the expression. However, there is actually a
-problem with the expression, if the length of the data ever becomes
-larger than 128: In that case, the .uleb128 directive will emit more
-than 1 byte, and the computed length will be wrong.
-
-The present patch changes the assembly fragment to use two labels,
-which fixes both these problems.
-
- .uleb128 2f-1f
-1:
- <expression data>
-2:
-
-Test Plan: validate
-
-Reviewers: bgamari, osa1
-
-Reviewed By: bgamari
-
-Subscribers: thomie, carter
-
-GHC Trac Issues: #15068
-
-Differential Revision: https://phabricator.haskell.org/D4654
----
- compiler/nativeGen/Dwarf/Types.hs | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/compiler/nativeGen/Dwarf/Types.hs b/compiler/nativeGen/Dwarf/Types.hs
-index 23a2c920e7..579ed0d256 100644
---- a/compiler/nativeGen/Dwarf/Types.hs
-+++ b/compiler/nativeGen/Dwarf/Types.hs
-@@ -492,9 +492,11 @@ pprUnwindExpr spIsCFA expr
- pprE (UwPlus u1 u2) = pprE u1 $$ pprE u2 $$ pprByte dW_OP_plus
- pprE (UwMinus u1 u2) = pprE u1 $$ pprE u2 $$ pprByte dW_OP_minus
- pprE (UwTimes u1 u2) = pprE u1 $$ pprE u2 $$ pprByte dW_OP_mul
-- in text "\t.uleb128 1f-.-1" $$ -- DW_FORM_block length
-+ in text "\t.uleb128 2f-1f" $$ -- DW_FORM_block length
-+ -- computed as the difference of the following local labels 2: and 1:
-+ text "1:" $$
- pprE expr $$
-- text "1:"
-+ text "2:"
-
- -- | Generate code for re-setting the unwind information for a
- -- register to @undefined@
---
-2.17.0
-
diff --git a/dev-lang/ghc/files/ghc-8.0.2-libffi-alpha.patch b/dev-lang/ghc/files/ghc-8.0.2-libffi-alpha.patch
deleted file mode 100644
index 166f7fe42991..000000000000
--- a/dev-lang/ghc/files/ghc-8.0.2-libffi-alpha.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-commit 2c220c4b053c8efb2098ee20910084a42a0b2dcd
-Author: Sergei Trofimovich <siarheit@google.com>
-Date: Sun Jan 29 11:59:36 2017 +0000
-
- libffi: fix build COMPLEX build failure on alpha
-
- libtool: compile: alpha-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude \
- -I../src -I. -I../include -Iinclude -I../src -Wall -w -mieee -D_REENTRANT -fno-stack-protector \
- -w -MT src/alpha/osf.lo -MMD -MP -MF src/alpha/.deps/osf.Tpo \
- -c ../src/alpha/osf.S -fPIC -DPIC -o src/alpha/.libs/osf.o
-
- ../src/alpha/osf.S:298:2: error: #error "osf.S out of sync with ffi.h"
- #error "osf.S out of sync with ffi.h"
- ^
-
- Signed-off-by: Sergei Trofimovich <siarheit@google.com>
-
-diff --git a/libffi/ghc.mk b/libffi/ghc.mk
-index 7c5bc9e1b3..4297ed449e 100644
---- a/libffi/ghc.mk
-+++ b/libffi/ghc.mk
-@@ -63,6 +63,9 @@ $(libffi_STAMP_CONFIGURE): $(TOUCH_DEP)
- # will use cygwin symbolic links which cannot be read by mingw gcc.
- chmod +x libffi/ln
-
-+ # fix libffi build failure on alpha
-+ ( cd libffi/build && "$(PATCH_CMD)" -p0 < ../libffi.3.2.1-complex_alpha.diff; )
-+
- # We need to use -MMD rather than -MD, as otherwise we get paths
- # like c:/... in the dependency files on Windows, and the extra
- # colons break make
-diff --git a/libffi/libffi.3.2.1-complex_alpha.diff b/libffi/libffi.3.2.1-complex_alpha.diff
-new file mode 100644
-index 0000000000..0d6e0bc290
---- /dev/null
-+++ b/libffi/libffi.3.2.1-complex_alpha.diff
-@@ -0,0 +1,20 @@
-+--- src/alpha/osf.S.orig 2015-01-16 10:46:15.000000000 +0100
-++++ src/alpha/osf.S 2015-01-16 10:46:24.000000000 +0100
-+@@ -279,6 +279,7 @@
-+ .gprel32 $load_64 # FFI_TYPE_SINT64
-+ .gprel32 $load_none # FFI_TYPE_STRUCT
-+ .gprel32 $load_64 # FFI_TYPE_POINTER
-++ .gprel32 $load_none # FFI_TYPE_COMPLEX
-+
-+ /* Assert that the table above is in sync with ffi.h. */
-+
-+@@ -294,7 +295,8 @@
-+ || FFI_TYPE_SINT64 != 12 \
-+ || FFI_TYPE_STRUCT != 13 \
-+ || FFI_TYPE_POINTER != 14 \
-+- || FFI_TYPE_LAST != 14
-++ || FFI_TYPE_COMPLEX != 15 \
-++ || FFI_TYPE_LAST != 15
-+ #error "osf.S out of sync with ffi.h"
-+ #endif
-+
diff --git a/dev-lang/ghc/files/ghc-8.0.2_rc2-old-sphinx.patch b/dev-lang/ghc/files/ghc-8.0.2_rc2-old-sphinx.patch
deleted file mode 100644
index a4d49d3ef808..000000000000
--- a/dev-lang/ghc/files/ghc-8.0.2_rc2-old-sphinx.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/docs/users_guide/profiling.rst b/docs/users_guide/profiling.rst
-index 4d0bb3a..f980f72 100644
---- a/docs/users_guide/profiling.rst
-+++ b/docs/users_guide/profiling.rst
-@@ -435,7 +435,2 @@ To generate a heap profile from your program:
-
--For example, here is a heap profile produced for the ``sphere`` program
--from GHC's ``nofib`` benchmark suite,
--
--.. image:: images/prof_scc.*
--
- You might also want to take a look at
diff --git a/dev-lang/ghc/files/ghc-8.10.1-no-relax-everywhere.patch b/dev-lang/ghc/files/ghc-8.10.1-no-relax-everywhere.patch
deleted file mode 100644
index 19c8b4bccc48..000000000000
--- a/dev-lang/ghc/files/ghc-8.10.1-no-relax-everywhere.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-https://github.com/gentoo-haskell/gentoo-haskell/issues/704
-
-Allow users to specify -W,--relax externally and pass
--Wl,-no-relax unconditonally on all arches.
-
-Reported-by: wmyrda
---- a/compiler/main/DriverPipeline.hs
-+++ b/compiler/main/DriverPipeline.hs
-@@ -2144,9 +2144,7 @@ joinObjectFiles dflags o_files output_fn = do
- -- gcc on sparc sets -Wl,--relax implicitly, but
- -- -r and --relax are incompatible for ld, so
- -- disable --relax explicitly.
-- ++ (if platformArch (targetPlatform dflags)
-- `elem` [ArchSPARC, ArchSPARC64]
-- && ldIsGnuLd
-+ ++ (if ldIsGnuLd
- then [SysTools.Option "-Wl,-no-relax"]
- else [])
- -- See Note [Produce big objects on Windows]
diff --git a/dev-lang/ghc/files/ghc-8.10.2-revert-linker-rtsSymbols_more_linker_symbols.patch b/dev-lang/ghc/files/ghc-8.10.2-revert-linker-rtsSymbols_more_linker_symbols.patch
deleted file mode 100644
index eb30d9d9dd4c..000000000000
--- a/dev-lang/ghc/files/ghc-8.10.2-revert-linker-rtsSymbols_more_linker_symbols.patch
+++ /dev/null
@@ -1,296 +0,0 @@
-From fac083e7ac8a37b61a4082bbbca2848e52fd1bb2 Mon Sep 17 00:00:00 2001
-From: Ben Gamari <ben@smart-cactus.org>
-Date: Sun, 9 Aug 2020 09:15:16 -0400
-Subject: [PATCH] Revert "[linker/rtsSymbols] More linker symbols"
-
-This reverts commit aa2e5863699306920513b216f337de09e29b5bb8.
----
- rts/RtsSymbols.c | 224 ++++-------------------------------------------
- 1 file changed, 17 insertions(+), 207 deletions(-)
-
-diff --git a/rts/RtsSymbols.c b/rts/RtsSymbols.c
-index d10a6900db..b2f90a892d 100644
---- a/rts/RtsSymbols.c
-+++ b/rts/RtsSymbols.c
-@@ -58,6 +58,7 @@
- SymI_HasProto(signal_handlers) \
- SymI_HasProto(stg_sig_install) \
- SymI_HasProto(rtsTimerSignal) \
-+ SymI_HasProto(atexit) \
- SymI_NeedsDataProto(nocldstop)
- #endif
-
-@@ -976,213 +977,29 @@
- RTS_USER_SIGNALS_SYMBOLS \
- RTS_INTCHAR_SYMBOLS
-
-+
- // 64-bit support functions in libgcc.a
--// See https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html#Libgcc
--#define RTS_LIBGCC_SYMBOLS_32 \
-- SymI_NeedsProto(__fixunsdfdi) \
-- /* 4 The GCC low-level runtime library */\
-- /* 4.1.1 Arithmetic functions */\
-- /* SymI_NeedsProto(__ashlsi3) */\
-- SymI_NeedsProto(__ashldi3) \
-- /* SymI_NeedsProto(__ashlti3) */\
-- /* These functions return the result of shifting a left by b bits. */\
-- /* SymI_NeedsProto(__ashrsi3) */\
-- SymI_NeedsProto(__ashrdi3) \
-- /* SymI_NeedsProto(__ashrti3) */\
-- /* These functions return the result of arithmetically shifting a right by b bits. */\
-- /* SymI_NeedsProto(__divsi3) */\
-- SymI_NeedsProto(__divdi3) \
-- /* SymI_NeedsProto(__divti3) */\
-- /* These functions return the quotient of the signed division of a and b. */\
-- /* SymI_NeedsProto(__lshrsi3) */ \
-- SymI_NeedsProto(__lshrdi3) \
-- /* SymI_NeedsProto(__lshrti3) */ \
-- /* These functions return the result of logically shifting a right by b bits. */\
-- /* SymI_NeedsProto(__modsi3) */ \
-- SymI_NeedsProto(__moddi3) \
-- /* SymI_NeedsProto(__modti3) */ \
-- /* These functions return the remainder of the signed division of a and b. */\
-- /* SymI_NeedsProto(__mulsi3) */ \
-- SymI_NeedsProto(__muldi3) \
-- /* SymI_NeedsProto(__multi3) */ \
-- /* These functions return the product of a and b. */\
-- SymI_NeedsProto(__negdi2) \
-- /* SymI_NeedsProto(__negti2) */ \
-- /* These functions return the negation of a. */\
-- /* SymI_NeedsProto(__udivsi3) */ \
-- SymI_NeedsProto(__udivdi3) \
-- /* SymI_NeedsProto(__udivti3) */ \
-- /* These functions return the quotient of the unsigned division of a and b. */\
-- SymI_NeedsProto(__udivmoddi4) \
-- /* SymI_NeedsProto(__udivmodti4) */ \
-- /* These functions calculate both the quotient and remainder of the unsigned division of a and b. The return value is the quotient, and the remainder is placed in variable pointed to by c. */\
-- /* SymI_NeedsProto(__umodsi3) */ \
-- SymI_NeedsProto(__umoddi3) \
-- /* SymI_NeedsProto(__umodti3) */ \
-- /* These functions return the remainder of the unsigned division of a and b. */\
-- /* 4.1.2 Comparison functions */\
-- /* The following functions implement integral comparisons. These functions implement a low-level compare, upon which the higher level comparison operators (such as less than and greater than or equal to) can be constructed. The returned values lie in the range zero to two, to allow the high-level operators to be implemented by testing the returned result using either signed or unsigned comparison. */\
-- SymI_NeedsProto(__cmpdi2) \
-- /* SymI_NeedsProto(__cmpti2) */ \
-- /* These functions perform a signed comparison of a and b. If a is less than b, they return 0; if a is greater than b, they return 2; and if a and b are equal they return 1. */\
-- SymI_NeedsProto(__ucmpdi2) \
-- /* SymI_NeedsProto(__ucmpti2) */ \
-- /* These functions perform an unsigned comparison of a and b. If a is less than b, they return 0; if a is greater than b, they return 2; and if a and b are equal they return 1. */\
-- /* 4.1.3 Trapping arithmetic functions */\
-- /* The following functions implement trapping arithmetic. These functions call the libc function abort upon signed arithmetic overflow. */\
-- SymI_NeedsProto(__absvsi2) \
-- SymI_NeedsProto(__absvdi2) \
-- /* These functions return the absolute value of a. */\
-- /* SymI_NeedsProto(__addvsi3) */ \
-- SymI_NeedsProto(__addvdi3) \
-- /* These functions return the sum of a and b; that is a + b. */\
-- /* SymI_NeedsProto(__mulvsi3) */ \
-- SymI_NeedsProto(__mulvdi3) \
-- /* The functions return the product of a and b; that is a * b. */\
-- SymI_NeedsProto(__negvsi2) \
-- SymI_NeedsProto(__negvdi2) \
-- /* These functions return the negation of a; that is -a. */\
-- /* SymI_NeedsProto(__subvsi3) */ \
-- SymI_NeedsProto(__subvdi3) \
-- /* These functions return the difference between b and a; that is a - b. */\
-- /* 4.1.4 Bit operations */\
-- SymI_NeedsProto(__clzsi2) \
-- SymI_NeedsProto(__clzdi2) \
-- /* SymI_NeedsProto(__clzti2) */ \
-- /* These functions return the number of leading 0-bits in a, starting at the most significant bit position. If a is zero, the result is undefined. */\
-- SymI_NeedsProto(__ctzsi2) \
-- SymI_NeedsProto(__ctzdi2) \
-- /* SymI_NeedsProto(__ctzti2) */ \
-- /* These functions return the number of trailing 0-bits in a, starting at the least significant bit position. If a is zero, the result is undefined. */\
-- SymI_NeedsProto(__ffsdi2) \
-- /* SymI_NeedsProto(__ffsti2) */ \
-- /* These functions return the index of the least significant 1-bit in a, or the value zero if a is zero. The least significant bit is index one. */\
-- SymI_NeedsProto(__paritysi2) \
-- SymI_NeedsProto(__paritydi2) \
-- /* SymI_NeedsProto(__parityti2) */\
-- /* These functions return the value zero if the number of bits set in a is even, and the value one otherwise. */\
-- SymI_NeedsProto(__popcountsi2) \
-- SymI_NeedsProto(__popcountdi2) \
-- /* SymI_NeedsProto(__popcountti2) */ \
-- /* These functions return the number of bits set in a. */\
-- SymI_NeedsProto(__bswapsi2) \
-- SymI_NeedsProto(__bswapdi2)
--#define RTS_LIBGCC_SYMBOLS_aarch32 \
-- /* armv6l */\
-- /* TODO: should check for __ARM_EABI__ */\
-- SymI_NeedsProto(__aeabi_d2f) \
-- SymI_NeedsProto(__aeabi_d2iz) \
-- SymI_NeedsProto(__aeabi_d2lz) \
-- SymI_NeedsProto(__aeabi_d2uiz) \
-- SymI_NeedsProto(__aeabi_d2ulz) \
-- SymI_NeedsProto(__aeabi_dadd) \
-- SymI_NeedsProto(__aeabi_dcmpeq) \
-- SymI_NeedsProto(__aeabi_dcmpge) \
-- SymI_NeedsProto(__aeabi_dcmpgt) \
-- SymI_NeedsProto(__aeabi_dcmple) \
-- SymI_NeedsProto(__aeabi_dcmplt) \
-- SymI_NeedsProto(__aeabi_dcmpun) \
-- SymI_NeedsProto(__aeabi_ddiv) \
-- SymI_NeedsProto(__aeabi_dmul) \
-- SymI_NeedsProto(__aeabi_dneg) \
-- SymI_NeedsProto(__aeabi_dsub) \
-- SymI_NeedsProto(__aeabi_f2d) \
-- SymI_NeedsProto(__aeabi_f2iz) \
-- SymI_NeedsProto(__aeabi_f2lz) \
-- SymI_NeedsProto(__aeabi_f2uiz) \
-- SymI_NeedsProto(__aeabi_f2ulz) \
-- SymI_NeedsProto(__aeabi_fadd) \
-- SymI_NeedsProto(__aeabi_fcmpeq) \
-- SymI_NeedsProto(__aeabi_fcmpge) \
-- SymI_NeedsProto(__aeabi_fcmpgt) \
-- SymI_NeedsProto(__aeabi_fcmple) \
-- SymI_NeedsProto(__aeabi_fcmplt) \
-- SymI_NeedsProto(__aeabi_fcmpun) \
-- SymI_NeedsProto(__aeabi_fdiv) \
-- SymI_NeedsProto(__aeabi_fmul) \
-- SymI_NeedsProto(__aeabi_fneg) \
-- SymI_NeedsProto(__aeabi_fsub) \
-- SymI_NeedsProto(__aeabi_i2d) \
-- SymI_NeedsProto(__aeabi_i2f) \
-- SymI_NeedsProto(__aeabi_idiv) \
-- SymI_NeedsProto(__aeabi_idivmod) \
-- SymI_NeedsProto(__aeabi_l2d) \
-- SymI_NeedsProto(__aeabi_l2f) \
-- SymI_NeedsProto(__aeabi_lasr) \
-- SymI_NeedsProto(__aeabi_lcmp) \
-- SymI_NeedsProto(__aeabi_ldivmod) \
-- SymI_NeedsProto(__aeabi_llsl) \
-- SymI_NeedsProto(__aeabi_llsr) \
-- SymI_NeedsProto(__aeabi_lmul) \
-- SymI_NeedsProto(__aeabi_ui2d) \
-- SymI_NeedsProto(__aeabi_ui2f) \
-- SymI_NeedsProto(__aeabi_uidiv) \
-- SymI_NeedsProto(__aeabi_uidivmod) \
-- SymI_NeedsProto(__aeabi_ul2d) \
-- SymI_NeedsProto(__aeabi_ul2f) \
-- SymI_NeedsProto(__aeabi_ulcmp) \
-- SymI_NeedsProto(__aeabi_uldivmod)
--#define RTS_LIBGCC_SYMBOLS_64 \
-+#if defined(__GNUC__) && SIZEOF_VOID_P <= 4 && !defined(_ABIN32)
-+#define RTS_LIBGCC_SYMBOLS \
-+ SymI_NeedsProto(__divdi3) \
-+ SymI_NeedsProto(__udivdi3) \
-+ SymI_NeedsProto(__moddi3) \
-+ SymI_NeedsProto(__umoddi3) \
-+ SymI_NeedsProto(__muldi3) \
-+ SymI_NeedsProto(__ashldi3) \
-+ SymI_NeedsProto(__ashrdi3) \
-+ SymI_NeedsProto(__lshrdi3) \
-+ SymI_NeedsProto(__fixunsdfdi)
-+#elif defined(__GNUC__) && SIZEOF_VOID_P == 8
-+#define RTS_LIBGCC_SYMBOLS \
- SymI_NeedsProto(__udivti3) \
- SymI_NeedsProto(__umodti3)
--
--/* for aarch64 */
--#define RTS_LIBGCC_SYMBOLS_aarch64 \
-- SymI_NeedsProto(__netf2) \
-- SymI_NeedsProto(__addtf3) \
-- SymI_NeedsProto(__subtf3) \
-- SymI_NeedsProto(__multf3) \
-- SymI_NeedsProto(__extenddftf2) \
-- SymI_NeedsProto(__fixtfsi) \
-- SymI_NeedsProto(__fixunstfsi) \
-- SymI_NeedsProto(__floatsitf) \
-- SymI_NeedsProto(__floatunsitf)
--
--#if defined(__GNUC__) && SIZEOF_VOID_P <= 4 && defined(arm_HOST_OS)
--#define RTS_LIBGCC_SYMBOLS RTS_LIBGCC_SYMBOLS_32 RTS_LIBGCC_SYMBOLS_aarch32
--#elif defined(__GNUC__) && SIZEOF_VOID_P <= 4 && !defined(_ABIN32)
--#define RTS_LIBGCC_SYMBOLS RTS_LIBGCC_SYMBOLS_32
--#elif defined(__GNUC__) && SIZEOF_VOID_P == 8 && defined(aarch64_HOST_OS)
--#define RTS_LIBGCC_SYMBOLS RTS_LIBGCC_SYMBOLS_64 RTS_LIBGCC_SYMBOLS_aarch64
--#elif defined(__GNUC__) && SIZEOF_VOID_P == 8
--#define RTS_LIBGCC_SYMBOLS RTS_LIBGCC_SYMBOLS_64
- #else
- #define RTS_LIBGCC_SYMBOLS
- #endif
-
--#if !defined(mingw32_HOST_OS) && !defined(DYNAMIC) && (defined(_FORTIFY_SOURCE) || defined(__SSP__))
--#define RTS_SSP_SYMBOLS \
-- SymI_NeedsProto(__stack_chk_guard) \
-- SymI_NeedsProto(__stack_chk_fail)
--#else
--#define RTS_SSP_SYMBOLS
--#endif
--#if !defined(DYNAMIC) && defined(linux_HOST_OS)
--// we need these for static musl builds. However when
--// linking shared objects (DLLs) this will fail, hence
--// we do not include them when building with -DDYNAMIC
--#define RTS_LINKER_SYMBOLS \
-- SymI_NeedsProto(__fini_array_start) \
-- SymI_NeedsProto(__fini_array_end)
--#else
--#define RTS_LINKER_SYMBOLS
--#endif
--
--#if defined(darwin_HOST_OS) && defined(powerpc_HOST_ARCH)
-- // Symbols that don't have a leading underscore
-- // on Mac OS X. They have to receive special treatment,
-- // see machoInitSymbolsWithoutUnderscore()
--#define RTS_MACHO_NOUNDERLINE_SYMBOLS \
-- SymI_NeedsProto(saveFP) \
-- SymI_NeedsProto(restFP)
--#endif
--
- /* entirely bogus claims about types of these symbols */
--/* to prevent a bit of define expansion, SymI_NeedsProto is a variadic
-- * macro. And we'll concat vvv with the __VA_ARGS__. This prevents
-- * vvv from getting macro expanded.
-- */
--#define SymI_NeedsProto(vvv,...) extern void vvv ## __VA_ARGS__ (void);
-+#define SymI_NeedsProto(vvv) extern void vvv(void);
- #define SymI_NeedsDataProto(vvv) extern StgWord vvv[];
- #if defined(COMPILING_WINDOWS_DLL)
- #define SymE_HasProto(vvv) SymE_HasProto(vvv);
-@@ -1209,8 +1026,6 @@ RTS_DARWIN_ONLY_SYMBOLS
- RTS_OPENBSD_ONLY_SYMBOLS
- RTS_LIBGCC_SYMBOLS
- RTS_LIBFFI_SYMBOLS
--RTS_SSP_SYMBOLS
--RTS_LINKER_SYMBOLS
- #undef SymI_NeedsProto
- #undef SymI_NeedsDataProto
- #undef SymI_HasProto
-@@ -1230,7 +1045,7 @@ RTS_LINKER_SYMBOLS
- #define SymE_HasDataProto(vvv) \
- SymE_HasProto(vvv)
-
--#define SymI_NeedsProto(vvv,...) SymI_HasProto(vvv ## __VA_ARGS__)
-+#define SymI_NeedsProto(vvv) SymI_HasProto(vvv)
- #define SymI_NeedsDataProto(vvv) SymI_HasDataProto(vvv)
- #define SymE_NeedsProto(vvv) SymE_HasProto(vvv)
- #define SymE_NeedsDataProto(vvv) SymE_HasDataProto(vvv)
-@@ -1251,8 +1066,6 @@ RTS_LINKER_SYMBOLS
- #define SymI_HasProto_deprecated(vvv) \
- { #vvv, (void*)0xBAADF00D, true },
-
--void *RTS_DYNAMIC = NULL;
--
- RtsSymbolVal rtsSyms[] = {
- RTS_SYMBOLS
- RTS_RET_SYMBOLS
-@@ -1264,14 +1077,11 @@ RtsSymbolVal rtsSyms[] = {
- RTS_LIBGCC_SYMBOLS
- RTS_LIBFFI_SYMBOLS
- SymI_HasDataProto(nonmoving_write_barrier_enabled)
-- RTS_SSP_SYMBOLS
-- RTS_LINKER_SYMBOLS
- #if defined(darwin_HOST_OS) && defined(i386_HOST_ARCH)
- // dyld stub code contains references to this,
- // but it should never be called because we treat
- // lazy pointers as nonlazy.
- { "dyld_stub_binding_helper", (void*)0xDEADBEEF, false },
- #endif
-- { "_DYNAMIC", (void*)(&RTS_DYNAMIC), false },
- { 0, 0, false } /* sentinel */
- };
---
-2.25.4
-
diff --git a/dev-lang/ghc/files/ghc-8.2.1_rc1-cgen-constify.patch b/dev-lang/ghc/files/ghc-8.2.1_rc1-cgen-constify.patch
deleted file mode 100644
index 2e1ef932b454..000000000000
--- a/dev-lang/ghc/files/ghc-8.2.1_rc1-cgen-constify.patch
+++ /dev/null
@@ -1,378 +0,0 @@
-From 7e00046772e053c63ac93630a60b0f396e32a2d7 Mon Sep 17 00:00:00 2001
-From: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Sun, 16 Apr 2017 10:43:38 +0100
-Subject: [PATCH] compiler/cmm/PprC.hs: constify labels in .rodata
-
-Summary:
-Consider one-line module
- module B (v) where v = "hello"
-in -fvia-C mode it generates code like
- static char gibberish_str[] = "hello";
-
-It resides in data section (precious resource on ia64!).
-The patch switches genrator to emit:
- static const char gibberish_str[] = "hello";
-
-Other types if symbols that gained 'const' qualifier are:
-
-- info tables (from haskell and CMM)
-- static reference tables (from haskell and CMM)
-
-Cleanups along the way:
-
-- fixed info tables defined in .cmm to reside in .rodata
-- split out closure declaration into 'IC_' / 'EC_'
-- added label declaration (based on label type) right before
- each label definition (based on section type) so that C
- compiler could check if declaration and definition matches
- at definition site.
-
-Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-
-Test Plan: ran testsuite on unregisterised x86_64 compiler
-
-Reviewers: simonmar, ezyang, austin, bgamari, erikd
-
-Subscribers: rwbarton, thomie
-
-GHC Trac Issues: #8996
-
-Differential Revision: https://phabricator.haskell.org/D3481
----
- compiler/cmm/CLabel.hs | 24 ++++++++++++++
- compiler/cmm/Cmm.hs | 13 ++++++++
- compiler/cmm/CmmInfo.hs | 2 +-
- compiler/cmm/PprC.hs | 62 +++++++++++++++++++++++-------------
- compiler/llvmGen/LlvmCodeGen/Data.hs | 12 -------
- includes/Stg.h | 22 +++++++++----
- includes/rts/storage/InfoTables.h | 2 +-
- includes/stg/MiscClosures.h | 14 ++++----
- 8 files changed, 102 insertions(+), 49 deletions(-)
-
-diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs
-index 3ba4f7647a..62c8037e9c 100644
---- a/compiler/cmm/CLabel.hs
-+++ b/compiler/cmm/CLabel.hs
-@@ -89,6 +89,8 @@ module CLabel (
- foreignLabelStdcallInfo,
- isBytesLabel,
- isForeignLabel,
-+ isSomeRODataLabel,
-+ isStaticClosureLabel,
- mkCCLabel, mkCCSLabel,
-
- DynamicLinkerLabelInfo(..),
-@@ -575,6 +577,28 @@ isForeignLabel :: CLabel -> Bool
- isForeignLabel (ForeignLabel _ _ _ _) = True
- isForeignLabel _lbl = False
-
-+-- | Whether label is a static closure label (can come from haskell or cmm)
-+isStaticClosureLabel :: CLabel -> Bool
-+-- Closure defined in haskell (.hs)
-+isStaticClosureLabel (IdLabel _ _ Closure) = True
-+-- Closure defined in cmm
-+isStaticClosureLabel (CmmLabel _ _ CmmClosure) = True
-+isStaticClosureLabel _lbl = False
-+
-+-- | Whether label is a .rodata label
-+isSomeRODataLabel :: CLabel -> Bool
-+-- info table defined in haskell (.hs)
-+isSomeRODataLabel (IdLabel _ _ ClosureTable) = True
-+isSomeRODataLabel (IdLabel _ _ ConInfoTable) = True
-+isSomeRODataLabel (IdLabel _ _ InfoTable) = True
-+isSomeRODataLabel (IdLabel _ _ LocalInfoTable) = True
-+-- static reference tables defined in haskell (.hs)
-+isSomeRODataLabel (IdLabel _ _ SRT) = True
-+isSomeRODataLabel (SRTLabel _) = True
-+-- info table defined in cmm (.cmm)
-+isSomeRODataLabel (CmmLabel _ _ CmmInfo) = True
-+isSomeRODataLabel _lbl = False
-+
- -- | Get the label size field from a ForeignLabel
- foreignLabelStdcallInfo :: CLabel -> Maybe Int
- foreignLabelStdcallInfo (ForeignLabel _ info _ _) = info
-diff --git a/compiler/cmm/Cmm.hs b/compiler/cmm/Cmm.hs
-index d2ee531686..bab20f3fdd 100644
---- a/compiler/cmm/Cmm.hs
-+++ b/compiler/cmm/Cmm.hs
-@@ -9,6 +9,7 @@ module Cmm (
- CmmBlock,
- RawCmmDecl, RawCmmGroup,
- Section(..), SectionType(..), CmmStatics(..), CmmStatic(..),
-+ isSecConstant,
-
- -- ** Blocks containing lists
- GenBasicBlock(..), blockId,
-@@ -167,6 +168,18 @@ data SectionType
- | OtherSection String
- deriving (Show)
-
-+-- | Should a data in this section be considered constant
-+isSecConstant :: Section -> Bool
-+isSecConstant (Section t _) = case t of
-+ Text -> True
-+ ReadOnlyData -> True
-+ RelocatableReadOnlyData -> True
-+ ReadOnlyData16 -> True
-+ CString -> True
-+ Data -> False
-+ UninitialisedData -> False
-+ (OtherSection _) -> False
-+
- data Section = Section SectionType CLabel
-
- data CmmStatic
-diff --git a/compiler/cmm/CmmInfo.hs b/compiler/cmm/CmmInfo.hs
-index b5e800a977..35e3a1888d 100644
---- a/compiler/cmm/CmmInfo.hs
-+++ b/compiler/cmm/CmmInfo.hs
-@@ -133,7 +133,7 @@ mkInfoTable dflags proc@(CmmProc infos entry_lbl live blocks)
- --
- return (top_decls ++
- [CmmProc mapEmpty entry_lbl live blocks,
-- mkDataLits (Section Data info_lbl) info_lbl
-+ mkRODataLits info_lbl
- (CmmLabel entry_lbl : rel_std_info ++ rel_extra_bits)])
-
- --
-diff --git a/compiler/cmm/PprC.hs b/compiler/cmm/PprC.hs
-index 56de94079f..21ed6f6516 100644
---- a/compiler/cmm/PprC.hs
-+++ b/compiler/cmm/PprC.hs
-@@ -83,12 +83,13 @@ pprC tops = vcat $ intersperse blankLine $ map pprTop tops
- -- top level procs
- --
- pprTop :: RawCmmDecl -> SDoc
--pprTop (CmmProc infos clbl _ graph) =
-+pprTop (CmmProc infos clbl _in_live_regs graph) =
-
- (case mapLookup (g_entry graph) infos of
- Nothing -> empty
-- Just (Statics info_clbl info_dat) -> pprDataExterns info_dat $$
-- pprWordArray info_clbl info_dat) $$
-+ Just (Statics info_clbl info_dat) ->
-+ pprDataExterns info_dat $$
-+ pprWordArray info_is_in_rodata info_clbl info_dat) $$
- (vcat [
- blankLine,
- extern_decls,
-@@ -99,6 +100,8 @@ pprTop (CmmProc infos clbl _ graph) =
- rbrace ]
- )
- where
-+ -- info tables are always in .rodata
-+ info_is_in_rodata = True
- blocks = toBlockListEntryFirst graph
- (temp_decls, extern_decls) = pprTempAndExternDecls blocks
-
-@@ -107,21 +110,23 @@ pprTop (CmmProc infos clbl _ graph) =
-
- -- We only handle (a) arrays of word-sized things and (b) strings.
-
--pprTop (CmmData _section (Statics lbl [CmmString str])) =
-+pprTop (CmmData section (Statics lbl [CmmString str])) =
-+ pprExternDecl lbl $$
- hcat [
-- pprLocalness lbl, text "char ", ppr lbl,
-+ pprLocalness lbl, pprConstness (isSecConstant section), text "char ", ppr lbl,
- text "[] = ", pprStringInCStyle str, semi
- ]
-
--pprTop (CmmData _section (Statics lbl [CmmUninitialised size])) =
-+pprTop (CmmData section (Statics lbl [CmmUninitialised size])) =
-+ pprExternDecl lbl $$
- hcat [
-- pprLocalness lbl, text "char ", ppr lbl,
-+ pprLocalness lbl, pprConstness (isSecConstant section), text "char ", ppr lbl,
- brackets (int size), semi
- ]
-
--pprTop (CmmData _section (Statics lbl lits)) =
-+pprTop (CmmData section (Statics lbl lits)) =
- pprDataExterns lits $$
-- pprWordArray lbl lits
-+ pprWordArray (isSecConstant section) lbl lits
-
- -- --------------------------------------------------------------------------
- -- BasicBlocks are self-contained entities: they always end in a jump.
-@@ -141,10 +146,12 @@ pprBBlock block =
- -- Info tables. Just arrays of words.
- -- See codeGen/ClosureInfo, and nativeGen/PprMach
-
--pprWordArray :: CLabel -> [CmmStatic] -> SDoc
--pprWordArray lbl ds
-+pprWordArray :: Bool -> CLabel -> [CmmStatic] -> SDoc
-+pprWordArray is_ro lbl ds
- = sdocWithDynFlags $ \dflags ->
-- hcat [ pprLocalness lbl, text "StgWord"
-+ -- TODO: align closures only
-+ pprExternDecl lbl $$
-+ hcat [ pprLocalness lbl, pprConstness is_ro, text "StgWord"
- , space, ppr lbl, text "[]"
- -- See Note [StgWord alignment]
- , pprAlignment (wordWidth dflags)
-@@ -180,6 +187,10 @@ pprLocalness :: CLabel -> SDoc
- pprLocalness lbl | not $ externallyVisibleCLabel lbl = text "static "
- | otherwise = empty
-
-+pprConstness :: Bool -> SDoc
-+pprConstness is_ro | is_ro = text "const "
-+ | otherwise = empty
-+
- -- --------------------------------------------------------------------------
- -- Statements.
- --
-@@ -984,31 +995,38 @@ is_cishCC JavaScriptCallConv = False
- pprTempAndExternDecls :: [CmmBlock] -> (SDoc{-temps-}, SDoc{-externs-})
- pprTempAndExternDecls stmts
- = (pprUFM (getUniqSet temps) (vcat . map pprTempDecl),
-- vcat (map (pprExternDecl False{-ToDo-}) (Map.keys lbls)))
-+ vcat (map pprExternDecl (Map.keys lbls)))
- where (temps, lbls) = runTE (mapM_ te_BB stmts)
-
- pprDataExterns :: [CmmStatic] -> SDoc
- pprDataExterns statics
-- = vcat (map (pprExternDecl False{-ToDo-}) (Map.keys lbls))
-+ = vcat (map pprExternDecl (Map.keys lbls))
- where (_, lbls) = runTE (mapM_ te_Static statics)
-
- pprTempDecl :: LocalReg -> SDoc
- pprTempDecl l@(LocalReg _ rep)
- = hcat [ machRepCType rep, space, pprLocalReg l, semi ]
-
--pprExternDecl :: Bool -> CLabel -> SDoc
--pprExternDecl _in_srt lbl
-+pprExternDecl :: CLabel -> SDoc
-+pprExternDecl lbl
- -- do not print anything for "known external" things
- | not (needsCDecl lbl) = empty
- | Just sz <- foreignLabelStdcallInfo lbl = stdcall_decl sz
- | otherwise =
-- hcat [ visibility, label_type lbl,
-- lparen, ppr lbl, text ");" ]
-+ hcat [ visibility, label_type lbl , lparen, ppr lbl, text ");"
-+ -- occasionally useful to see label type
-+ -- , text "/* ", pprDebugCLabel lbl, text " */"
-+ ]
- where
-- label_type lbl | isBytesLabel lbl = text "B_"
-- | isForeignLabel lbl && isCFunctionLabel lbl = text "FF_"
-- | isCFunctionLabel lbl = text "F_"
-- | otherwise = text "I_"
-+ label_type lbl | isBytesLabel lbl = text "B_"
-+ | isForeignLabel lbl && isCFunctionLabel lbl
-+ = text "FF_"
-+ | isCFunctionLabel lbl = text "F_"
-+ | isStaticClosureLabel lbl = text "C_"
-+ -- generic .rodata labels
-+ | isSomeRODataLabel lbl = text "RO_"
-+ -- generic .data labels (common case)
-+ | otherwise = text "RW_"
-
- visibility
- | externallyVisibleCLabel lbl = char 'E'
-diff --git a/compiler/llvmGen/LlvmCodeGen/Data.hs b/compiler/llvmGen/LlvmCodeGen/Data.hs
-index 9bb5a75bda..adb86d312d 100644
---- a/compiler/llvmGen/LlvmCodeGen/Data.hs
-+++ b/compiler/llvmGen/LlvmCodeGen/Data.hs
-@@ -56,18 +56,6 @@ genLlvmData (sec, Statics lbl xs) = do
-
- return ([globDef], [tyAlias])
-
---- | Should a data in this section be considered constant
--isSecConstant :: Section -> Bool
--isSecConstant (Section t _) = case t of
-- Text -> True
-- ReadOnlyData -> True
-- RelocatableReadOnlyData -> True
-- ReadOnlyData16 -> True
-- CString -> True
-- Data -> False
-- UninitialisedData -> False
-- (OtherSection _) -> False
--
- -- | Format the section type part of a Cmm Section
- llvmSectionType :: Platform -> SectionType -> FastString
- llvmSectionType p t = case t of
-diff --git a/includes/Stg.h b/includes/Stg.h
-index 619984d8e5..b1b3190307 100644
---- a/includes/Stg.h
-+++ b/includes/Stg.h
-@@ -223,13 +223,23 @@ typedef StgInt I_;
- typedef StgWord StgWordArray[];
- typedef StgFunPtr F_;
-
--#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))
-+/* byte arrays (and strings): */
-+#define EB_(X) extern const char X[]
-+#define IB_(X) static const char X[]
-+/* static (non-heap) closures (requires alignment for pointer tagging): */
-+#define EC_(X) extern StgWordArray (X) GNU_ATTRIBUTE(aligned (8))
-+#define IC_(X) static StgWordArray (X) GNU_ATTRIBUTE(aligned (8))
-+/* writable data (does not require alignment): */
-+#define ERW_(X) extern StgWordArray (X)
-+#define IRW_(X) static StgWordArray (X)
-+/* read-only data (does not require alignment): */
-+#define ERO_(X) extern const StgWordArray (X)
-+#define IRO_(X) static const StgWordArray (X)
-+/* stg-native functions: */
- #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 FN_(f) StgFunPtr f(void)
-+#define EF_(f) StgFunPtr f(void) /* External Cmm functions */
-+/* foreign functions: */
- #define EFF_(f) void f() /* See Note [External function prototypes] */
-
- /* Note [External function prototypes] See Trac #8965, #11395
-diff --git a/includes/rts/storage/InfoTables.h b/includes/rts/storage/InfoTables.h
-index 307aac371c..163f1d1c87 100644
---- a/includes/rts/storage/InfoTables.h
-+++ b/includes/rts/storage/InfoTables.h
-@@ -266,7 +266,7 @@ typedef struct {
- } StgFunInfoTable;
-
- // canned bitmap for each arg type, indexed by constants in FunTypes.h
--extern StgWord stg_arg_bitmaps[];
-+extern const StgWord stg_arg_bitmaps[];
-
- /* -----------------------------------------------------------------------------
- Return info tables
-diff --git a/includes/stg/MiscClosures.h b/includes/stg/MiscClosures.h
-index 9d907ab3ba..b604f1c42b 100644
---- a/includes/stg/MiscClosures.h
-+++ b/includes/stg/MiscClosures.h
-@@ -21,10 +21,10 @@
- #define STGMISCCLOSURES_H
-
- #if IN_STG_CODE
--# define RTS_RET_INFO(i) extern W_(i)[]
--# define RTS_FUN_INFO(i) extern W_(i)[]
--# define RTS_THUNK_INFO(i) extern W_(i)[]
--# define RTS_INFO(i) extern W_(i)[]
-+# define RTS_RET_INFO(i) extern const W_(i)[]
-+# define RTS_FUN_INFO(i) extern const W_(i)[]
-+# define RTS_THUNK_INFO(i) extern const W_(i)[]
-+# define RTS_INFO(i) extern const W_(i)[]
- # define RTS_CLOSURE(i) extern W_(i)[]
- # define RTS_FUN_DECL(f) extern DLL_IMPORT_RTS StgFunPtr f(void)
- #else
-@@ -489,9 +489,9 @@ extern StgWord RTS_VAR(sched_mutex);
-
- // Apply.cmm
- // canned bitmap for each arg type
--extern StgWord stg_arg_bitmaps[];
--extern StgWord stg_ap_stack_entries[];
--extern StgWord stg_stack_save_entries[];
-+extern const StgWord stg_arg_bitmaps[];
-+extern const StgWord stg_ap_stack_entries[];
-+extern const StgWord stg_stack_save_entries[];
-
- // Storage.c
- extern unsigned int RTS_VAR(g0);
---
-2.12.2
-
diff --git a/dev-lang/ghc/files/ghc-8.2.1_rc1-ghci-cross.patch b/dev-lang/ghc/files/ghc-8.2.1_rc1-ghci-cross.patch
deleted file mode 100644
index dbba18e85c7f..000000000000
--- a/dev-lang/ghc/files/ghc-8.2.1_rc1-ghci-cross.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-commit 732b3dbbff194eb8650c75afd79d892801afa0dc
-Author: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Thu Apr 6 22:48:13 2017 +0100
-
- add $(CrossCompilePrefix) to 'runghc' and 'ghci'
-
- When Stage1Only=YES install mode is used one of rare tools
- that lack $(CrossCompilePrefix) prefix are 'runghc' and 'ghci'.
-
- This causes file collisions when multiple GHC crosscompilers
- are installed in system.
-
- Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-
-diff --git a/driver/ghci/ghc.mk b/driver/ghci/ghc.mk
-index 41d1f15c17..0f31884080 100644
---- a/driver/ghci/ghc.mk
-+++ b/driver/ghci/ghc.mk
-@@ -16,16 +16,16 @@ ifneq "$(Windows_Host)" "YES"
- install: install_driver_ghci
-
- .PHONY: install_driver_ghci
--install_driver_ghci: WRAPPER=$(DESTDIR)$(bindir)/ghci-$(ProjectVersion)
-+install_driver_ghci: WRAPPER=$(DESTDIR)$(bindir)/$(CrossCompilePrefix)ghci-$(ProjectVersion)
- install_driver_ghci:
- $(INSTALL_DIR) "$(DESTDIR)$(bindir)"
- $(call removeFiles, "$(WRAPPER)")
- $(CREATE_SCRIPT) "$(WRAPPER)"
- echo '#!$(SHELL)' >> "$(WRAPPER)"
-- echo 'exec "$(bindir)/ghc-$(ProjectVersion)" --interactive "$$@"' >> "$(WRAPPER)"
-+ echo 'exec "$(bindir)/$(CrossCompilePrefix)ghc-$(ProjectVersion)" --interactive "$$@"' >> "$(WRAPPER)"
- $(EXECUTABLE_FILE) "$(WRAPPER)"
-- $(call removeFiles,"$(DESTDIR)$(bindir)/ghci")
-- $(LN_S) ghci-$(ProjectVersion) "$(DESTDIR)$(bindir)/ghci"
-+ $(call removeFiles,"$(DESTDIR)$(bindir)/$(CrossCompilePrefix)ghci")
-+ $(LN_S) $(CrossCompilePrefix)ghci-$(ProjectVersion) "$(DESTDIR)$(bindir)/$(CrossCompilePrefix)ghci"
-
- else # Windows_Host...
-
-diff --git a/utils/runghc/ghc.mk b/utils/runghc/ghc.mk
-index 9169ca21bd..50b11a612e 100644
---- a/utils/runghc/ghc.mk
-+++ b/utils/runghc/ghc.mk
-@@ -34,11 +34,11 @@ install: install_runhaskell
- .PHONY: install_runhaskell
- ifeq "$(Windows_Host)" "YES"
- install_runhaskell: install_bins
-- "$(CP)" $(DESTDIR)$(bindir)/runghc$(exeext1) $(DESTDIR)$(bindir)/runhaskell$(exeext1)
-+ "$(CP)" $(DESTDIR)$(bindir)/$(CrossCompilePrefix)runghc$(exeext1) $(DESTDIR)$(bindir)/$(CrossCompilePrefix)runhaskell$(exeext1)
- else
- install_runhaskell:
-- $(call removeFiles,"$(DESTDIR)$(bindir)/runhaskell")
-- $(LN_S) runghc "$(DESTDIR)$(bindir)/runhaskell"
-- $(call removeFiles,"$(DESTDIR)$(bindir)/runghc")
-- $(LN_S) runghc-$(ProjectVersion) "$(DESTDIR)$(bindir)/runghc"
-+ $(call removeFiles,"$(DESTDIR)$(bindir)/$(CrossCompilePrefix)runhaskell")
-+ $(LN_S) $(CrossCompilePrefix)runghc "$(DESTDIR)$(bindir)/$(CrossCompilePrefix)runhaskell"
-+ $(call removeFiles,"$(DESTDIR)$(bindir)/$(CrossCompilePrefix)runghc")
-+ $(LN_S) $(CrossCompilePrefix)runghc-$(ProjectVersion) "$(DESTDIR)$(bindir)/$(CrossCompilePrefix)runghc"
- endif
diff --git a/dev-lang/ghc/files/ghc-8.2.1_rc1-stage2-cross.patch b/dev-lang/ghc/files/ghc-8.2.1_rc1-stage2-cross.patch
deleted file mode 100644
index 1439d722fef4..000000000000
--- a/dev-lang/ghc/files/ghc-8.2.1_rc1-stage2-cross.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-commit 54895c90440cb81f18657537b91f2aa35bd54173
-Author: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Fri Apr 7 10:08:58 2017 +0100
-
- fix 'make install' for cross-stage2
-
- When cross-built GHC is being installed one of
- latest steps is to register installed libraries
- with 'ghc-pkg'.
-
- GHC uses freshly installed 'ghc-pkg' and 'ghc-stage2'
- for that.
-
- Tested as:
- ./configure --target=aarch64-unknown-linux-gnu
- make install DESTDIR=$(pwd)/__s2 STRIP_CMD=:
-
- Before the change install failed on ghc-pkg execution phase:
-
- ".../ghc-cross/__s2/usr/local/lib/ghc-8.3.20170406/bin/ghc-pkg" \
- --force \
- --global-package-db \
- ".../ghc-cross/__s2/usr/local/lib/ghc-8.3.20170406/package.conf.d" \
- update rts/dist/package.conf.install
- /bin/sh: .../ghc-cross/__s2/usr/local/lib/ghc-8.3.20170406/bin/ghc-pkg: \
- No such file or directory
-
- To avoid breakage we use 'ghc' and 'ghc-pkg' built by stage0.
-
- Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-
- Test Plan: run 'make install' on stage2 crosscompiler
-
- Reviewers: rwbarton, austin, bgamari
-
- Subscribers: thomie, snowleopard
-
- Differential Revision: https://phabricator.haskell.org/D3432
-
-diff --git a/ghc.mk b/ghc.mk
-index caa6c38fbb..8971f25981 100644
---- a/ghc.mk
-+++ b/ghc.mk
-@@ -962,6 +962,12 @@ endif
-
- INSTALLED_PACKAGE_CONF=$(DESTDIR)$(topdir)/package.conf.d
-
-+ifeq "$(CrossCompiling)" "YES"
-+# when installing ghc-stage2 we can't run target's
-+# 'ghc-pkg' and 'ghc-stage2' but those are needed for registration.
-+INSTALLED_GHC_REAL=$(TOP)/inplace/bin/ghc-stage1
-+INSTALLED_GHC_PKG_REAL=$(TOP)/$(ghc-pkg_DIST_BINARY)
-+else # CrossCompiling
- # Install packages in the right order, so that ghc-pkg doesn't complain.
- # Also, install ghc-pkg first.
- ifeq "$(Windows_Host)" "NO"
-@@ -971,6 +977,7 @@ else
- INSTALLED_GHC_REAL=$(DESTDIR)$(bindir)/ghc.exe
- INSTALLED_GHC_PKG_REAL=$(DESTDIR)$(bindir)/ghc-pkg.exe
- endif
-+endif # CrossCompiling
-
- # Set the INSTALL_DISTDIR_p for each package; compiler is special
- $(foreach p,$(filter-out compiler,$(INSTALL_PACKAGES)),\
-diff --git a/utils/ghc-pkg/ghc.mk b/utils/ghc-pkg/ghc.mk
-index 002c8122f2..4d5ef4e108 100644
---- a/utils/ghc-pkg/ghc.mk
-+++ b/utils/ghc-pkg/ghc.mk
-@@ -49,6 +49,12 @@ utils/ghc-pkg_dist_PROGNAME = ghc-pkg
- utils/ghc-pkg_dist_SHELL_WRAPPER = YES
- utils/ghc-pkg_dist_INSTALL_INPLACE = YES
-
-+# When cross-built ghc-stage2 is installed 'make install' needs to call
-+# native ghc-pkg (not the cross-built one) to register installed packages
-+# 'ghc-pkg_DIST_BINARY' variable only refer to native binary.
-+ghc-pkg_DIST_BINARY_NAME = ghc-pkg$(exeext0)
-+ghc-pkg_DIST_BINARY = utils/ghc-pkg/dist/build/tmp/$(ghc-pkg_DIST_BINARY_NAME)
-+
- # See Note [Stage1Only vs stage=1] in mk/config.mk.in.
- ifeq "$(Stage1Only)" "YES"
- # Install the copy of ghc-pkg from the dist directory when running 'make
diff --git a/dev-lang/ghc/files/ghc-8.2.1_rc1-staged-cross.patch b/dev-lang/ghc/files/ghc-8.2.1_rc1-staged-cross.patch
deleted file mode 100644
index 7e4ea7a9f610..000000000000
--- a/dev-lang/ghc/files/ghc-8.2.1_rc1-staged-cross.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-commit f2685df3b10e13f142736f28835e9064334bc143
-Author: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Wed Apr 5 22:31:37 2017 +0100
-
- avoid $(CrossCompilerPrefix) for stage2 install
-
- Suppose we are crossbuilding ghc (when ghc-stage2
- is a normal compiler for $target):
-
- For this case 'make install' should install unprefixed
- stage2 'ghc' and not '$(CorssCompilePrefix)-ghc'.
-
- That way cross-built ghc is installable and
- usable on target as if it would be built natively
- on a target.
-
- Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-
-diff --git a/mk/config.mk.in b/mk/config.mk.in
-index 4d5d82aa80..5e274bb71f 100644
---- a/mk/config.mk.in
-+++ b/mk/config.mk.in
-@@ -530,7 +530,7 @@ SUPPORTS_THIS_UNIT_ID = @SUPPORTS_THIS_UNIT_ID@
- # needs to know which gcc you're using in order to perform its tests.
-
- GccVersion = @GccVersion@
--CrossCompilePrefix = @CrossCompilePrefix@
-+
- # TargetPlatformFull retains the string passed to configure so we have it in
- # the necessary format to pass to libffi's configure.
- TargetPlatformFull = @TargetPlatformFull@
-@@ -567,6 +567,11 @@ CrossCompiling = @CrossCompiling@
- # See Note [Stage1Only vs stage=1]
- Stage1Only = NO
-
-+# Installed tools prefix:
-+# we add prefix to crosscompiler GHC only (ghc-stage1),
-+# not cross-built GHC (not ghc-stage2).
-+CrossCompilePrefix = $(if $(filter YES,$(Stage1Only)),@CrossCompilePrefix@,)
-+
- # Install stage 2 by default, or stage 1 in the cross compiler
- # case. Can be changed to 3
- INSTALL_GHC_STAGE= $(if $(filter YES,$(Stage1Only)),1,2)
diff --git a/dev-lang/ghc/files/ghc-8.2.1_rc1-unphased-cross.patch b/dev-lang/ghc/files/ghc-8.2.1_rc1-unphased-cross.patch
deleted file mode 100644
index a5528956de14..000000000000
--- a/dev-lang/ghc/files/ghc-8.2.1_rc1-unphased-cross.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-commit 6ff98b962db15d18eb1d082fe344cef692ecef8e
-Author: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Thu Apr 6 08:55:56 2017 +0100
-
- config.mk.in: remove phase=0 hack for CrossCompilePrefix
-
- $(CrossCompilePrefix) is used only in 'make install'
- target filenames in $(DESTDIR). None of inplace (or boot)
- files contain $(CrossCompilePrefix).
-
- Thus we don't need to worry about phases.
-
- Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-
-diff --git a/mk/config.mk.in b/mk/config.mk.in
-index 4e61eea821..4d5d82aa80 100644
---- a/mk/config.mk.in
-+++ b/mk/config.mk.in
-@@ -530,11 +530,7 @@ SUPPORTS_THIS_UNIT_ID = @SUPPORTS_THIS_UNIT_ID@
- # needs to know which gcc you're using in order to perform its tests.
-
- GccVersion = @GccVersion@
--ifeq "$(phase)" "0"
--CrossCompilePrefix =
--else
- CrossCompilePrefix = @CrossCompilePrefix@
--endif
- # TargetPlatformFull retains the string passed to configure so we have it in
- # the necessary format to pass to libffi's configure.
- TargetPlatformFull = @TargetPlatformFull@
diff --git a/dev-lang/ghc/files/ghc-8.2.1_rc1-win32-cross-1.patch b/dev-lang/ghc/files/ghc-8.2.1_rc1-win32-cross-1.patch
deleted file mode 100644
index 79751e1ecbda..000000000000
--- a/dev-lang/ghc/files/ghc-8.2.1_rc1-win32-cross-1.patch
+++ /dev/null
@@ -1,124 +0,0 @@
-commit a691f6a7a191a268380805481d8e63134764a4a1
-Author: Sergei Trofimovich <slyfox@inbox.ru>
-Date: Sat Apr 29 22:02:24 2017 +0100
-
- add basic cross-compilation support (#87)
-
- * fix include case: s/#include <Lmcons.h>/#include <lmcons.h>
-
- Noticed when cross-compiling win32 on linux to i686-w64-mingw32-gcc.
- i686-w64-mingw32 provides all headers in lowercase.
-
- Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-
- * Pen.hsc: don't use c99-style comments in enum declarations
-
- Ths change workarounds hsc2hs bug in cross-compile mode:
- https://ghc.haskell.org/trac/ghc/ticket/13619
-
- To reproduce the build failure it's enough to run
- $ cabal configure --hsc2hs-options='--cross-safe --cross-compile'
- $ cabal build --hsc2hs-options='--cross-safe --cross-compile'
-
- Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-
- * SimpleMAPI.hsc: don't use #ifdef in enum declarations
-
- This change workarounds hsc2hs bug in cross-compile mode:
- https://ghc.haskell.org/trac/ghc/ticket/13620
-
- To reproduce the build failure it's enough to run
- $ cabal configure --hsc2hs-options='--cross-safe --cross-compile'
- $ cabal build --hsc2hs-options='--cross-safe --cross-compile'
-
- Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-
-diff --git a/Graphics/Win32/GDI/Pen.hsc b/Graphics/Win32/GDI/Pen.hsc
-index c880170..8d8df5d 100644
---- a/Graphics/Win32/GDI/Pen.hsc
-+++ b/Graphics/Win32/GDI/Pen.hsc
-@@ -56,7 +56,7 @@ foreign import WINDOWS_CCONV unsafe "windows.h DeleteObject"
-
- type PenStyle = INT
-
--#{enum PenStyle, // Pick one of these
-+#{enum PenStyle,
- , pS_SOLID = PS_SOLID // default
- , pS_DASH = PS_DASH // -------
- , pS_DOT = PS_DOT // .......
-@@ -69,14 +69,14 @@ type PenStyle = INT
- , pS_STYLE_MASK = PS_STYLE_MASK // all the above
- }
-
--#{enum PenStyle , // "or" with one of these
-+#{enum PenStyle,
- , pS_ENDCAP_ROUND = PS_ENDCAP_ROUND // default
- , pS_ENDCAP_SQUARE = PS_ENDCAP_SQUARE
- , pS_ENDCAP_FLAT = PS_ENDCAP_FLAT
- , pS_ENDCAP_MASK = PS_ENDCAP_MASK // all the above
- }
-
--#{enum PenStyle, // "or" with one of these
-+#{enum PenStyle,
- , pS_JOIN_ROUND = PS_JOIN_ROUND // default
- , pS_JOIN_BEVEL = PS_JOIN_BEVEL
- , pS_JOIN_MITER = PS_JOIN_MITER
-@@ -87,7 +87,7 @@ If PS_JOIN_MASK is not defined with your GNU Windows32 header files,
- you'll have to define it.
- -}
-
--#{enum PenStyle, // "or" with one of these
-+#{enum PenStyle,
- , pS_COSMETIC = PS_COSMETIC // default
- , pS_GEOMETRIC = PS_GEOMETRIC
- , pS_TYPE_MASK = PS_TYPE_MASK // all the above
-diff --git a/System/Win32/Info/Computer.hsc b/System/Win32/Info/Computer.hsc
-index bb2eb72..65ae8dc 100644
---- a/System/Win32/Info/Computer.hsc
-+++ b/System/Win32/Info/Computer.hsc
-@@ -65,7 +65,7 @@ import System.Win32.Utils ( tryWithoutNull )
- import System.Win32.Word ( DWORD, LPDWORD )
-
- #include <windows.h>
--#include <Lmcons.h>
-+#include <lmcons.h>
- #include "alignment.h"
- ##include "windows_cconv.h"
-
-diff --git a/System/Win32/SimpleMAPI.hsc b/System/Win32/SimpleMAPI.hsc
-index 9727cfc..5ebf06b 100644
---- a/System/Win32/SimpleMAPI.hsc
-+++ b/System/Win32/SimpleMAPI.hsc
-@@ -53,12 +53,6 @@ type MapiFlag = ULONG
- , mAPI_LOGON_UI = MAPI_LOGON_UI
- , mAPI_NEW_SESSION = MAPI_NEW_SESSION
- , mAPI_FORCE_DOWNLOAD = MAPI_FORCE_DOWNLOAD
--#ifdef MAPI_LOGOFF_SHARED
-- , mAPI_LOGOFF_SHARED = MAPI_LOGOFF_SHARED
--#endif
--#ifdef MAPI_LOGOFF_UI
-- , mAPI_LOGOFF_UI = MAPI_LOGOFF_UI
--#endif
- , mAPI_DIALOG = MAPI_DIALOG
- , mAPI_UNREAD_ONLY = MAPI_UNREAD_ONLY
- , mAPI_LONG_MSGID = MAPI_LONG_MSGID
-@@ -74,6 +68,19 @@ type MapiFlag = ULONG
- , mAPI_RECEIPT_REQUESTED = MAPI_RECEIPT_REQUESTED
- , mAPI_SENT = MAPI_SENT
- }
-+-- Have to define enum values outside previous declaration due to
-+-- hsc2hs bug in --cross-compile mode:
-+-- https://ghc.haskell.org/trac/ghc/ticket/13620
-+#ifdef MAPI_LOGOFF_SHARED
-+#{enum MapiFlag,
-+ , mAPI_LOGOFF_SHARED = MAPI_LOGOFF_SHARED
-+}
-+#endif
-+#ifdef MAPI_LOGOFF_UI
-+#{enum MapiFlag,
-+ , mAPI_LOGOFF_UI = MAPI_LOGOFF_UI
-+}
-+#endif
-
- mapiErrors :: [(ULONG,String)]
- mapiErrors =
diff --git a/dev-lang/ghc/files/ghc-8.2.1_rc2-O2-unreg.patch b/dev-lang/ghc/files/ghc-8.2.1_rc2-O2-unreg.patch
deleted file mode 100644
index 00f9ca4fdff9..000000000000
--- a/dev-lang/ghc/files/ghc-8.2.1_rc2-O2-unreg.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-ghc -O2 generates too large C files for unregisterised compiler.
-On ia64 it causes DynFlags to compile for 60 minutes (then assembler
-crashes).
-
-To decrease C code inflation we don't use -O2 in UNREG mode.
-diff --git a/mk/config.mk.in b/mk/config.mk.in
-index 4e61eea..15a56e9 100644
---- a/mk/config.mk.in
-+++ b/mk/config.mk.in
-@@ -72,11 +72,2 @@ GhcStage3HcOpts=-O2
-
--# Disable -O2 optimization. Otherwise amount of generated C code
--# makes things very slow to compile (~5 minutes on core-i7 for 'compiler/hsSyn/HsExpr.hs')
--# and sometimes not compile at all (powerpc64 overflows something
--# on 'compiler/hsSyn/HsExpr.hs').
--ifeq "$(GhcUnregisterised)" "YES"
--GhcStage1HcOpts=
--GhcStage2HcOpts=
--GhcStage3HcOpts=
--endif
-
-@@ -904 +895,13 @@ CURSES_INCLUDE_DIRS = @CURSES_INCLUDE_DIRS@
- CURSES_LIB_DIRS = @CURSES_LIB_DIRS@
-+
-+# Disable -O2 optimization. Otherwise amount of generated C code
-+# makes things very slow to compile (~5 minutes on core-i7 for 'compiler/hsSyn/HsExpr.hs')
-+# and sometimes not compile at all (powerpc64 overflows something
-+# on 'compiler/hsSyn/HsExpr.hs').
-+ifeq "$(GhcUnregisterised)" "YES"
-+GhcStage1HcOpts=
-+GhcStage2HcOpts=
-+GhcStage3HcOpts=
-+
-+GhcLibHcOpts=
-+endif
diff --git a/dev-lang/ghc/files/ghc-8.2.1_rc3-any-vendor.patch b/dev-lang/ghc/files/ghc-8.2.1_rc3-any-vendor.patch
deleted file mode 100644
index b55e37a8bf94..000000000000
--- a/dev-lang/ghc/files/ghc-8.2.1_rc3-any-vendor.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From c2303dff95aa174021a1950656fdf9a1cf983959 Mon Sep 17 00:00:00 2001
-From: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Sat, 8 Jul 2017 09:47:12 +0100
-Subject: [PATCH] aclocal.m4: allow arbitrary <vendor> string in toolchain
- triplets
-
-Canonical triplets have a form of
- <arch>-<vendor>-<os>[-<abi>]
-
-Checking for vendor is almost never correct as it's an
-arbitrary string.
-
-It's useful to have multiple "vendors" to denote
-otherwise the same (WRT <arch>, <os>, <abi>) target:
- --target=x86_64-pc-linux-gnu
- --target=x86_64-unknown-linux-gnu
- --target=x86_64-ghc80-linux-gnu
- --target=x86_64-ghchead-linux-gnu
-
-Do not fail unknown vendors. Only emit a warning.
-Ideally configure checks should never use "vendor".
-
-Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
----
- aclocal.m4 | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/aclocal.m4 b/aclocal.m4
-index 001f813dfc..1d9c09b0cd 100644
---- a/aclocal.m4
-+++ b/aclocal.m4
-@@ -230,8 +230,7 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
- dec|none|unknown|hp|apple|next|sun|sgi|ibm|montavista|portbld)
- ;;
- *)
-- echo "Unknown vendor [$]1"
-- exit 1
-+ AC_MSG_WARN([Unknown vendor [$]1])
- ;;
- esac
- }
---
-2.13.3
-
diff --git a/dev-lang/ghc/files/ghc-8.2.1_rc3-stginit-data.patch b/dev-lang/ghc/files/ghc-8.2.1_rc3-stginit-data.patch
deleted file mode 100644
index 81e751d778c8..000000000000
--- a/dev-lang/ghc/files/ghc-8.2.1_rc3-stginit-data.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Fix label type for __stginit_* labels: those are .data labels, not .text
-
-Noticed when was building --enable-unregisterised build for x86_64:
-
-/tmp/ghc22931_0/ghc_3.hc:5:9: error:
- error: '__stginit_ghczmprim_GHCziTypes' redeclared as different kind of symbol
- StgWord __stginit_ghczmprim_GHCziTypes[]__attribute__((aligned(8)))= {
- ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- |
-5 | StgWord __stginit_ghczmprim_GHCziTypes[]__attribute__((aligned(8)))= {
- | ^
-
-In file included from /tmp/ghc22931_0/ghc_3.hc:3:0: error:
-
-/tmp/ghc22931_0/ghc_3.hc:4:5: error:
- note: previous declaration of '__stginit_ghczmprim_GHCziTypes' was here
- EF_(__stginit_ghczmprim_GHCziTypes);
- ^
-diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs
-index 77a889a..05d71ab 100644
---- a/compiler/cmm/CLabel.hs
-+++ b/compiler/cmm/CLabel.hs
-@@ -956,3 +956,3 @@ labelType (CaseLabel _ CaseReturnInfo) = DataLabel
- labelType (CaseLabel _ _) = CodeLabel
--labelType (PlainModuleInitLabel _) = CodeLabel
-+labelType (PlainModuleInitLabel _) = DataLabel
- labelType (SRTLabel _) = DataLabel
diff --git a/dev-lang/ghc/files/ghc-8.8.1-no-alex.patch b/dev-lang/ghc/files/ghc-8.8.1-no-alex.patch
deleted file mode 100644
index 39b6eeedd566..000000000000
--- a/dev-lang/ghc/files/ghc-8.8.1-no-alex.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-https://github.com/gentoo-haskell/gentoo-haskell/issues/959
-
-From 144abba394c6a23eb877fbde727111a5e75b9d47 Mon Sep 17 00:00:00 2001
-From: Ben Gamari <ben@smart-cactus.org>
-Date: Wed, 18 Sep 2019 23:50:20 -0400
-Subject: [PATCH] configure: Don't depend upon alex in source dist build
-
-This fixes #16860 by verifying that the generated sources don't already
-exist before asserting that the `alex` executable was found. This
-replicates the logic already used for `happy` in the case of `alex`.
----
- aclocal.m4 | 7 +++++--
- 1 file changed, 5 insertions(+), 2 deletions(-)
-
---- a/aclocal.m4
-+++ b/aclocal.m4
-@@ -984,8 +984,11 @@ else
- fi;
- changequote([, ])dnl
- ])
--FP_COMPARE_VERSIONS([$fptools_cv_alex_version],[-lt],[3.1.7],
-- [AC_MSG_ERROR([Alex version 3.1.7 or later is required to compile GHC.])])[]
-+if test ! -f compiler/parser/Lexer.hs
-+then
-+ FP_COMPARE_VERSIONS([$fptools_cv_alex_version],[-lt],[3.1.7],
-+ [AC_MSG_ERROR([Alex version 3.1.7 or later is required to compile GHC.])])[]
-+fi
- AlexVersion=$fptools_cv_alex_version;
- AC_SUBST(AlexVersion)
- ])
---
-2.23.0
-