diff options
-rw-r--r-- | compiler/ghc.mk | 17 | ||||
-rw-r--r-- | compiler/main/DriverPipeline.hs | 15 | ||||
-rw-r--r-- | compiler/main/SysTools.lhs | 3 | ||||
-rw-r--r-- | compiler/parser/Parser.y.pp | 18 | ||||
-rw-r--r-- | compiler/stranal/WwLib.lhs | 7 | ||||
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | docs/users_guide/7.8.1-notes.xml | 11 | ||||
-rw-r--r-- | docs/users_guide/external_core.xml | 2 | ||||
-rw-r--r-- | docs/users_guide/flags.xml | 28 | ||||
-rw-r--r-- | docs/users_guide/using.xml | 25 | ||||
-rw-r--r-- | driver/ghc-usage.txt | 2 | ||||
m--------- | libraries/Cabal | 0 | ||||
m--------- | libraries/containers | 0 | ||||
m--------- | libraries/haskeline | 0 | ||||
-rw-r--r-- | mk/config.mk.in | 2 | ||||
-rw-r--r-- | rts/Linker.c | 8 | ||||
-rwxr-xr-x | validate | 13 |
17 files changed, 112 insertions, 45 deletions
diff --git a/compiler/ghc.mk b/compiler/ghc.mk index af289d436c..caf491e4c1 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 8fc44ed81f..7c5bc90647 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 1b83592118..0db5e06ed6 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 489b5affa4..634d3c76f0 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 ca64a7fbce..2ab4bd9ba0 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 8d8136f756..b0ada24240 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 85d2f61053..15bf82bc68 100644 --- a/docs/users_guide/7.8.1-notes.xml +++ b/docs/users_guide/7.8.1-notes.xml @@ -146,6 +146,17 @@ </listitem> <listitem> + <para> + New PrimOps for atomic memory operations. + The <literal>casMutVar#</literal> PrimOp was introduced in + GHC 7.2 (debugged in 7.4). This release also includes additional + PrimOps for compare-and-swap (<literal>casArray#</literal> and + <literal>casIntArray#</literal>) and one for fetch-and-add + (<literal>fetchAddIntArray#</literal>). + </para> + </listitem> + + <listitem> <para> TODO: mention dynamic changes </para> diff --git a/docs/users_guide/external_core.xml b/docs/users_guide/external_core.xml index bc9d350d34..22273818da 100644 --- a/docs/users_guide/external_core.xml +++ b/docs/users_guide/external_core.xml @@ -1786,7 +1786,7 @@ case (error "") of <state>South Carolina</state> </address> <pubdate>1993</pubdate> - <bibliomisc><ulink url="citeseer.ist.psu.edu/launchbury93natural.html">citeseer.ist.psu.edu/launchbury93natural.html</ulink></bibliomisc> + <bibliomisc><ulink url="http://citeseer.ist.psu.edu/launchbury93natural.html">http://citeseer.ist.psu.edu/launchbury93natural.html</ulink></bibliomisc> <!-- booktitle = "Conference Record of the Twentieth Annual {ACM} {SIGPLAN}-{SIGACT} Symposium on Principles of Programming Languages", --> </biblioentry> diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml index ee577e6ead..1ec1e890ee 100644 --- a/docs/users_guide/flags.xml +++ b/docs/users_guide/flags.xml @@ -1586,17 +1586,6 @@ </row> <row> - <entry><option>-ffun-to-thunk</option></entry> - <entry>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.</entry> - <entry>dynamic</entry> - <entry><option>-fno-fun-to-thunk</option></entry> - </row> - - <row> <entry><option>-fdo-eta-reduction</option></entry> <entry>Enable eta-reduction. Implied by <option>-O</option>.</entry> <entry>dynamic</entry> @@ -1662,6 +1651,15 @@ </row> <row> + <entry><option>-ffun-to-thunk</option></entry> + <entry>Allow worker-wrapper to convert a function closure into a + thunk if the function does not use any of its arguments. Off by + default.</entry> + <entry>dynamic</entry> + <entry><option>-fno-fun-to-thunk</option></entry> + </row> + + <row> <entry><option>-fignore-asserts</option></entry> <entry>Ignore assertions in the source</entry> <entry>dynamic</entry> @@ -1676,6 +1674,14 @@ </row> <row> + <entry><option>-flate-dmd-anal</option></entry> + <entry>Run demand analysis again, at the end of the simplification + pipeline</entry> + <entry>dynamic</entry> + <entry><option>-fno-late-dmd-anal</option></entry> + </row> + + <row> <entry><option>-fliberate-case</option></entry> <entry>Turn on the liberate-case transformation. Implied by <option>-O2</option>.</entry> <entry>dynamic</entry> diff --git a/docs/users_guide/using.xml b/docs/users_guide/using.xml index 4440eec7dd..f6db2192a8 100644 --- a/docs/users_guide/using.xml +++ b/docs/users_guide/using.xml @@ -2095,16 +2095,15 @@ f "2" = 2 <varlistentry> <term> - <option>--ffun-to-thunk</option> + <option>-ffun-to-thunk</option> <indexterm><primary><option>-fignore-asserts</option></primary></indexterm> </term> <listitem> - <para>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 <emphasis>all</emphasis> value lambdas. - Off by default. + <para>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 <emphasis>all</emphasis> + value lambdas. Off by default. </para> </listitem> </varlistentry> @@ -2139,6 +2138,18 @@ f "2" = 2 <varlistentry> <term> + <option>-flate-dmd-anal</option> + <indexterm><primary><option>-flate-dmd-anal</option></primary></indexterm> + </term> + <listitem> + <para><emphasis>Off by default.</emphasis>Run demand analysis + again, at the end of the simplification pipeline + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term> <option>-fliberate-case</option> <indexterm><primary><option>-fliberate-case</option></primary></indexterm> </term> diff --git a/driver/ghc-usage.txt b/driver/ghc-usage.txt index 4eda2c1724..239b4540d8 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 -Subproject 9f374ab45e62924506b992db9157c970c7259a0 +Subproject e41a92a7bbad928d14d4bf1291d23e6bd6ce169 diff --git a/libraries/containers b/libraries/containers -Subproject 154cd539a22e4d82ff56fec2d8ad38855f78513 +Subproject c4f44a33136df0c6239eb5219b72a487b90b6ad diff --git a/libraries/haskeline b/libraries/haskeline -Subproject 495b00b4f125c0b4e7f1e966cd961eae89cffdc +Subproject 708f0f604d8a9fea65a445892f262dfdf2a56ee diff --git a/mk/config.mk.in b/mk/config.mk.in index 6402ac5680..20bb1ed4fe 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 c8451b0425..9dc0598ddf 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); @@ -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 |