Ticket #2615: T2615a.dsend

File T2615a.dsend, 53.1 KB (added by hgolden, 6 years ago)

FIX #2615 - ghc repository

Line 
1Wed Dec 16 10:51:55 PST 2009  [email protected]
2  * FIX #2615 (linker scripts in .so files)
3  This patch does not apply to Windows. It only applies to systems with
4  ELF binaries.
5 
6  This is a patch to rts/Linker.c to recognize linker scripts in .so
7  files and find the real target .so shared library for loading.
8
9New patches:
10
11[FIX #2615 (linker scripts in .so files)
12[email protected]**20091216185155
13 Ignore-this: e470cb78dc7cc9f39cba209e594c6283
14 This patch does not apply to Windows. It only applies to systems with
15 ELF binaries.
16 
17 This is a patch to rts/Linker.c to recognize linker scripts in .so
18 files and find the real target .so shared library for loading.
19] {
20hunk ./rts/Linker.c 42
21 
22 #include <stdlib.h>
23 #include <string.h>
24+#include <stdio.h>
25+#include <assert.h>
26 
27 #ifdef HAVE_SYS_STAT_H
28 #include <sys/stat.h>
29hunk ./rts/Linker.c 84
30 
31 #if defined(linux_HOST_OS) || defined(solaris2_HOST_OS) || defined(freebsd_HOST_OS) || defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS) || defined(openbsd_HOST_OS)
32 #  define OBJFORMAT_ELF
33+#  include <regex.h>   // regex is already used by dlopen() so this is OK
34+                       // to use here without requiring an additional lib
35 #elif defined(cygwin32_HOST_OS) || defined (mingw32_HOST_OS)
36 #  define OBJFORMAT_PEi386
37 #  include <windows.h>
38hunk ./rts/Linker.c 1102
39 
40 #if defined(OBJFORMAT_ELF) || defined(OBJFORMAT_MACHO)
41 static void *dl_prog_handle;
42+static regex_t re_invalid;
43+static regex_t re_realso;
44+static void initLinkerCleanup( void );
45+#ifdef THREADED_RTS
46+static Mutex dl_mutex; // mutex to protect dlopen/dlerror critical section
47+#endif
48 #endif
49 
50 void
51hunk ./rts/Linker.c 1114
52 initLinker( void )
53 {
54     RtsSymbolVal *sym;
55+    int compileResult;
56 
57     /* Make initLinker idempotent, so we can call it
58        before evey relevant operation; that means we
59hunk ./rts/Linker.c 1123
60       linker_init_done = 1;
61     }
62 
63+#ifdef THREADED_RTS
64+    initMutex(&dl_mutex);
65+#endif
66     stablehash = allocStrHashTable();
67     symhash = allocStrHashTable();
68 
69hunk ./rts/Linker.c 1144
70 #   else
71     dl_prog_handle = dlopen(NULL, RTLD_LAZY);
72 #   endif /* RTLD_DEFAULT */
73+
74+    compileResult = regcomp(&re_invalid,
75+           "(([^ \t()])+\\.so([^ \t:()])*):([ \t])*invalid ELF header",
76+           REG_EXTENDED);
77+    ASSERT( compileResult == 0 );
78+    compileResult = regcomp(&re_realso,
79+           "GROUP *\\( *(([^ )])+)",
80+           REG_EXTENDED);
81+    ASSERT( compileResult == 0 );
82 #   endif
83 
84 #if defined(x86_64_HOST_ARCH)
85hunk ./rts/Linker.c 1173
86 #endif
87 }
88 
89+void
90+exitLinker( void ) {
91+#if defined(OBJFORMAT_ELF) || defined(OBJFORMAT_MACHO)
92+   if (linker_init_done == 1) {
93+      regfree(&re_invalid);
94+      regfree(&re_realso);
95+#ifdef THREADED_RTS
96+      closeMutex(&dl_mutex);
97+#endif
98+   }
99+#endif
100+}
101+
102 /* -----------------------------------------------------------------------------
103  *                  Loading DLL or .so dynamic libraries
104  * -----------------------------------------------------------------------------
105hunk ./rts/Linker.c 1221
106 static OpenedDLL* opened_dlls = NULL;
107 #endif
108 
109-const char *
110-addDLL( char *dll_name )
111-{
112 #  if defined(OBJFORMAT_ELF) || defined(OBJFORMAT_MACHO)
113hunk ./rts/Linker.c 1222
114-   /* ------------------- ELF DLL loader ------------------- */
115-   void *hdl;
116-   const char *errmsg;
117 
118hunk ./rts/Linker.c 1223
119-   initLinker();
120+static char *
121+internal_dlopen(const char *dll_name)
122+{
123+   void *hdl;
124+   char *errmsg, *errmsg_copy;
125 
126    // omitted: RTLD_NOW
127    // see http://www.haskell.org/pipermail/cvs-ghc/2007-September/038570.html
128hunk ./rts/Linker.c 1231
129-   hdl= dlopen(dll_name, RTLD_LAZY | RTLD_GLOBAL);
130+   IF_DEBUG(linker,
131+      debugBelch("internal_dlopen: dll_name = '%s'\n", dll_name));
132 
133hunk ./rts/Linker.c 1234
134+   //-------------- Begin critical section ------------------
135+   // This critical section is necessary because dlerror() is not
136+   // required to be reentrant (see POSIX -- IEEE Std 1003.1-2008)
137+   // Also, the error message returned must be copied to preserve it
138+   // (see POSIX also)
139+
140+   ACQUIRE_LOCK(&dl_mutex);
141+   hdl = dlopen(dll_name, RTLD_LAZY | RTLD_GLOBAL);
142+
143+   errmsg = NULL;
144    if (hdl == NULL) {
145       /* dlopen failed; return a ptr to the error msg. */
146       errmsg = dlerror();
147hunk ./rts/Linker.c 1248
148       if (errmsg == NULL) errmsg = "addDLL: unknown error";
149-      return errmsg;
150-   } else {
151+      errmsg_copy = stgMallocBytes(strlen(errmsg)+1, "addDLL");
152+      strcpy(errmsg_copy, errmsg);
153+      errmsg = errmsg_copy;
154+   }
155+   RELEASE_LOCK(&dl_mutex);
156+   //--------------- End critical section -------------------
157+
158+   return errmsg;
159+}
160+#  endif
161+
162+const char *
163+addDLL( char *dll_name )
164+{
165+#  if defined(OBJFORMAT_ELF) || defined(OBJFORMAT_MACHO)
166+   /* ------------------- ELF DLL loader ------------------- */
167+
168+#define NMATCH 5
169+   regmatch_t match[NMATCH];
170+   char *errmsg;
171+   FILE* fp;
172+   size_t match_length;
173+#define MAXLINE 1000
174+   char line[MAXLINE];
175+   int result;
176+
177+   initLinker();
178+
179+   IF_DEBUG(linker, debugBelch("addDLL: dll_name = '%s'\n", dll_name));
180+   errmsg = internal_dlopen(dll_name);
181+
182+   if (errmsg == NULL) {
183       return NULL;
184    }
185hunk ./rts/Linker.c 1282
186-   /*NOTREACHED*/
187+
188+   // GHC Trac ticket #2615
189+   // On some systems (e.g., Gentoo Linux) dynamic files (e.g. libc.so)
190+   // contain linker scripts rather than ELF-format object code. This
191+   // code handles the situation by recognizing the real object code
192+   // file name given in the linker script.
193+   //
194+   // If an "invalid ELF header" error occurs, it is assumed that the
195+   // .so file contains a linker script instead of ELF object code.
196+   // In this case, the code looks for the GROUP ( ... ) linker
197+   // directive. If one is found, the first file name inside the
198+   // parentheses is treated as the name of a dynamic library and the
199+   // code attempts to dlopen that file. If this is also unsuccessful,
200+   // an error message is returned.
201+
202+   // see if the error message is due to an invalid ELF header
203+   IF_DEBUG(linker, debugBelch("errmsg = '%s'\n", errmsg));
204+   result = regexec(&re_invalid, errmsg, (size_t) NMATCH, match, 0);
205+   IF_DEBUG(linker, debugBelch("result = %i\n", result));
206+   if (result == 0) {
207+      // success -- try to read the named file as a linker script
208+      match_length = (size_t) stg_min((match[1].rm_eo - match[1].rm_so),
209+                                MAXLINE-1);
210+      strncpy(line, (errmsg+(match[1].rm_so)),match_length);
211+      line[match_length] = '\0'; // make sure string is null-terminated
212+      IF_DEBUG(linker, debugBelch ("file name = '%s'\n", line));
213+      if ((fp = fopen(line, "r")) == NULL) {
214+        return errmsg; // return original error if open fails
215+      }
216+      // try to find a GROUP ( ... ) command
217+      while (fgets(line, MAXLINE, fp) != NULL) {
218+        IF_DEBUG(linker, debugBelch("input line = %s", line));
219+        if (regexec(&re_realso, line, (size_t) NMATCH, match, 0) == 0) {
220+            // success -- try to dlopen the first named file
221+            IF_DEBUG(linker, debugBelch("match%s\n",""));
222+           line[match[1].rm_eo] = '\0';
223+           errmsg = internal_dlopen(line+match[1].rm_so);
224+           break;
225+        }
226+        // if control reaches here, no GROUP ( ... ) directive was found
227+        // and the original error message is returned to the caller
228+      }
229+      fclose(fp);
230+   }
231+   return errmsg;
232 
233 #  elif defined(OBJFORMAT_PEi386)
234    /* ------------------- Win32 DLL loader ------------------- */
235hunk ./rts/Linker.c 4317
236                         i++;
237                     }
238  #endif
239-                    else
240+                    else
241                     {
242                        barf ("Don't know how to handle this Mach-O "
243                              "scattered relocation entry: "
244hunk ./rts/Linker.c 4326
245                               oc->fileName, scat->r_type, scat->r_address);
246                         return 0;
247                      }
248-                     
249+
250 #ifdef powerpc_HOST_ARCH
251                     if(scat->r_type == GENERIC_RELOC_VANILLA
252                         || scat->r_type == PPC_RELOC_SECTDIFF)
253hunk ./rts/Linker.c 4372
254                      "object file %s; entry type %ld; address %#lx\n",
255                      oc->fileName, scat->r_type, scat->r_address);
256                return 0;
257-            }
258-     
259+           }
260+
261        }
262        else /* !(relocs[i].r_address & R_SCATTERED) */
263        {
264hunk ./rts/LinkerInternals.h 112
265 
266 extern ObjectCode *objects;
267 
268+void exitLinker( void );
269+
270 #endif /* LINKERINTERNALS_H */
271hunk ./rts/RtsStartup.c 37
272 #include "Profiling.h"
273 #include "Timer.h"
274 #include "Globals.h"
275+void exitLinker( void );       // there is no Linker.h file to include
276 
277 #if defined(RTS_GTK_FRONTPANEL)
278 #include "FrontPanel.h"
279hunk ./rts/RtsStartup.c 392
280     /* free shared Typeable store */
281     exitGlobalStore();
282 
283+    /* free linker data */
284+    exitLinker();
285+
286     /* free file locking tables, if necessary */
287 #if !defined(mingw32_HOST_OS)   
288     freeFileLocking();
289}
290
291Context:
292
293[Add a size-comparison util
294Ian Lynagh <[email protected]>**20091215202636]
295[Just make C dependencies once, rather than each way
296Ian Lynagh <[email protected]>**20091215135350
297 This makes generating C dependencies for the RTS take 3 seconds, rather
298 than 30.
299]
300[Make addCFileDeps quieter
301Ian Lynagh <[email protected]>**20091215134033
302 Move a comment out of the definition, so it doesn't get printed as
303 a shell command every time we call the definition
304]
305[Don't make C deps for compiler/parser/cutils.c in stage1
306Ian Lynagh <[email protected]>**20091215123757
307 CPP finds the Rts.h, RtsFlags.h etc from the tree, rather than the
308 bootstrapping compiler, and then fails because it doesn't think
309 RtsFlags.h should be used any more.
310]
311[Tidy up computation of result discounts in CoreUnfold
312[email protected]**20091214134647
313 Ignore-this: 351076027f8e9cb8aa44db6d60798c47
314 
315 Mostly this patch is a tidy-up, but it did reveal one inconsistency
316 that I fixed.  When computing result discounts for case expressions,
317 we were *adding* result-discounts for cases on non-arguments, but
318 *picking the one for the max-size branch* for arguments. I think you
319 could argue the toss, but it seems neater (and the code is nicer)
320 to be consistent (ie always add).  See Note [addAltSize result discounts].
321 
322 The nofib results seem fine
323 
324         Program           Size    Allocs   Runtime   Elapsed
325 --------------------------------------------------------------------------------
326           boyer          -0.8%     -4.8%      0.06      0.07
327          sphere          -0.7%     -2.5%      0.15      0.16
328 --------------------------------------------------------------------------------
329             Min          -0.8%     -4.8%    -19.1%    -24.8%
330             Max          -0.5%     +0.0%     +3.4%   +127.1%
331  Geometric Mean          -0.7%     -0.1%     -4.3%     -1.3%
332 
333 The +127% elapsed is a timing error; I re-ran the same binary and it's
334 unchanged from the baseline.
335]
336[Use full equality for CSE
337[email protected]**20091211173920
338 Ignore-this: c6d73febf652aa34dc1197a49e599ee
339 
340 In CSE we were getting lots of apprarently-unequal expressions with
341 the same hash code.  In fact they were perfectly equal -- but we were
342 using a cheap-and-cheerful equality tests for CoreExpr that said False
343 for any lambda expression!
344 
345 This patch adds a proper equality test for Core, with alpha-renaming.
346 It's easy to do, and will avoid silly cases of CSE failing to fire.
347 
348 We should get less of this:
349   WARNING: file compiler/simplCore/CSE.lhs line 326
350   extendCSEnv: long list, length 18
351 from a compiler built with -DDEBUG
352]
353[Improve strictness analysis for bottoming functions
354[email protected]**20091211162324
355 Ignore-this: dd5ef03a1b4728c25a2333f59024dc9c
356 
357 I found the following results from strictness analyis:
358   f x = error (fst x)      -- Strictness U(SA)b
359   g x = error ('y':fst x)  -- Strictness Tb
360 
361 Surely 'g' is no less strict on 'x' than 'f' is!  The fix turned out
362 be to very nice and simple.  See Note [Bottom demands] in DmdAnal.
363]
364[Bottom extraction: float out bottoming expressions to top level
365[email protected]**20091211161928
366 Ignore-this: a1a96b36dc982d83f5c01a4259518b
367   
368 The idea is to float out bottoming expressions to top level,
369 abstracting them over any variables they mention, if necessary.  This
370 is good because it makes functions smaller (and more likely to
371 inline), by keeping error code out of line.
372 
373 See Note [Bottoming floats] in SetLevels.
374 
375 On the way, this fixes the HPC failures for cg059 and friends.
376 
377 I've been meaning to do this for some time.  See Maessen's paper 1999
378 "Bottom extraction: factoring error handling out of functional
379 programs" (unpublished I think).
380 
381 Here are the nofib results:
382 
383 
384         Program           Size    Allocs   Runtime   Elapsed
385 --------------------------------------------------------------------------------
386             Min          +0.1%     -7.8%    -14.4%    -32.5%
387             Max          +0.5%     +0.2%     +1.6%    +13.8%
388  Geometric Mean          +0.4%     -0.2%     -4.9%     -6.7%
389 
390 Module sizes
391         -1 s.d.                -----           -2.6%
392         +1 s.d.                -----           +2.3%
393         Average                -----           -0.2%
394 
395 Compile times:
396         -1 s.d.                -----          -11.4%
397         +1 s.d.                -----           +4.3%
398         Average                -----           -3.8%
399 
400 I'm think program sizes have crept up because the base library
401 is bigger -- module sizes in nofib decrease very slightly.  In turn
402 I think that may be because the floating generates a call where
403 there was no call before.  Anyway I think it's acceptable.
404 
405 
406 The main changes are:
407 
408 * SetLevels floats out things that exprBotStrictness_maybe
409   identifies as bottom.  Make sure to pin on the right
410   strictness info to the newly created Ids, so that the
411   info ends up in interface files.
412 
413   Since FloatOut is run twice, we have to be careful that we
414   don't treat the function created by the first float-out as
415   a candidate for the second; this is what worthFloating does.
416 
417   See SetLevels Note [Bottoming floats]
418                 Note [Bottoming floats: eta expansion]
419 
420 * Be careful not to inline top-level bottoming functions; this
421   would just undo what the floating transformation achieves.
422   See CoreUnfold Note [Do not inline top-level bottoming functions
423 
424   Ensuring this requires a bit of extra plumbing, but nothing drastic..
425 
426 * Similarly pre/postInlineUnconditionally should be
427   careful not to re-inline top-level bottoming things!
428   See SimplUtils Note [Top-level botomming Ids]
429                  Note [Top level and postInlineUnconditionally]
430]
431[Expose all EventLog events as DTrace probes
432Manuel M T Chakravarty <[email protected]>**20091212100809
433 Ignore-this: 2c5ef30b1ff7fb2ea5fba8cf0a187d45
434 - Defines a DTrace provider, called 'HaskellEvent', that provides a probe
435   for every event of the eventlog framework.
436 - In contrast to the original eventlog, the DTrace probes are available in
437   all flavours of the runtime system (DTrace probes have virtually no
438   overhead if not enabled); when -DTRACING is defined both the regular
439   event log as well as DTrace probes can be used.
440 - Currently, Mac OS X only.  User-space DTrace probes are implemented
441   differently on Mac OS X than in the original DTrace implementation.
442   Nevertheless, it shouldn't be too hard to enable these probes on other
443   platforms, too.
444 - Documentation is at http://hackage.haskell.org/trac/ghc/wiki/DTrace
445]
446[Fix two related bugs in u_tys
447[email protected]**20091211120122
448 Ignore-this: 25e826e0915c6f6267cadff96f1d7ca6
449 
450 When we normalise a type family application we must recursively call
451 uTys, *not* 'go', because the latter loop is only there to look
452 through type synonyms.  This bug made the type checker generate
453 ill-typed coercions, which were rejected by Core Lint.
454 
455 A related bug only affects the size of coercions.  If faced with
456   (m a) ~ (F b c)
457 where F has arity 1, we want to decompose to
458    m ~ F Int,  a ~ c
459 rather than deferring.  The application decomposition was being
460 tried last, so we were missing this opportunity.
461 
462 Thanks to Roman for an example that showed all this up.
463]
464[Fix spelling in comment
465[email protected]**20091211115744
466 Ignore-this: bd02fc0eb67efc7404536f1ee96d4d1f
467]
468[Make -ddump-simpl-stats a bit more informative by default
469[email protected]**20091208175445
470 Ignore-this: 1bbe3f4c4b727a3b1580236c1f9c2583
471 
472 This mades -ddump-simpl-stats print out per-rule and per-id
473 information by default, rather than requiring -dppr-debug.
474 On the whole that is what you want.  The -dppr-debug flag
475 now just controls printing of the log.
476]
477[Improve dumping for rules, and documentation of same
478[email protected]**20091208105556
479 Ignore-this: 4b09e56f953d130d5cb2807cf9da7303
480 
481 Inspired by Trac #3703
482]
483[Fix #3741, simplifying things in the process
484Simon Marlow <[email protected]>**20091210160909
485 Ignore-this: 8a668af4eb9e1aa71b4764b84f148dac
486 The problem in #3741 was that we had confused column numbers with byte
487 offsets, which fails in the case of UTF-8 (amongst other things).
488 Fortunately we're tracking correct column offsets now, so we didn't
489 have to make a calculation based on a byte offset.  I got rid of two
490 fields from the PState (last_line_len and last_offs).and one field
491 from the AI (alex input) constructor.
492]
493[Allow spaces at either end of the C import spec (#3742)
494Simon Marlow <[email protected]>**20091210124537
495 Ignore-this: 840424ea49d5e81ab8f8ce3209d5eedf
496]
497[Put README and INSTALL into bindists
498Ian Lynagh <[email protected]>**20091209174305
499 Also tidied up the way configure.ac gets into bindists
500]
501[Fix typo
502Ian Lynagh <[email protected]>**20091209152223]
503[Fix the stage1 version number munging
504Ian Lynagh <[email protected]>**20091209151715
505 It was munging 6.12.1 into 62
506]
507[Add a comment about why $(CPP) is defined the way it is in config.mk.in
508Ian Lynagh <[email protected]>**20091209131917]
509[add a missing unlockTSO()
510Simon Marlow <[email protected]>**20091209124113
511 Ignore-this: 9ff0aedcb6d62e5b4bd2fab30bfce105
512]
513[Eliminate mkdependC
514Ian Lynagh <[email protected]>**20091209123929
515 We now just call gcc to get the dependencies directly
516]
517[Change some HC_OPTS to CC_OPTS, so they are used when making dependencies
518Ian Lynagh <[email protected]>**20091208200315]
519[Add -Iincludes to hp2ps's CC_OPTS
520Ian Lynagh <[email protected]>**20091208175718
521 Making C deps for hp2ps always failed, but we used to carry on regardless
522]
523[add locking in mkWeakForeignEnv#
524Simon Marlow <[email protected]>**20091208101229
525 Ignore-this: 3902631687fc252c0e6794d58641371b
526]
527[declare g0 (fixes compilation failure with -fvia-C)
528Simon Marlow <[email protected]>**20091208100925]
529[simplify weak pointer processing
530Simon Marlow <[email protected]>**20091208094822
531 Ignore-this: d88091b23860eeba6cd971282b05c2e6
532]
533[simplification/optimisation: update tso->bound->tso when scavenging the TSO
534Simon Marlow <[email protected]>**20091208085739
535 Ignore-this: 401e2c67e42de9671191ba9d18c3fcf7
536]
537[threadStackUnderflow: fix recently introduced bug (conc068(threaded1) failure)
538Simon Marlow <[email protected]>**20091207170127
539 Ignore-this: cab7b66b3b1478d44ad5272eeec84004
540 
541 bug introduced by "threadStackUnderflow: put the new TSO on the mut
542 list if necessary"
543]
544[need locking around use of weak_ptr_list in mkWeak#
545Simon Marlow <[email protected]>**20091207145213
546 Ignore-this: 9c7d506c30652de4dd5c47d1989022c1
547]
548[remove global 'total_allocated', seems to be the same as 'GC_tot_alloc'
549Simon Marlow <[email protected]>**20091207115359
550 Ignore-this: d174f167a2be6864bbab672f3d5b7c5
551]
552[Add some explanation about overlapping instances
553[email protected]**20091207153915
554 Ignore-this: 627db39187f0ed8a10fe46e667a849a
555 
556 Trac #3734 suggested addding some extra guidance about
557 incoherence and overlap; now done
558]
559[Tidy up deriving error messages
560[email protected]**20091207130850
561 Ignore-this: 4e134f6b62814ea6f361df7525c25a2d
562 
563 I did this in response to a suggestion in Trac #3702
564]
565[Fix profiling build
566Simon Marlow <[email protected]>**20091207092314
567 Ignore-this: eb397ec713cb7a8f6e56f409e0663ffe
568]
569[Minor refactoring to remove redundant code
570[email protected]**20091207083312
571 Ignore-this: 3203447fa823823ae27565f53d39bd10
572]
573[Fix a nasty (and long-standing) FloatOut performance bug
574[email protected]**20091207083246
575 Ignore-this: a64b98992fa4ced434d1edf0b89842ec
576 
577 The effect was that, in deeply-nested applications, FloatOut would
578 take quadratic time.  A good example was compiling
579     programs/barton-mangler-bug/Expected.hs
580 in which FloatOut had a visible pause of a couple of seconds!
581 Profiling showed that 40% of the entire compile time was being
582 consumbed by the single function partitionByMajorLevel.
583 
584 The bug was that the floating bindings (type FloatBinds) was kept
585 as a list, which was partitioned at each binding site.  In programs
586 with deeply nested lists, such as
587        e1 : e2 : e3 : .... : e5000 : []
588 this led to quadratic behaviour.
589 
590 The solution is to use a proper finite-map representation;
591 see the new definition of FloatBinds near the bottom of FloatOut.
592]
593[Add a new to-do to cmm-notes
594[email protected]**20091207081130
595 Ignore-this: fc835da15dd8a206c2c1bdc6c7053c5b
596]
597[Comments only, principally about IfaceDeclExtras
598[email protected]**20091207081108
599 Ignore-this: 1004303ab0df7802295d67c613c4ab24
600]
601[Comments only, about RULE plumbing
602[email protected]**20091207080442
603 Ignore-this: 1a559744f6ad75e151afbfb2281bceb4
604]
605[Add splitUFM to UniqFM (used in a forthcoming patch)
606[email protected]**20091204160820
607 Ignore-this: 332aa029f25ec3f22e4f195ecd44b40b
608 
609 splitUFM :: Uniquable key => UniqFM elt -> key -> (UniqFM elt, Maybe elt, UniqFM elt)
610    -- Splits a UFM into things less than, equal to, and greater than the key
611]
612[Add lengthBag to Bag (using in forthcoming patch)
613[email protected]**20091204155055
614 Ignore-this: 5af0f45d6b51bc77e54c5cb0e2b1e607
615]
616[Use addToUFM_Acc where appropriate
617[email protected]**20091204155036
618 Ignore-this: 38e768c4a9f00d7870a631a9472e6edc
619 
620 This way of extending a UniqFM has existed for some time, but
621 we weren't really using it.
622 
623 addToUFM_Acc   :: Uniquable key =>
624                              (elt -> elts -> elts)     -- Add to existing
625                           -> (elt -> elts)             -- New element
626                           -> UniqFM elts               -- old
627                           -> key -> elt                -- new
628                           -> UniqFM elts               -- result
629]
630[Add comments to "OPTIONS_GHC -fno-warn-orphans" pragmas
631Ian Lynagh <[email protected]>**20091205165721]
632[Add some missing exports back for GHC package users; fixes trac #3715
633Ian Lynagh <[email protected]>**20091205153532]
634[Add some comments on the alternative layout rule state
635Ian Lynagh <[email protected]>**20091205152039]
636[Tweak layout for alternative layout rule
637Ian Lynagh <[email protected]>**20091203164424]
638[Link all dynamic libraries with the correct install_name on Mac OS/X.
639Ian Lynagh <[email protected]>**20091204143614
640 This is a rerecord of
641     Stephen Blackheath <[email protected]>**20090930222855
642 to avoid conflicts.
643]
644[Document the new -dylib-install-name option in the user's guide.
645Stephen Blackheath <[email protected]>**20091001051637
646 Ignore-this: 568f6ad423f737ccda3a79f2d8efdb97
647]
648[Add -dylib-install-name option to GHC so the install name can be set for dynamic libs on Mac OS/X.
649Stephen Blackheath <[email protected]>**20090930223708
650 Ignore-this: 2323929595c0dc03a2e2ea802477a930
651]
652[Force -fPIC when linking against dynamic libraries on Mac OS/X.
653Stephen Blackheath <[email protected]>**20090928203800
654 Ignore-this: 465433af2349779b510f500dc79768f3
655 Otherwise you get
656 /tmp/ghc7602_0/ghc7602_0.s:207:0:
657    non-relocatable subtraction expression, "___stginit_Lib_dyn" minus "L1x2;4"
658 /tmp/ghc7602_0/ghc7602_0.s:207:0:
659    symbol: "___stginit_Lib_dyn" can't be undefined in a subtraction expression
660]
661[evaluate_large: evaluate large objects to bd->dest rather than gen->to
662Simon Marlow <[email protected]>**20091204111037
663 Ignore-this: 6c77407750d4a6178851aeb79ded20d1
664 This fixes aging of large objects in the new scheme.  Bug found by
665 perf/space_leaks/space_leak_001.  Yay perf regressions tests.
666]
667[Correction to the allocation stats following earlier refactoring
668Simon Marlow <[email protected]>**20091204110839
669 Ignore-this: 7ac497c67706bedd29c79091c100d22f
670]
671[export g0
672Simon Marlow <[email protected]>**20091203165209
673 Ignore-this: 69b5445beb91ac99bb018b9806de90a
674]
675[GC refactoring, remove "steps"
676Simon Marlow <[email protected]>**20091203150728
677 Ignore-this: 5360b8bf30c6847ccb7ffa8c431e81ff
678 
679 The GC had a two-level structure, G generations each of T steps.
680 Steps are for aging within a generation, mostly to avoid premature
681 promotion. 
682 
683 Measurements show that more than 2 steps is almost never worthwhile,
684 and 1 step is usually worse than 2.  In theory fractional steps are
685 possible, so the ideal number of steps is somewhere between 1 and 3.
686 GHC's default has always been 2.
687 
688 We can implement 2 steps quite straightforwardly by having each block
689 point to the generation to which objects in that block should be
690 promoted, so blocks in the nursery point to generation 0, and blocks
691 in gen 0 point to gen 1, and so on.
692 
693 This commit removes the explicit step structures, merging generations
694 with steps, thus simplifying a lot of code.  Performance is
695 unaffected.  The tunable number of steps is now gone, although it may
696 be replaced in the future by a way to tune the aging in generation 0.
697]
698[fix error message on Windows (fixes rtsflags001)
699Simon Marlow <[email protected]>**20091202141135
700 Ignore-this: 239fed52f7f5358b034acd6512d26ef4
701]
702[Fix loading of annotations
703Roman Leshchinskiy <[email protected]>**20091204024259
704 Ignore-this: 5750856feecbf9c6aeebfec012b1a1fd
705 
706 The problem was that we collected all annotations we knew about once when the
707 simplifier started and threaded them through the CoreM monad. If new interface
708 files were loaded during simplification, their annotations would not be
709 visible to the simplifier.
710 
711 Now, we rebuild the annotation list at the start of every simplifier pass that
712 needs it (which is only SpecConstr at the moment). This ensures that we see
713 all annotations that have been loaded so far. This is somewhat similar to how
714 RULES are handled.
715]
716[Add new ForceSpecConstr annotation
717Roman Leshchinskiy <[email protected]>**20091203065455
718 Ignore-this: ca5327f85d9d40c78d95e8bfe3e7fab1
719 
720 Annotating a type with {-# ANN type T ForceSpecConstr #-} makes SpecConstr
721 ignore -fspec-constr-threshold and -fspec-constr-count for recursive functions
722 that have arguments of type T. Such functions will be specialised regardless
723 of their size and there is no upper bound on the number of specialisations
724 that can be generated. This also works if T is embedded in other types such as
725 Maybe T (but not T -> T).
726 
727 T should not be a product type because it could be eliminated by the
728 worker/wrapper transformation. For instance, in
729 
730 data T = T Int Int
731 
732 foo :: T -> Int
733 foo (T m n) = ... foo (T m' n') ...
734 
735 SpecConstr will never see the T because w/w will get rid of it. I'm still
736 thinking about whether fixing this is worthwhile.
737]
738[Generate INLINE pragmas for PA methods
739Roman Leshchinskiy <[email protected]>**20091203031452
740 Ignore-this: 3435044aec2737ba58d269aeff915fbd
741]
742[Add a GHC layout extension to the alternative layout rule
743Ian Lynagh <[email protected]>**20091203155708]
744[Fix HPC column numbers, following the column number changes in GHC
745Ian Lynagh <[email protected]>**20091203135520]
746[Whitespace only
747Ian Lynagh <[email protected]>**20091203132259]
748[Fix column numbers used when highlighting :list output
749Ian Lynagh <[email protected]>**20091203130328]
750[add a missing lock around allocGroup()
751Simon Marlow <[email protected]>**20091203110209
752 Ignore-this: 5898b3de4010e16789b628b004aa77db
753]
754[remove unused cap->in_gc flag
755Simon Marlow <[email protected]>**20091202154240
756 Ignore-this: db2ef6c957c8d32233bbcc344e3c06b6
757]
758[Refactoring only
759Simon Marlow <[email protected]>**20091202123806
760 Ignore-this: 95a93f6e330f2c609c197194412cac75
761]
762[move sanity checking code from Storage.c to Sanity.c
763Simon Marlow <[email protected]>**20091202121141
764 Ignore-this: 216d434c3c3d2250effac22b37bc2b4d
765]
766[stg_ap_0_fast: sanity-check only the topmost frame, not the whole stack
767Simon Marlow <[email protected]>**20091202115109
768 Ignore-this: ad45e07c26aa961913d367d7c53efb75
769 Sanity checking was getting too slow in some cases, this returns it to
770 a constant-factor overhead.
771]
772[Fix profiling build
773Simon Marlow <[email protected]>**20091203085930
774 Ignore-this: ff3de527cbf7703e8bac4a48933cd8ba
775]
776[More work on the simplifier's inlining strategies
777[email protected]**20091202174256
778 Ignore-this: 5840392a95d9a47f37c3074f7394f2c2
779 
780 This patch collects a small raft of related changes
781 
782 * Arrange that during
783      (a) rule matching and
784      (b) uses of exprIsConApp_maybe
785   we "look through" unfoldings only if they are active
786   in the phase. Doing this for (a) required a bit of
787   extra plumbing in the rule matching code, but I think
788   it's worth it.
789 
790   One wrinkle is that even if inlining is off (in the 'gentle'
791   phase of simplification) during rule matching we want to
792   "look through" things with inlinings. 
793    See SimplUtils.activeUnfInRule.
794 
795   This fixes a long-standing bug, where things that were
796   supposed to be (say) NOINLINE, could still be poked into
797   via exprIsConApp_maybe.
798 
799 * In the above cases, also check for (non-rule) loop breakers;
800   we never look through these.  This fixes a bug that could make
801   the simplifier diverge (and did for Roman). 
802   Test = simplCore/should_compile/dfun-loop
803 
804 * Try harder not to choose a DFun as a loop breaker. This is
805   just a small adjustment in the OccurAnal scoring function
806 
807 * In the scoring function in OccurAnal, look at the InlineRule
808   unfolding (if there is one) not the actual RHS, beause the
809   former is what'll be inlined. 
810 
811 * Make the application of any function to dictionary arguments
812   CONLIKE.  Thus (f d1 d2) is CONLIKE. 
813   Encapsulated in CoreUtils.isExpandableApp
814   Reason: see Note [Expandable overloadings] in CoreUtils
815 
816 * Make case expressions seem slightly smaller in CoreUnfold.
817   This reverses an unexpected consequences of charging for
818   alternatives.
819 
820 Refactorings
821 ~~~~~~~~~~~~
822 * Signficantly refactor the data type for Unfolding (again).
823   The result is much nicer. 
824 
825 * Add type synonym BasicTypes.CompilerPhase = Int
826   and use it
827 
828 Many of the files touched by this patch are simply knock-on
829 consequences of these two refactorings.
830]
831[Fix Trac #3100: reifyType
832[email protected]**20091130175204
833 Ignore-this: ad1578c3d2e3da6128cd5052c8b64dc
834 
835 A type without any leading foralls may still have constraints
836    eg:  ?x::Int => Int -> Int
837 
838 But reifyType was failing in this case.
839 
840 Merge to 6.12.
841]
842[Fix Trac #3102: pre-matching polytypes
843[email protected]**20091130174441
844 Ignore-this: 3e3fa97e0de28b005a1aabe9e5542b32
845 
846 When *pre-matching* two types
847      forall a. C1 => t1  ~  forall a. C2 => t2
848 we were matching t1~t2, but totally ignoring C1,C2
849 That's utterly wrong when pre-matching
850        (?p::Int) => String  ~  a
851 because we emerge with a:=String!
852 
853 All this is part of the impredicative story, which is about
854 to go away, but still.
855 
856 Worth merging this to 6.12
857]
858[threadStackUnderflow: put the new TSO on the mut list if necessary
859Simon Marlow <[email protected]>**20091202144549
860 Ignore-this: 839e7ad7893b3d7ea6481030ce7c6fe6
861]
862[don't sanity check the whole stack when switching interp<->compiled
863Simon Marlow <[email protected]>**20091202134121
864 Ignore-this: 999b44d4dd096eceda81dda65f65a2df
865]
866[fix to sanity checking for ThreadRelocated TSOs
867Simon Marlow <[email protected]>**20091202134041
868 Ignore-this: 52364f29041e6909b550956087649220
869]
870[sanity check the top stack frame, not the whole stack
871Simon Marlow <[email protected]>**20091202134020
872 Ignore-this: c4c9b58c13299eecf7ec8cb79e34dc1f
873]
874[Make allocatePinned use local storage, and other refactorings
875Simon Marlow <[email protected]>**20091201160321
876 Ignore-this: ec1334a9a5ec0de2567aa81d74b715ba
877 
878 This is a batch of refactoring to remove some of the GC's global
879 state, as we move towards CPU-local GC. 
880 
881   - allocateLocal() now allocates large objects into the local
882     nursery, rather than taking a global lock and allocating
883     then in gen 0 step 0.
884 
885   - allocatePinned() was still allocating from global storage and
886     taking a lock each time, now it uses local storage.
887     (mallocForeignPtrBytes should be faster with -threaded).
888     
889   - We had a gen 0 step 0, distinct from the nurseries, which are
890     stored in a separate nurseries[] array.  This is slightly strange.
891     I removed the g0s0 global that pointed to gen 0 step 0, and
892     removed all uses of it.  I think now we don't use gen 0 step 0 at
893     all, except possibly when there is only one generation.  Possibly
894     more tidying up is needed here.
895 
896   - I removed the global allocate() function, and renamed
897     allocateLocal() to allocate().
898 
899   - the alloc_blocks global is gone.  MAYBE_GC() and
900     doYouWantToGC() now check the local nursery only.
901]
902[Free full_prog_argv at exit, closing a memory leak
903Simon Marlow <[email protected]>**20091201122801
904 Ignore-this: 8fdb41e09bfc318821c427d2f22af737
905]
906[free cap->saved_mut_lists too
907Simon Marlow <[email protected]>**20091201113448
908 Ignore-this: 973e1de140e104c126fe4a213791ba86
909 fixes some memory leakage at shutdown
910]
911[exitScheduler: move boundTaskExiting call outside #ifdef THREADED_RTS
912Simon Marlow <[email protected]>**20091201113352
913 Ignore-this: d913df43b14054f73c0fa06d0205952c
914 Fixes a little leaked memory at shutdown in non-threaded RTS
915]
916[Use dlltool from the in-tree mingw installation
917Ian Lynagh <[email protected]>**20091201190544
918 We only use dlltool on Windows, and this way we don't require that
919 the user has it installed.
920]
921[Fix Commentary link in the HACKING file; trac #3706
922Ian Lynagh <[email protected]>**20091201150149]
923[Add an entry fo the ghci command :run to the user guide
924Ian Lynagh <[email protected]>**20091201173339]
925[Fix typo in docs
926Ian Lynagh <[email protected]>**20091201170550]
927[Delay expansion of some makefile variables until they are available
928Ian Lynagh <[email protected]>**20091201133609]
929[Call $(SED) rather than sed
930Ian Lynagh <[email protected]>**20091201131123]
931[Look for sed as gsed first
932Ian Lynagh <[email protected]>**20091201130741
933 Solaris's sed apparently doesn't understand [:space:]
934]
935[Avoid running empty for loops; fixes trac #3683
936Ian Lynagh <[email protected]>**20091201125927
937 Solaris's sh gives
938     /bin/sh: syntax error at line 1: `;' unexpected
939 when faced with something like
940     for x in ; do ...; done
941 Patch from Christian Maeder.
942]
943[Fix PS file generation
944Simon Marlow <[email protected]>**20091201154254
945 Ignore-this: 7b7122208e845b029a8b7215149fd203
946 (the image doesn't work, but at least db2latex doesn't fall over)
947]
948[Implement a new heap-tuning option: -H
949Simon Marlow <[email protected]>**20091130151836
950 Ignore-this: 2089b9dfaf6c095dc0460cef39e9d586
951 
952 -H alone causes the RTS to use a larger nursery, but without exceeding
953 the amount of memory that the application is already using.  It trades
954 off GC time against locality: the default setting is to use a
955 fixed-size 512k nursery, but this is sometimes worse than using a very
956 large nursery despite the worse locality.
957 
958 Not all programs get faster, but some programs that use large heaps do
959 much better with -H.  e.g. this helps a lot with #3061 (binary-trees),
960 though not as much as specifying -H<large>.  Typically using -H<large>
961 is better than plain -H, because the runtime doesn't know ahead of
962 time how much memory you want to use.
963 
964 Should -H be on by default?  I'm not sure, it makes some programs go
965 slower, but others go faster.
966]
967[Store a destination step in the block descriptor
968Simon Marlow <[email protected]>**20091129164251
969 Ignore-this: c406550acfe10141fcc38d3949d67490
970 At the moment, this just saves a memory reference in the GC inner loop
971 (worth a percent or two of GC time).  Later, it will hopefully let me
972 experiment with partial steps, and simplifying the generation/step
973 infrastructure.
974]
975[Fix the prof_scc.png image in the profiling section (#3694)
976Simon Marlow <[email protected]>**20091130132703
977 Ignore-this: 9774bad70187274e3dd283d66703004
978]
979[document 'recache' command in the help output (#3684)
980Simon Marlow <[email protected]>**20091130122040
981 Ignore-this: 95a51f76e66055af27cdfc7b5ad7deb3
982]
983[Check whether the main function is actually exported (#414)
984Simon Marlow <[email protected]>**20091130112327
985 Ignore-this: 1afaa18d8c0c9e1d029531ac9d4865bb
986]
987[Avoid using non-standard GNU tar option --force-local
988Simon Marlow <[email protected]>**20091130112605
989 Ignore-this: ac066722b15eb93e752d4f63391c9e3c
990]
991[Reorder ALL_RTS_LIBS
992Matthias Kilian <[email protected]>**20091115175405
993 Ignore-this: 795cfd5215ec73eea729aa2b3097817e
994 
995 ALL_RTS_LIBS is (ab)used for linking ghc when BootingFromHc=Yes,
996 which needs libHSrtsmain.a before libHSrts.a.
997 
998]
999[Update dependencies
1000Ian Lynagh <[email protected]>**20091129165534]
1001[Follow Cabal changes
1002Ian Lynagh <[email protected]>**20091129165141]
1003[Tweak layout to work with alternative layout rule
1004Ian Lynagh <[email protected]>**20091129163044]
1005[Tweak the alternative layout rule: {} contains commas
1006Ian Lynagh <igloo@earth.li>**20091129155454]
1007[Correct the advanceSrcLoc calculation for tabs
1008Ian Lynagh <igloo@earth.li>**20091129153933
1009 It was off-by-one
1010]
1011[Tweak alternative layout rule
1012Ian Lynagh <igloo@earth.li>**20091129152323]
1013[Make the alternative layout rule cope with file pragmas
1014Ian Lynagh <igloo@earth.li>**20091129145840]
1015[Give more informative error messages
1016Ian Lynagh <igloo@earth.li>**20091129031029
1017 We used to just get
1018     ghc: panic! (the 'impossible' happened)
1019       (GHC version 6.13.20091128 for x86_64-unknown-linux):
1020         too few bytes. Failed reading at byte position 32753
1021 with no indication of what was being parsed.
1022]
1023[Teach advanceSrcLoc about tab characters
1024Ian Lynagh <igloo@earth.li>**20091128151204]
1025[Whitespace only
1026Ian Lynagh <igloo@earth.li>**20091128150731]
1027[Columns now start at 1, as lines already did
1028Ian Lynagh <igloo@earth.li>**20091127224050
1029 Also corrected a couple of line 0's to line 1
1030]
1031[Remove configure tests on tarballs that no longer exist
1032Ian Lynagh <igloo@earth.li>**20091127150101]
1033[Implement non-decreasing do indentation in the alternative layout rule
1034Ian Lynagh <igloo@earth.li>**20091127011932]
1035[add docs for Unicode entities in #2978
1036Simon Marlow <marlowsd@gmail.com>**20091125153649
1037 Ignore-this: f3d1561ef8f55606d9022ab7243e3800
1038]
1039[Apply patch from #2978: add more Unicode syntax
1040Simon Marlow <marlowsd@gmail.com>**20090918130333
1041 Ignore-this: 1393009fdf2383ca43046ba0767a51e0
1042]
1043[Use UTF-8 explicitly for InstalledPackageInfo
1044Simon Marlow <marlowsd@gmail.com>**20091125141730
1045 Ignore-this: 45be1506dd5c3339fb229a44aa958235
1046 So ghc-pkg register/update takes input in UTF-8, and ghc-pkg dump
1047 outputs in UTF-8.  Textual package config files in the package DB are
1048 assumed to be in UTF-8.
1049]
1050[Comments only, esp about RecStmts
1051simonpj@microsoft.com**20091126163241
1052 Ignore-this: 6fb05bd70b1d0cbb55fb01cf1f17ea77
1053]
1054[Fix a bug in alternative layout rule
1055Ian Lynagh <igloo@earth.li>**20091125231901]
1056[Fix a bug in alternative layout
1057Ian Lynagh <igloo@earth.li>**20091125230616
1058 And make the code simpler in the process!
1059]
1060[Bug fix for alternative layout rule
1061Ian Lynagh <igloo@earth.li>**20091125205809]
1062[Tweak alternative layout rule
1063Ian Lynagh <igloo@earth.li>**20091125193854]
1064[Add unboxed parentheses to the alternative layout rule
1065Ian Lynagh <igloo@earth.li>**20091125182421]
1066[Tweak the warning suppression flags used in Lexer
1067Ian Lynagh <igloo@earth.li>**20091125171815]
1068[Implement the alternative layout rule
1069Ian Lynagh <igloo@earth.li>**20091125171656
1070 Caution: Largely untested
1071]
1072[Fix some warning in Lexer
1073Ian Lynagh <igloo@earth.li>**20091124233726]
1074[threadStackOverflow: check whether stack squeezing released some stack (#3677)
1075Simon Marlow <marlowsd@gmail.com>**20091125125917
1076 Ignore-this: d35089eb93f5b367b7d1c445bda79232
1077 
1078 In a stack overflow situation, stack squeezing may reduce the stack
1079 size, but we don't know whether it has been reduced enough for the
1080 stack check to succeed if we try again.  Fortunately stack squeezing
1081 is idempotent, so all we need to do is record whether *any* squeezing
1082 happened.  If we are at the stack's absolute -K limit, and stack
1083 squeezing happened, then we try running the thread again.
1084 
1085 We also want to avoid enlarging the stack if squeezing has already
1086 released some of it.  However, we don't want to get into a
1087 pathalogical situation where a thread has a nearly full stack (near
1088 its current limit, but not near the absolute -K limit), keeps
1089 allocating a little bit, squeezing removes a little bit, and then it
1090 runs again.  So to avoid this, if we squeezed *and* there is still
1091 less than BLOCK_SIZE_W words free, then we enlarge the stack anyway.
1092]
1093[add a comment to TSO_MARKED
1094Simon Marlow <marlowsd@gmail.com>**20091125104954
1095 Ignore-this: 7111281a443533dc453dbf9481dba519
1096]
1097[Pass --no-user-package-conf to ghc-pkg in bindisttest
1098Roman Leshchinskiy <rl@cse.unsw.edu.au>**20091125115953]
1099[Add a note saying what Haddock relies on about Instance.is_dfun
1100David Waern <david.waern@gmail.com>**20091124210308]
1101[Treat () as an enumeration tycon
1102Ian Lynagh <igloo@earth.li>**20091124011313
1103 This fixes deriving Ord (), which previously failed with
1104   ghc-stage1: panic! (the 'impossible' happened)
1105     (GHC version 6.13.20091123 for x86_64-unknown-linux):
1106           TcGenDeriv:mk_FunBind
1107]
1108[Whitespace only
1109Ian Lynagh <igloo@earth.li>**20091124003221]
1110[inline has moved to GHC.Magic
1111Ian Lynagh <igloo@earth.li>**20091123200308]
1112[Use the ghc-perl tarball on Windows, instead of the msys one
1113Ian Lynagh <igloo@earth.li>**20091120153953]
1114[Install perl on Windows
1115Ian Lynagh <igloo@earth.li>**20091120223830]
1116[Remove cprAnalysis directory from hs-source-dirs
1117simonpj@microsoft.com**20091120161911
1118 Ignore-this: e7d3707794979e45b43136137c939af1
1119]
1120[Remove -fasm from mk/validate-settings.mk
1121Ian Lynagh <igloo@earth.li>**20091120125656
1122 Makes it easier to do unregisterised validate runs
1123]
1124[Fix some dependencies in bindists
1125Ian Lynagh <igloo@earth.li>**20091120125342
1126 We can't depend on sources in a bindist, because we don't have the sources.
1127]
1128[Add a rule to allow us to sdist libraries easily
1129Ian Lynagh <igloo@earth.li>**20091119160527]
1130[Check upper/lower bounds on various RTS flags (#3633)
1131Simon Marlow <marlowsd@gmail.com>**20091119142422
1132 Ignore-this: 8cbbb3f0f2c46711967491d5c028a410
1133 
1134 Also, make K mean 1024 rather than 1000, in RTS flags (similarly for M
1135 and G).  The main reason I want to change it is that otherwise this
1136 might be confusing:
1137   
1138 exp3_8: error in RTS option -H4k: size outside allowed range (4096 - 18446744073709551615)
1139 
1140 And I think the original reason for using 1000 instead of 1024,
1141 worries about direct-mapped caches, is not an issue in this context
1142 (even if you can find a direct-mapped cache these days).
1143]
1144[define HS_WORD_MAX
1145Simon Marlow <marlowsd@gmail.com>**20091119140143
1146 Ignore-this: ed27e7c7ac0bd03cddcd745ae7053a74
1147]
1148[Print the prog name in errorBelch() even if prog_argv is not set yet
1149Simon Marlow <marlowsd@gmail.com>**20091119135230
1150 Ignore-this: ec42e7a4f344ebc34befddfc3d74a946
1151 This means we get the prog name in error messages from the flag parser
1152]
1153[Remove dead code
1154Roman Leshchinskiy <rl@cse.unsw.edu.au>**20091112070455
1155 Ignore-this: d30b668cb3c396fe21e5e4cd9b8be151
1156]
1157[Remove the (very) old strictness analyser
1158simonpj@microsoft.com**20091119154347
1159 Ignore-this: 5d49f66b0baad989ca66c53fde8f2d23
1160 
1161 I finally got tired of the #ifdef OLD_STRICTNESS stuff.  I had been
1162 keeping it around in the hope of doing old-to-new comparisions, but
1163 have failed to do so for many years, so I don't think it's going to
1164 happen.  This patch deletes the clutter.
1165]
1166[Make INLINE warning more precise
1167simonpj@microsoft.com**20091119132711
1168 Ignore-this: f1494494f37c5e618e639912ff82a7f5
1169]
1170[Implement -fexpose-all-unfoldings, and fix a non-termination bug
1171simonpj@microsoft.com**20091119125711
1172 Ignore-this: 54d029014659959151d1681842210cde
1173 
1174 The -fexpose-all-unfoldings flag arranges to put unfoldings for *everything*
1175 in the interface file.  Of course,  this makes the file a lot bigger, but
1176 it also makes it complete, and that's great for supercompilation; or indeed
1177 any whole-program work.
1178 
1179 Consequences:
1180   * Interface files need to record loop-breaker-hood.  (Previously,
1181     loop breakers were never exposed, so that info wasn't necessary.)
1182     Hence a small interface file format change.
1183 
1184   * When inlining, must check loop-breaker-hood. (Previously, loop
1185     breakers didn't have an unfolding at all, so no need to check.)
1186 
1187   * Ditto in exprIsConApp_maybe.  Roman actually tripped this bug,
1188     because a DFun, which had an unfolding, was also a loop breaker
1189 
1190   * TidyPgm.tidyIdInfo must be careful to preserve loop-breaker-hood
1191 
1192 So Id.idUnfolding checks for loop-breaker-hood and returns NoUnfolding
1193 if so. When you want the unfolding regardless of loop-breaker-hood,
1194 use Id.realIdUnfolding.
1195 
1196 I have not documented the flag yet, because it's experimental.  Nor
1197 have I tested it thoroughly.  But with the flag off (the normal case)
1198 everything should work.
1199]
1200[Re-implement the binder-swap stuff in OccurAnal
1201simonpj@microsoft.com**20091119124524
1202 Ignore-this: 662ed559e161be958b1eff1a49d750a3
1203 
1204 This is a pretty big patch, but it has a very local effect.
1205 It affects only the binder-swap mechanism in OccurAnal, which
1206 was not working well becuase it's more subtle than I'd realised
1207 (See Note [getProxies is subtle]).  I think this does a much
1208 better job.
1209]
1210[Try harder not to make DFuns into loop breakers
1211simonpj@microsoft.com**20091119124127
1212 Ignore-this: 922d9a2b3406a3dbbfc5a42d1a286e2a
1213 
1214 See Note [DFuns should not be loop breakers]
1215]
1216[Extend the GHCi FAQ slightly
1217simonpj@microsoft.com**20091117132308
1218 Ignore-this: 8257aaf06ff32904a91121a0734d1c4
1219]
1220[Add gnutar to the list of names we use when looking for GNU tar
1221Ian Lynagh <igloo@earth.li>**20091119144927]
1222[Add support for the man page to the new build system
1223Ian Lynagh <igloo@earth.li>**20091119140811]
1224[Refactor case-merging and identical-alternative optimisations
1225simonpj@microsoft.com**20091119123704
1226 Ignore-this: db12d31395ed99c2341cc4d7d5dca1e
1227 
1228 These two optimisations were originally done by SimplUtils.mkCase
1229 *after* all the pieces have been simplified.  Some while ago I
1230 moved them *before*, so they were done by SimplUtils.prepareAlts.
1231 It think the reason was that I couldn't rely on the dead-binder
1232 information on OutIds, and that info is useful in these optimisations.
1233 
1234 However,
1235  (a) Other changes (notably moving case-binder-swap to OccurAnal)
1236      have meant that dead-binder information is accurate in
1237      OutIds
1238 
1239  (b) When there is a cascade of case-merges, they happen in
1240      one sweep if you do it after, but in many sweeps if you
1241      do it before.  Reason: doing it after means you are looking
1242      at nice simplified Core.
1243]
1244[Fix a nasty infelicity in the size computation of CoreUnfold
1245simonpj@microsoft.com**20091119115736
1246 Ignore-this: ecff5289ab14c0df572135bf0b5179d6
1247 
1248 The size computation was treating gigantic case expressions as
1249 practically free, which they really aren't.  It was exacerbated by
1250 recent decisions to charge 0 for naked variables and constructors, so
1251 the RHS of the case might look free too.  A good example was
1252 Foreign.C.Error.errnoToIOError, which hsa lots of join points
1253 that were getting inlined way to vigorously, so we had:
1254 
1255   *** Simplifier Phase 2 [main]:
1256       Result size = 2983
1257   *** Core Linted result of Simplifier mode 2 [main], iteration 1 out of 4:
1258       Result size = 640327
1259   *** Core Linted result of Simplifier mode 2 [main], iteration 2 out of 4:
1260       Result size = 1659
1261 
1262 Notice that gigantic intermediate!
1263 
1264 This patch adds a small charge for each *alternative*.  Of course,
1265 that'll also mean that there's a bit less inling of things involving
1266 case expressions.
1267]
1268[Comments and white space only
1269simonpj@microsoft.com**20091119115122
1270 Ignore-this: dc8f9a72d6d57378d83154877b1d1126
1271]
1272[Fix splitAppTys
1273Roman Leshchinskiy <rl@cse.unsw.edu.au>**20091119102639
1274 Ignore-this: e669950c7d151c8a67910cd4bbac9cd6
1275]
1276[Windows DLLs: Slurp across the actually static version of libffi
1277Ben.Lippmeier@anu.edu.au**20091119000239]
1278[Windows DLLs: Don't rely on stg/DLL.h being included in RtsAPI.h
1279Ben.Lippmeier@anu.edu.au**20091118110548
1280 Ignore-this: 7dce0ede283974d7834fe12af3f71bd5
1281]
1282[Fix warnings about unused imports
1283Ben.Lippmeier@anu.edu.au**20091118110525
1284 Ignore-this: 93841770eadabf5bd3b9f859ca2de7eb
1285]
1286[Windows DLLs: stifle more warnings about auto imported symbols
1287Ben.Lippmeier@anu.edu.au**20091118090105]
1288[Windows DLLs: stifle warnings about symbols being auto imported from DLLs
1289Ben.Lippmeier@anu.edu.au**20091118051526]
1290[Windows DLLs: add #ifdefery to turn off DLL import of libffi when building statically.
1291Ben.Lippmeier@anu.edu.au**20091118043901]
1292[Windows DLLs: disable extra shutdownHaskell() when unloading the RTS DLL
1293Ben.Lippmeier@anu.edu.au**20091117050648]
1294[Windows DLLs: remove dup symbol from def file
1295Ben.Lippmeier@anu.edu.au**20091117043851]
1296[Use opt_PIC not #defined __PIC__ in compiler source.
1297Ben.Lippmeier@anu.edu.au**20091117043716]
1298[Windows DLLs: CHARLIKE_closure and INTLIKE_closure aren't defined in this way.
1299Ben.Lippmeier@anu.edu.au**20091114063240]
1300[If a comment says "Is this correct?", it's not.
1301Ben.Lippmeier@anu.edu.au**20091114063157]
1302[Windows DLLs: gmp is in the integer-gmp package now.
1303Ben.Lippmeier@anu.edu.au**20091114063046]
1304[Use DLL aware runIO_closure instead of base_GHCziTopHandler_runIO_closure directly
1305Ben.Lippmeier@anu.edu.au**20091114061559]
1306[RTS also uses runSparks_closure from base
1307Ben.Lippmeier@anu.edu.au**20091114061445]
1308[Provide extralibs when linking Windows DLLs
1309Ben.Lippmeier@anu.edu.au**20091114061109]
1310[Don't share low valued Int and Char closures with Windows DLLs
1311Ben.Lippmeier@anu.edu.au**20091114060455]
1312[Windows DLLs: use one import lib for each DLL the RTS needs.
1313Ben.Lippmeier@anu.edu.au**20091111014821]
1314[Add autoconf code to locate dlltool on Windows
1315Ben.Lippmeier@anu.edu.au**20091110051257]
1316[Break recursive imports between the RTS and base library on Windows.
1317Ben.Lippmeier@anu.edu.au**20091106062732
1318 
1319 The file rts/win32/libHSbase.def contains a list of all the
1320 symbols from the base library that the RTS needs.
1321 
1322 When building the RTS into a DLL on Windows, we want to link the DLL
1323 for the RTS before we link the DLL for the base library. We use
1324 libHSbase.def to make the "import library" libHSbase.so.a, which
1325 contains stubs for each of the symbols from the base library that
1326 the RTS needs.
1327]
1328[Add the msysCORE*.tar.gz tarball to the list of tarballs we unpack
1329Ian Lynagh <igloo@earth.li>**20091118195523]
1330[Put the libffi files to be installed into a dist directory
1331Ian Lynagh <igloo@earth.li>**20091118150508
1332 This meakes it easier to correctly clean libffi
1333]
1334[Add ghc-tarballs to the list of directories that go into an sdist
1335Ian Lynagh <igloo@earth.li>**20091118131047]
1336[Remove redundant libffi/tarball directory
1337Ian Lynagh <igloo@earth.li>**20091118124102
1338 We now use the tarball in the ghc-tarballs repo
1339]
1340[Fix gen_contents_index on MSYS
1341Ian Lynagh <igloo@earth.li>**20091117223556
1342 On MSYS
1343     sed 's/.*[ \t]//'
1344 wasn't matching
1345     version:<tab>1.0
1346 so I've switched to
1347     's/.*[[:space:]]//'
1348 which works on Linux, cygwin and MSYS.
1349]
1350[include the GHC package docs in a bindist
1351Simon Marlow <marlowsd@gmail.com>**20091117151133
1352 Ignore-this: c4a10221b1a2a4778494018bca7d2169
1353]
1354[exclude some haddock-related rules during BINDIST
1355Simon Marlow <marlowsd@gmail.com>**20091117151123
1356 Ignore-this: 20b4194b26766d6ab701683af520a7d4
1357]
1358[Add an install-docs target that emits a helpful diagnostic (#3662)
1359Simon Marlow <marlowsd@gmail.com>**20091116120137
1360 Ignore-this: 1c5414730614b205c67919f3ea363c00
1361]
1362[fix install_docs dependencies, and add a missing $(INSTALL_DIR)
1363Simon Marlow <marlowsd@gmail.com>**20091116115630
1364 Ignore-this: 21230df54e79f12f61e9c82a0ae02fad
1365]
1366[Tweak to the directory-building rule
1367Simon Marlow <marlowsd@gmail.com>**20091113125719
1368 Ignore-this: b9e1fe6bcbfd4ff56905517f32b646f7
1369 So we don't try to recreate directories just because they are older
1370 than mkdirhier, since mkdirhier won't touch them.
1371]
1372[exprIsHNF should "look through" lets
1373simonpj@microsoft.com**20091117125526
1374 Ignore-this: 3e77d029c0f314c53171f0378939b496
1375 
1376 I can't quite remember when I spotted this, but exprIsHNF (and
1377 similarly exprIsConLike) should ignore enclosing let-bindings,
1378 since they don't affect termination.
1379]
1380[Improvement to typecheck higher-rank rules better
1381simonpj@microsoft.com**20091117125417
1382 Ignore-this: c5791cbe9540376b9ff46e2a6563bcc2
1383 
1384 See Note [Typechecking rules] in TcRules. 
1385 Suggested by Roman
1386]
1387[Apply RULES to simplified arguments
1388simonpj@microsoft.com**20091117104437
1389 Ignore-this: 9a3475a9871f45ffa115dec44e376e3c
1390 
1391 See Note [RULEs apply to simplified arguments] in Simplify.lhs
1392 A knock-on effect is that rules apply *after* we try inlining
1393 (which uses un-simplified arguments), but that seems fine.
1394]
1395[Improvements to pretty-printing of Core
1396simonpj@microsoft.com**20091117103626
1397 Ignore-this: ad386865644b4dbcd98adab409d7c523
1398]
1399[Fix formatting of module deprecation/warning messages
1400Duncan Coutts <duncan@well-typed.com>**20091115155617
1401 Ignore-this: a41444bdda003aee4412eb56a0e7d052
1402 It was accidentally using list syntax. Fixes #3303 again.
1403]
1404[Wibble to comment
1405simonpj@microsoft.com**20091113145944
1406 Ignore-this: 730f7cad452ac96d59ee2e74a855c19d
1407]
1408[TAG 2009-11-15
1409Ian Lynagh <igloo@earth.li>**20091115155059]
1410Patch bundle hash:
14115b13687a609eee34ea95cce387c39642d5e4556a