diff --git a/compiler/ghc.mk b/compiler/ghc.mk
index af289d436cc1c248dd665cd25af23afe44f62d7e..caf491e4c19d2de7efd05aa9f3245a58cc3b8af7 100644
--- a/compiler/ghc.mk
+++ b/compiler/ghc.mk
@@ -347,8 +347,23 @@ else
compiler_CONFIGURE_OPTS += --ghc-option=-DNO_REGS
endif
-ifeq "$(GhcProfiled)" "YES"
+# If we're bootstrapping the compiler during stage2, or we're being
+# built by a GHC whose version is > 7.8, we need -fcmm-sink to be
+# passed to the compiler. This is required on x86 to avoid the
+# register allocator running out of stack slots when compiling this
+# module with -fPIC -dynamic.
+ifeq "$(CMM_SINK_BOOTSTRAP_IS_NEEDED)" "YES"
+compiler/stage1/build/Parser_HC_OPTS += -fcmm-sink
+endif
+# However, we may be using e.g. 7.6, and thus the bootstrap compiler
+# does not need to pass -fcmm-sink, but stage1+ does!
+# We pass -fcmm-sink to every stage != 1
+# See #8182 for all the details
+compiler/stage2/build/Parser_HC_OPTS += -fcmm-sink
+compiler/stage3/build/Parser_HC_OPTS += -fcmm-sink
+
+ifeq "$(GhcProfiled)" "YES"
# If we're profiling GHC then we want SCCs. However, adding -auto-all
# everywhere tends to give a hard-to-read profile, and adds lots of
# overhead. A better approach is to proceed top-down; identify the
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index 8fc44ed81f20aba61da833d922370711c3e4289d..7c5bc90647ef52ef7ef518effbee76e2522aefd7 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -1917,11 +1917,22 @@ linkBinary' staticLink dflags o_files dep_packages = do
-- on x86.
++ (if sLdSupportsCompactUnwind mySettings &&
not staticLink &&
- platformOS platform == OSDarwin &&
- platformArch platform `elem` [ArchX86, ArchX86_64]
+ (platformOS platform == OSDarwin || platformOS platform == OSiOS) &&
+ case platformArch platform of
+ ArchX86 -> True
+ ArchX86_64 -> True
+ ArchARM {} -> True
+ _ -> False
then ["-Wl,-no_compact_unwind"]
else [])
+ -- '-no_pie'
+ -- iOS uses 'dynamic-no-pic', so we must pass this to ld to suppress a warning; see #7722
+ ++ (if platformOS platform == OSiOS &&
+ not staticLink
+ then ["-Wl,-no_pie"]
+ else [])
+
-- '-Wl,-read_only_relocs,suppress'
-- ld gives loads of warnings like:
-- ld: warning: text reloc in _base_GHCziArr_unsafeArray_info to _base_GHCziArr_unsafeArray_closure
diff --git a/compiler/main/SysTools.lhs b/compiler/main/SysTools.lhs
index 1b83592118c73cc650d573a9f22f73140372647d..0db5e06ed6d94ff173fe670eeb702b2fe87a84cf 100644
--- a/compiler/main/SysTools.lhs
+++ b/compiler/main/SysTools.lhs
@@ -681,6 +681,9 @@ getLinkerInfo' dflags = do
-- that doesn't support --version. We can just assume that's
-- what we're using.
return $ DarwinLD []
+ OSiOS ->
+ -- Ditto for iOS
+ return $ DarwinLD []
OSMinGW32 ->
-- GHC doesn't support anything but GNU ld on Windows anyway.
-- Process creation is also fairly expensive on win32, so
diff --git a/compiler/parser/Parser.y.pp b/compiler/parser/Parser.y.pp
index 489b5affa49ee46600155d6530341f8b799f2452..634d3c76f0aefabc79aa1d823482ea4f11051d8b 100644
--- a/compiler/parser/Parser.y.pp
+++ b/compiler/parser/Parser.y.pp
@@ -24,24 +24,6 @@ to inline certain key external functions, so we instruct GHC not to
throw away inlinings as it would normally do in -O0 mode.
-}
--- CPP tricks because we want the directives in the output of the
--- first CPP pass.
---
--- Clang note, 6/17/2013 by aseipp: It is *extremely* important (for
--- some reason) that there be a line of whitespace between the two
--- definitions here, and the subsequent use of __IF_GHC_77__ - this
--- seems to be a bug in clang or something, where having the line of
--- whitespace will make the preprocessor correctly format the rendered
--- lines in the 'two step' CPP pass. No, this is not a joke.
-#define __IF_GHC_77__ #if __GLASGOW_HASKELL__ >= 707
-#define __ENDIF__ #endif
-
-__IF_GHC_77__
--- Required on x86 to avoid the register allocator running out of
--- stack slots when compiling this module with -fPIC -dynamic.
-{-# OPTIONS_GHC -fcmm-sink #-}
-__ENDIF__
-
module Parser ( parseModule, parseStmt, parseIdentifier, parseType,
parseHeader ) where
diff --git a/compiler/stranal/WwLib.lhs b/compiler/stranal/WwLib.lhs
index ca64a7fbce87e8b67ab6cdaeab9c64fa3f5f9bff..2ab4bd9ba08c925c20274d7de3fb0745931d49db 100644
--- a/compiler/stranal/WwLib.lhs
+++ b/compiler/stranal/WwLib.lhs
@@ -214,8 +214,11 @@ the sharing of E. Since absence analysis and worker-wrapper are keen
to remove such unused arguments, we add in a void argument to prevent
the function from becoming a thunk.
-The user can avoid that argument with the -ffun-to-thunk
-flag. However, removing all the value argus may introduce space leaks.
+The user can avoid adding the void argument with the -ffun-to-thunk
+flag. However, this can create sharing, which may be bad in two ways. 1) It can
+create a space leak. 2) It can prevent inlining *under a lambda*. If w/w
+removes the last argument from a function f, then f now looks like a thunk, and
+so f can't be inlined *under a lambda*.
Note [All One-Shot Arguments of a Worker]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/configure.ac b/configure.ac
index 8d8136f756041433bce160c6f6832b8850c3a73d..b0ada2424009afe63c3ab23bfb43869adb906148 100644
--- a/configure.ac
+++ b/configure.ac
@@ -156,6 +156,12 @@ FP_COMPARE_VERSIONS([$GhcVersion],[-lt],[7.5],
GHC_PACKAGE_DB_FLAG=package-db)
AC_SUBST(GHC_PACKAGE_DB_FLAG)
+# GHC 7.7+ needs -fcmm-sink when compiling Parser.hs. See #8182
+FP_COMPARE_VERSIONS([$GhcVersion],[-gt],[7.7],
+ CMM_SINK_BOOTSTRAP_IS_NEEDED=YES,
+ CMM_SINK_BOOTSTRAP_IS_NEEDED=NO)
+AC_SUBST(CMM_SINK_BOOTSTRAP_IS_NEEDED)
+
# GHC is passed to Cabal, so we need a native path
if test "${WithGhc}" != ""
then
diff --git a/docs/users_guide/7.8.1-notes.xml b/docs/users_guide/7.8.1-notes.xml
index 85d2f61053f3dd8869b64eba909847a6ddddd099..15bf82bc68181902dc18f5097428d37d8100c3d2 100644
--- a/docs/users_guide/7.8.1-notes.xml
+++ b/docs/users_guide/7.8.1-notes.xml
@@ -145,6 +145,17 @@
+
+
+ New PrimOps for atomic memory operations.
+ The casMutVar# PrimOp was introduced in
+ GHC 7.2 (debugged in 7.4). This release also includes additional
+ PrimOps for compare-and-swap (casArray# and
+ casIntArray#) and one for fetch-and-add
+ (fetchAddIntArray#).
+
+
+
TODO: mention dynamic changes
diff --git a/docs/users_guide/external_core.xml b/docs/users_guide/external_core.xml
index bc9d350d34fdbb67abda19226540d7cd22e29ae3..22273818da7d286be8d08bed43ee50269e856033 100644
--- a/docs/users_guide/external_core.xml
+++ b/docs/users_guide/external_core.xml
@@ -1786,7 +1786,7 @@ case (error "") of
South Carolina1993
- citeseer.ist.psu.edu/launchbury93natural.html
+ http://citeseer.ist.psu.edu/launchbury93natural.html
diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml
index ee577e6ead711151f87cd466c420e52c7b132691..1ec1e890ee18767bd50bfe1d4484554509509314 100644
--- a/docs/users_guide/flags.xml
+++ b/docs/users_guide/flags.xml
@@ -1585,17 +1585,6 @@
-
-
- Worker-wrapper removes unused arguments; this flag
- lets it thusly remove all value lambdas. Doing so creates
- a thunk where it was previously a function closure, which
- may save recomputation but also risks a space leak. Off by
- default.
- dynamic
-
-
-
Enable eta-reduction. Implied by .
@@ -1661,6 +1650,15 @@
+
+
+ Allow worker-wrapper to convert a function closure into a
+ thunk if the function does not use any of its arguments. Off by
+ default.
+ dynamic
+
+
+
Ignore assertions in the source
@@ -1675,6 +1673,14 @@
+
+
+ Run demand analysis again, at the end of the simplification
+ pipeline
+ dynamic
+
+
+
Turn on the liberate-case transformation. Implied by .
diff --git a/docs/users_guide/using.xml b/docs/users_guide/using.xml
index 4440eec7dd130ce8f92692a2108f96e540eff66f..f6db2192a86a21cd19d589ceb303956d98402ce8 100644
--- a/docs/users_guide/using.xml
+++ b/docs/users_guide/using.xml
@@ -2095,16 +2095,15 @@ f "2" = 2
-
+
- Worker-wrapper removes unused arguments, but usually we
- do not remove them all, lest it turn a function closure into a thunk,
- thereby perhaps causing extra allocation (since let-no-escape can't happen)
- and/or a space leak. This flag
- allows worker/wrapper to remove all value lambdas.
- Off by default.
+ Worker-wrapper removes unused arguments, but usually we do
+ not remove them all, lest it turn a function closure into a thunk,
+ thereby perhaps creating a space leak and/or disrupting inlining.
+ This flag allows worker/wrapper to remove all
+ value lambdas. Off by default.
@@ -2137,6 +2136,18 @@ f "2" = 2
+
+
+
+
+
+
+ Off by default.Run demand analysis
+ again, at the end of the simplification pipeline
+
+
+
+
diff --git a/driver/ghc-usage.txt b/driver/ghc-usage.txt
index 4eda2c1724dba5a6d1b2e832f8a0cc678d94fafa..239b4540d840475feeb7d983c9cddb845891d0ad 100644
--- a/driver/ghc-usage.txt
+++ b/driver/ghc-usage.txt
@@ -47,8 +47,6 @@ Other commonly-used options are:
-v[n] Control verbosity (n is 0--5, normal verbosity level is 1,
-v alone is equivalent to -v3)
- -fglasgow-exts Allow Glasgow extensions (unboxed types, etc.)
-
-O An `optimising' package of compiler flags, for faster code
-prof Compile for cost-centre profiling
diff --git a/libraries/Cabal b/libraries/Cabal
index 9f374ab45e62924506b992db9157c970c7259a03..e41a92a7bbad928d14d4bf1291d23e6bd6ce169e 160000
--- a/libraries/Cabal
+++ b/libraries/Cabal
@@ -1 +1 @@
-Subproject commit 9f374ab45e62924506b992db9157c970c7259a03
+Subproject commit e41a92a7bbad928d14d4bf1291d23e6bd6ce169e
diff --git a/libraries/containers b/libraries/containers
index 154cd539a22e4d82ff56fec2d8ad38855f78513a..c4f44a33136df0c6239eb5219b72a487b90b6ad1 160000
--- a/libraries/containers
+++ b/libraries/containers
@@ -1 +1 @@
-Subproject commit 154cd539a22e4d82ff56fec2d8ad38855f78513a
+Subproject commit c4f44a33136df0c6239eb5219b72a487b90b6ad1
diff --git a/libraries/haskeline b/libraries/haskeline
index 495b00b4f125c0b4e7f1e966cd961eae89cffdc0..708f0f604d8a9fea65a445892f262dfdf2a56ee6 160000
--- a/libraries/haskeline
+++ b/libraries/haskeline
@@ -1 +1 @@
-Subproject commit 495b00b4f125c0b4e7f1e966cd961eae89cffdc0
+Subproject commit 708f0f604d8a9fea65a445892f262dfdf2a56ee6
diff --git a/mk/config.mk.in b/mk/config.mk.in
index 6402ac5680349dcd255dc1f57059867ecb488d9e..20bb1ed4fe90f0a327a43ee103e93491fd1577ff 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -471,6 +471,8 @@ endif
GHC_PACKAGE_DB_FLAG = @GHC_PACKAGE_DB_FLAG@
+CMM_SINK_BOOTSTRAP_IS_NEEDED = @CMM_SINK_BOOTSTRAP_IS_NEEDED@
+
#-----------------------------------------------------------------------------
# C compiler
#
diff --git a/rts/Linker.c b/rts/Linker.c
index c8451b0425803af9538d6f8f0ad06df8a13e63e0..9dc0598ddf54086d3356943344f51e258a09bf3d 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -3798,6 +3798,11 @@ ocGetNames_PEi386 ( ObjectCode* oc )
/* I'm sure this is the Right Way to do it. However, the
alternative of testing the sectab_i->Name field seems to
work ok with Cygwin.
+
+ EZY: We should strongly consider using this style, because
+ it lets us pick up sections that should be added (e.g.
+ for a while the linker did not work due to missing .eh_frame
+ in this section.)
*/
if (sectab_i->Characteristics & MYIMAGE_SCN_CNT_CODE ||
sectab_i->Characteristics & MYIMAGE_SCN_CNT_INITIALIZED_DATA)
@@ -3807,6 +3812,7 @@ ocGetNames_PEi386 ( ObjectCode* oc )
if (0==strcmp(".text",(char*)secname) ||
0==strcmp(".text.startup",(char*)secname) ||
0==strcmp(".rdata",(char*)secname)||
+ 0==strcmp(".eh_frame", (char*)secname)||
0==strcmp(".rodata",(char*)secname))
kind = SECTIONKIND_CODE_OR_RODATA;
if (0==strcmp(".data",(char*)secname) ||
@@ -3835,6 +3841,8 @@ ocGetNames_PEi386 ( ObjectCode* oc )
/* ignore unknown section that appeared in gcc 3.4.5(?) */
&& 0!= strcmp(".reloc", (char*)secname)
&& 0 != strcmp(".rdata$zzz", (char*)secname)
+ /* ignore linker directive sections */
+ && 0 != strcmp(".drectve", (char*)secname)
) {
errorBelch("Unknown PEi386 section name `%s' (while processing: %" PATH_FMT")", secname, oc->fileName);
stgFree(secname);
diff --git a/validate b/validate
index 95425d3770db3048096435e6720df02cbf666448..eafbdb9b7144845beb647a1091a79c98f0df4d07 100755
--- a/validate
+++ b/validate
@@ -22,6 +22,9 @@ Flags:
--fast Omit dyn way, omit binary distribution
--slow Build stage2 with -DDEBUG.
2008-07-01: 14% slower than the default.
+ --no-dph: Skip requiring libraries/dph. In --slow mode, these tests
+ can take a substantial amount of time, and on some platforms
+ with broken linkers, we don't want to try compiling it.
--help shows this usage help.
Set environment variable 'CPUS' to number of cores, to exploit
@@ -36,6 +39,7 @@ no_clean=0
testsuite_only=0
hpc=NO
speed=NORMAL
+skip_dph=0
while [ $# -gt 0 ]
do
@@ -58,6 +62,9 @@ do
--normal)
speed=NORMAL
;;
+ --no-dph)
+ skip_dph=1
+ ;;
--help)
show_help
exit 0;;
@@ -115,7 +122,11 @@ if [ $no_clean -eq 0 ]; then
INSTDIR=`cygpath -m "$INSTDIR"`
fi
- /usr/bin/perl -w boot --validate --required-tag=dph
+ if [ $skip_dph -eq 1 ]; then
+ /usr/bin/perl -w boot --validate
+ else
+ /usr/bin/perl -w boot --validate --required-tag=dph
+ fi
./configure --prefix="$INSTDIR" $config_args
fi