Ticket #5004: linker-partially-striped-objects-fix.dpatch

File linker-partially-striped-objects-fix.dpatch, 71.9 KB (added by duncan, 2 years ago)

patch for the ghc 7.0.x branch

Line 
11 patch for repository http://darcs.haskell.org/ghc-7.0/ghc:
2
3Thu May 12 17:43:59 BST 2011  Duncan Coutts <duncan@well-typed.com>
4  * Make the GHCi linker handle partially stripped object files (#5004)
5  When you use 'strip --strip-unneeded' on a ELF format .o or .a file, if
6  the object file has no global/exported symbols then 'strip' ends up
7  removing the symbol table entirely. Previously the GHCi linker assumed
8  there would always be exactly one symbol table and exactly one string
9  table. In fact, in ELF object files there is no such limitation, instead
10  each section points to the other sections it needs, in particular
11  relocation sections have a link to the symbol table section they use and
12  symbol table sections have a link to the corresponding string table.
13  So instead of assuming there will always be a global symbol and string
14  table, all we have to do is validate and follow these links. Then, when
15  we encounter an empty object file that has no symbols then we handle it
16  correctly, because since it's empty we never process any relocations and
17  so never have to follow any links to non-existant symbol tables.
18 
19  Also, in the case where an object is fully stripped, we can now detect
20  this more reliably and emit a more helpful error message, e.g:
21 
22  libHSghc-7.1.20110509.a(DsMeta.o): relocation section #2 has no symbol table
23  This object file has probably been fully striped. Such files cannot be linked.
24
25New patches:
26
27[Make the GHCi linker handle partially stripped object files (#5004)
28Duncan Coutts <duncan@well-typed.com>**20110512164359
29 Ignore-this: ebbc16fdc14124e3235199b24a9e63c8
30 When you use 'strip --strip-unneeded' on a ELF format .o or .a file, if
31 the object file has no global/exported symbols then 'strip' ends up
32 removing the symbol table entirely. Previously the GHCi linker assumed
33 there would always be exactly one symbol table and exactly one string
34 table. In fact, in ELF object files there is no such limitation, instead
35 each section points to the other sections it needs, in particular
36 relocation sections have a link to the symbol table section they use and
37 symbol table sections have a link to the corresponding string table.
38 So instead of assuming there will always be a global symbol and string
39 table, all we have to do is validate and follow these links. Then, when
40 we encounter an empty object file that has no symbols then we handle it
41 correctly, because since it's empty we never process any relocations and
42 so never have to follow any links to non-existant symbol tables.
43 
44 Also, in the case where an object is fully stripped, we can now detect
45 this more reliably and emit a more helpful error message, e.g:
46 
47 libHSghc-7.1.20110509.a(DsMeta.o): relocation section #2 has no symbol table
48 This object file has probably been fully striped. Such files cannot be linked.
49] {
50hunk ./rts/Linker.c 2210
51             //  stgFree(oc->image);
52             // #endif
53             stgFree(oc->fileName);
54+            stgFree(oc->archiveMemberName);
55             stgFree(oc->symbols);
56             stgFree(oc->sections);
57             stgFree(oc);
58hunk ./rts/Linker.c 3543
59  * Generic ELF functions
60  */
61 
62-static char *
63-findElfSection ( void* objImage, Elf_Word sh_type )
64-{
65-   char* ehdrC = (char*)objImage;
66-   Elf_Ehdr* ehdr = (Elf_Ehdr*)ehdrC;
67-   Elf_Shdr* shdr = (Elf_Shdr*)(ehdrC + ehdr->e_shoff);
68-   char* sh_strtab = ehdrC + shdr[ehdr->e_shstrndx].sh_offset;
69-   char* ptr = NULL;
70-   int i;
71-
72-   for (i = 0; i < ehdr->e_shnum; i++) {
73-      if (shdr[i].sh_type == sh_type
74-          /* Ignore the section header's string table. */
75-          && i != ehdr->e_shstrndx
76-          /* Ignore string tables named .stabstr, as they contain
77-             debugging info. */
78-          && 0 != memcmp(".stabstr", sh_strtab + shdr[i].sh_name, 8)
79-         ) {
80-         ptr = ehdrC + shdr[i].sh_offset;
81-         break;
82-      }
83-   }
84-   return ptr;
85-}
86-
87 static int
88 ocVerifyImage_ELF ( ObjectCode* oc )
89 {
90hunk ./rts/Linker.c 3550
91    Elf_Sym*  stab;
92    int i, j, nent, nstrtab, nsymtabs;
93    char* sh_strtab;
94-   char* strtab;
95 
96    char*     ehdrC = (char*)(oc->image);
97    Elf_Ehdr* ehdr  = (Elf_Ehdr*)ehdrC;
98hunk ./rts/Linker.c 3631
99                ehdrC + shdr[i].sh_offset,
100                       ehdrC + shdr[i].sh_offset + shdr[i].sh_size - 1));
101 
102-      if (shdr[i].sh_type == SHT_REL) {
103-          IF_DEBUG(linker,debugBelch("Rel  " ));
104-      } else if (shdr[i].sh_type == SHT_RELA) {
105-          IF_DEBUG(linker,debugBelch("RelA " ));
106-      } else {
107-          IF_DEBUG(linker,debugBelch("     "));
108+#define SECTION_INDEX_VALID(ndx) (ndx > SHN_UNDEF && ndx < ehdr->e_shnum)
109+
110+      switch (shdr[i].sh_type) {
111+
112+        case SHT_REL:
113+        case SHT_RELA:
114+          IF_DEBUG(linker,debugBelch( shdr[i].sh_type == SHT_REL ? "Rel  " : "RelA "));
115+
116+          if (!SECTION_INDEX_VALID(shdr[i].sh_link)) {
117+            if (shdr[i].sh_link == SHN_UNDEF)
118+              errorBelch("\n%s: relocation section #%d has no symbol table\n"
119+                         "This object file has probably been fully striped. "
120+                         "Such files cannot be linked.\n",
121+                         oc->archiveMemberName ? oc->archiveMemberName : oc->fileName, i);
122+            else
123+              errorBelch("\n%s: relocation section #%d has an invalid link field (%d)\n",
124+                         oc->archiveMemberName ? oc->archiveMemberName : oc->fileName,
125+                         i, shdr[i].sh_link);
126+            return 0;
127+          }
128+          if (shdr[shdr[i].sh_link].sh_type != SHT_SYMTAB) {
129+            errorBelch("\n%s: relocation section #%d does not link to a symbol table\n",
130+                       oc->archiveMemberName ? oc->archiveMemberName : oc->fileName, i);
131+            return 0;
132+          }
133+          if (!SECTION_INDEX_VALID(shdr[i].sh_info)) {
134+            errorBelch("\n%s: relocation section #%d has an invalid info field (%d)\n",
135+                       oc->archiveMemberName ? oc->archiveMemberName : oc->fileName,
136+                       i, shdr[i].sh_info);
137+            return 0;
138+          }
139+
140+          break;
141+        case SHT_SYMTAB:
142+          IF_DEBUG(linker,debugBelch("Sym  "));
143+
144+          if (!SECTION_INDEX_VALID(shdr[i].sh_link)) {
145+            errorBelch("\n%s: symbol table section #%d has an invalid link field (%d)\n",
146+                       oc->archiveMemberName ? oc->archiveMemberName : oc->fileName,
147+                       i, shdr[i].sh_link);
148+            return 0;
149+          }
150+          if (shdr[shdr[i].sh_link].sh_type != SHT_STRTAB) {
151+            errorBelch("\n%s: symbol table section #%d does not link to a string table\n",
152+                       oc->archiveMemberName ? oc->archiveMemberName : oc->fileName, i);
153+
154+            return 0;
155+          }
156+          break;
157+        case SHT_STRTAB: IF_DEBUG(linker,debugBelch("Str  ")); break;
158+        default:         IF_DEBUG(linker,debugBelch("     ")); break;
159       }
160       if (sh_strtab) {
161           IF_DEBUG(linker,debugBelch("sname=%s\n", sh_strtab + shdr[i].sh_name ));
162hunk ./rts/Linker.c 3688
163       }
164    }
165 
166-   IF_DEBUG(linker,debugBelch( "\nString tables" ));
167-   strtab = NULL;
168+   IF_DEBUG(linker,debugBelch( "\nString tables\n" ));
169    nstrtab = 0;
170    for (i = 0; i < ehdr->e_shnum; i++) {
171       if (shdr[i].sh_type == SHT_STRTAB
172hunk ./rts/Linker.c 3698
173              debugging info. */
174           && 0 != memcmp(".stabstr", sh_strtab + shdr[i].sh_name, 8)
175          ) {
176-         IF_DEBUG(linker,debugBelch("   section %d is a normal string table", i ));
177-         strtab = ehdrC + shdr[i].sh_offset;
178+         IF_DEBUG(linker,debugBelch("   section %d is a normal string table\n", i ));
179          nstrtab++;
180       }
181    }
182hunk ./rts/Linker.c 3702
183-   if (nstrtab != 1) {
184-      errorBelch("%s: no string tables, or too many", oc->fileName);
185-      return 0;
186+   if (nstrtab == 0) {
187+      IF_DEBUG(linker,debugBelch("   no normal string tables (potentially, but not necessarily a problem)\n"));
188    }
189 
190    nsymtabs = 0;
191hunk ./rts/Linker.c 3707
192-   IF_DEBUG(linker,debugBelch( "\nSymbol tables" ));
193+   IF_DEBUG(linker,debugBelch( "Symbol tables\n" ));
194    for (i = 0; i < ehdr->e_shnum; i++) {
195       if (shdr[i].sh_type != SHT_SYMTAB) continue;
196       IF_DEBUG(linker,debugBelch( "section %d is a symbol table\n", i ));
197hunk ./rts/Linker.c 3749
198          }
199          IF_DEBUG(linker,debugBelch("  " ));
200 
201-         IF_DEBUG(linker,debugBelch("name=%s\n", strtab + stab[j].st_name ));
202+         IF_DEBUG(linker,debugBelch("name=%s\n",
203+                        ehdrC + shdr[shdr[i].sh_link].sh_offset
204+                              + stab[j].st_name ));
205       }
206    }
207 
208hunk ./rts/Linker.c 3756
209    if (nsymtabs == 0) {
210-      errorBelch("%s: didn't find any symbol tables", oc->fileName);
211-      return 0;
212+     // Not having a symbol table is not in principle a problem.
213+     // When an object file has no symbols then the 'strip' program
214+     // typically will remove the symbol table entirely.
215+     IF_DEBUG(linker,debugBelch("   no symbol tables (potentially, but not necessarily a problem)\n"));
216    }
217 
218    return 1;
219hunk ./rts/Linker.c 3806
220 
221    char*     ehdrC    = (char*)(oc->image);
222    Elf_Ehdr* ehdr     = (Elf_Ehdr*)ehdrC;
223-   char*     strtab   = findElfSection ( ehdrC, SHT_STRTAB );
224+   char*     strtab;
225    Elf_Shdr* shdr     = (Elf_Shdr*) (ehdrC + ehdr->e_shoff);
226 
227    ASSERT(symhash != NULL);
228hunk ./rts/Linker.c 3811
229 
230-   if (!strtab) {
231-      errorBelch("%s: no strtab", oc->fileName);
232-      return 0;
233-   }
234-
235    k = 0;
236    for (i = 0; i < ehdr->e_shnum; i++) {
237       /* Figure out what kind of section it is.  Logic derived from
238hunk ./rts/Linker.c 3843
239 
240       /* copy stuff into this module's object symbol table */
241       stab = (Elf_Sym*) (ehdrC + shdr[i].sh_offset);
242+      strtab = ehdrC + shdr[shdr[i].sh_link].sh_offset;
243       nent = shdr[i].sh_size / sizeof(Elf_Sym);
244 
245       oc->n_symbols = nent;
246hunk ./rts/Linker.c 3947
247    relocations appear to be of this form. */
248 static int
249 do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC,
250-                         Elf_Shdr* shdr, int shnum,
251-                         Elf_Sym*  stab, char* strtab )
252+                         Elf_Shdr* shdr, int shnum )
253 {
254    int j;
255    char *symbol;
256hunk ./rts/Linker.c 3953
257    Elf_Word* targ;
258    Elf_Rel*  rtab = (Elf_Rel*) (ehdrC + shdr[shnum].sh_offset);
259+   Elf_Sym*  stab;
260+   char*     strtab;
261    int         nent = shdr[shnum].sh_size / sizeof(Elf_Rel);
262    int target_shndx = shdr[shnum].sh_info;
263    int symtab_shndx = shdr[shnum].sh_link;
264hunk ./rts/Linker.c 3958
265+   int strtab_shndx = shdr[symtab_shndx].sh_link;
266 
267    stab  = (Elf_Sym*) (ehdrC + shdr[ symtab_shndx ].sh_offset);
268hunk ./rts/Linker.c 3961
269+   strtab= (char*)    (ehdrC + shdr[ strtab_shndx ].sh_offset);
270    targ  = (Elf_Word*)(ehdrC + shdr[ target_shndx ].sh_offset);
271hunk ./rts/Linker.c 3963
272-   IF_DEBUG(linker,debugBelch( "relocations for section %d using symtab %d\n",
273-                          target_shndx, symtab_shndx ));
274+   IF_DEBUG(linker,debugBelch( "relocations for section %d using symtab %d and strtab %d\n",
275+                          target_shndx, symtab_shndx, strtab_shndx ));
276 
277    /* Skip sections that we're not interested in. */
278    {
279hunk ./rts/Linker.c 4050
280    sparc-solaris relocations appear to be of this form. */
281 static int
282 do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC,
283-                          Elf_Shdr* shdr, int shnum,
284-                          Elf_Sym*  stab, char* strtab )
285+                          Elf_Shdr* shdr, int shnum )
286 {
287    int j;
288    char *symbol = NULL;
289hunk ./rts/Linker.c 4056
290    Elf_Addr targ;
291    Elf_Rela* rtab = (Elf_Rela*) (ehdrC + shdr[shnum].sh_offset);
292+   Elf_Sym*  stab;
293+   char*     strtab;
294    int         nent = shdr[shnum].sh_size / sizeof(Elf_Rela);
295    int target_shndx = shdr[shnum].sh_info;
296    int symtab_shndx = shdr[shnum].sh_link;
297hunk ./rts/Linker.c 4061
298+   int strtab_shndx = shdr[symtab_shndx].sh_link;
299 
300    stab  = (Elf_Sym*) (ehdrC + shdr[ symtab_shndx ].sh_offset);
301hunk ./rts/Linker.c 4064
302+   strtab= (char*)    (ehdrC + shdr[ strtab_shndx ].sh_offset);
303    targ  = (Elf_Addr) (ehdrC + shdr[ target_shndx ].sh_offset);
304    IF_DEBUG(linker,debugBelch( "relocations for section %d using symtab %d\n",
305                           target_shndx, symtab_shndx ));
306hunk ./rts/Linker.c 4333
307 static int
308 ocResolve_ELF ( ObjectCode* oc )
309 {
310-   char *strtab;
311    int   shnum, ok;
312hunk ./rts/Linker.c 4334
313-   Elf_Sym*  stab  = NULL;
314    char*     ehdrC = (char*)(oc->image);
315    Elf_Ehdr* ehdr  = (Elf_Ehdr*) ehdrC;
316    Elf_Shdr* shdr  = (Elf_Shdr*) (ehdrC + ehdr->e_shoff);
317hunk ./rts/Linker.c 4338
318 
319-   /* first find "the" symbol table */
320-   stab = (Elf_Sym*) findElfSection ( ehdrC, SHT_SYMTAB );
321-
322-   /* also go find the string table */
323-   strtab = findElfSection ( ehdrC, SHT_STRTAB );
324-
325-   if (stab == NULL || strtab == NULL) {
326-      errorBelch("%s: can't find string or symbol table", oc->fileName);
327-      return 0;
328-   }
329-
330    /* Process the relocation sections. */
331    for (shnum = 0; shnum < ehdr->e_shnum; shnum++) {
332       if (shdr[shnum].sh_type == SHT_REL) {
333hunk ./rts/Linker.c 4341
334-         ok = do_Elf_Rel_relocations ( oc, ehdrC, shdr,
335-                                       shnum, stab, strtab );
336+         ok = do_Elf_Rel_relocations ( oc, ehdrC, shdr, shnum );
337          if (!ok) return ok;
338       }
339       else
340hunk ./rts/Linker.c 4346
341       if (shdr[shnum].sh_type == SHT_RELA) {
342-         ok = do_Elf_Rela_relocations ( oc, ehdrC, shdr,
343-                                        shnum, stab, strtab );
344+         ok = do_Elf_Rela_relocations ( oc, ehdrC, shdr, shnum );
345          if (!ok) return ok;
346       }
347    }
348hunk ./rts/Linker.c 4379
349 
350   if( i == ehdr->e_shnum )
351   {
352-    errorBelch( "This ELF file contains no symtab" );
353-    return 0;
354+    // Not having a symbol table is not in principle a problem.
355+    // When an object file has no symbols then the 'strip' program
356+    // typically will remove the symbol table entirely.
357+    IF_DEBUG(linker, debugBelch( "The ELF file %s contains no symtab\n",
358+             oc->archiveMemberName ? oc->archiveMemberName : oc->fileName ));
359+    return 1;
360   }
361 
362   if( shdr[i].sh_entsize != sizeof( Elf_Sym ) )
363}
364
365Context:
366
367[TAG GHC 7.0.3 release
368Ian Lynagh <igloo@earth.li>**20110330192940
369 Ignore-this: 47c50101fdaf792e63a500337d06dd53
370]
371[Set RELEASE back to NO
372Ian Lynagh <igloo@earth.li>**20110327114744
373 Ignore-this: 7dcded4ef11a6bfb890c65a5c1532e0d
374]
375[Set RELEASE back to YES
376Ian Lynagh <igloo@earth.li>**20110325170950
377 Ignore-this: 1301c9113d6d510a9f263d2e9321cd95
378]
379[Add #4914 to release notes
380Ian Lynagh <igloo@earth.li>**20110325170935
381 Ignore-this: 1679db9aa93280140a4efaaf9135db18
382]
383[Fix #4914 (I hope)
384Simon Marlow <marlowsd@gmail.com>**20110325161234
385 Ignore-this: 86d3f17a6811d78b3dfda18f43d7160d
386 
387 Here's a bit of erroneous code:
388 
389 00000c5c <s1ad_info>:
390      c5c:       8b 45 08                mov    0x8(%ebp),%eax
391      c5f:       d9 46 03                flds   0x3(%esi)
392      c62:       dd d9                   fstp   %st(1)
393      c64:       d9 55 08                fsts   0x8(%ebp)
394      c67:       89 c6                   mov    %eax,%esi
395      c69:       c7 45 00 24 0c 00 00    movl   $0xc24,0x0(%ebp)
396      c70:       f7 c6 03 00 00 00       test   $0x3,%esi
397      c76:       75 ac                   jne    c24 <s1ac_info>
398 
399 So we should be doing some ffrees before the jne.  The code that
400 inserts the ffrees wasn't expecting to do it for a conditional jump,
401 because they are usually local, but we have a late optimisation that
402 shortcuts jumps-to-jumps, and that can result in a non-local
403 conditional jump.
404 
405 This at least fixes an instance of the bug that I was able to
406 reproduce, let's hope there aren't any more.
407]
408[Set RELEASE back to NO
409Ian Lynagh <igloo@earth.li>**20110325141148
410 Ignore-this: 5e0cd56b287234886d1876f0047ce3d3
411]
412[Fix OSTYPE test
413Ian Lynagh <igloo@earth.li>**20110120000308
414 Ignore-this: 8fa5d5c03297cb507a166bd85675145c
415]
416[Bump versino to 7.0.3 and set RELEASE to YES
417Ian Lynagh <igloo@earth.li>**20110322212641]
418[Add release notes for 7.0.3
419Ian Lynagh <igloo@earth.li>**20110322212619]
420[Update ANNOUNCE for 7.0.3
421Ian Lynagh <igloo@earth.li>**20110322211020]
422[Change how we compute install paths on cygwin
423Ian Lynagh <igloo@earth.li>**20110320012540
424 We used to have
425     MK_INSTALL_DEST = "$(shell cygpath $1)"
426 but this meant we ended up with
427     "$(shell cygpath "[...]/html/`basename $$i`")"
428 and the $(...) gets evaluated before the makefile rule, so the for loop
429 hasn't been run, and so $i isn't defined. So we were taking the basename
430 of the empty string, meaning docs weren't being installed in the right
431 place.
432 
433 Now we have
434     MK_INSTALL_DEST = $$(cygpath $1)
435 so the evaluation happens in the shell, while the for loop is running.
436]
437[Add OSTYPE build-system variable, and use it
438simonpj@microsoft.com**20110113155023
439 Ignore-this: c4a75f0bb27a680924e57ca7075ec116
440 
441 The use is in install.mk.in, where we need to know when
442 we're on Cygwin.
443 
444 This fixes the build on my Windows box, where I have
445 both Msys and Cygwin.
446]
447[Don't use read_only_relocs on darwin x86-64; fixes #4984
448William Knop <william.knop.nospam@gmail.com>**20110309201911
449 Ignore-this: 2e2d90673fc6b32d0978cd9ac5b59905
450]
451[Don't put includes/rts/Config.h in bindists twice
452Ian Lynagh <igloo@earth.li>**20110316190117
453 Ignore-this: b2d37c44557a84ae87675e795de209c
454]
455[Don't put 2 copies of the RTS libraries in the bindists
456Ian Lynagh <igloo@earth.li>**20110316172945]
457[Impredicative polymorphism no longer deprecated.
458Edward Z. Yang <ezyang@mit.edu>**20110306215916
459 Ignore-this: 49157eaae716879effb99c2638518265
460]
461[Consistently use <sect1> etc rather than <section>; fixes #5009
462Ian Lynagh <igloo@earth.li>**20110311212958
463 It might be nicer to actually go the other way, and make everything
464 use <section> instead, but this fixes the incorrect numbering for
465 now, and we can look into whether <section> has any disadvantages
466 later.
467]
468[LLVM: Fix #4995, llvm mangler broken for large compiles
469David Terei <davidterei@gmail.com>**20110309215346
470 Ignore-this: 4fcef11ad0be0cff26c108bd05db0485
471]
472[Write the XCode version test differently
473Ian Lynagh <igloo@earth.li>**20110313134913
474 Using && causes problems on opensolaris, for an unknown reason.
475 http://www.haskell.org/pipermail/cvs-ghc/2011-March/060314.html
476]
477[Improve the XCode version detection
478Ian Lynagh <igloo@earth.li>**20110307225823
479 Amongst other improvements, we now handle 3-component versions
480 (like "3.1.4") correctly.
481]
482[Turn off split objects on Darwin if XCode < 3.2 (#4013)
483Ian Lynagh <igloo@earth.li>**20110225184358
484 Ignore-this: 3e894673649fee957df2413ca82b1c99
485]
486[Reenable object splitting on Darwin, now #4013 appears to be fixed
487Ian Lynagh <igloo@earth.li>**20110219191409
488 Ignore-this: e39e46beab8c8f2dc3369d5ec98610f2
489]
490[Stop explicitly asking for 10.5 support on OS X; fixes #5011
491Ian Lynagh <igloo@earth.li>**20110313140322
492 XCode 4 doesn't include the 10.5 SDK, so if we explicitly ask for it
493 then linking fails.
494]
495[TAG GHC 7.0.2 release
496Ian Lynagh <igloo@earth.li>**20110303150235
497 Ignore-this: cef1c9db7cc8e3364ff0d50d85d68f99
498]
499[Set RELEASE back to NO
500Ian Lynagh <igloo@earth.li>**20110303014713
501 Ignore-this: 250a5d5cb5e548a90be368fdf8339663
502]
503[Set version to 7.0.2 and RELEASE to YES
504Ian Lynagh <igloo@earth.li>**20110228160331
505 Ignore-this: 837167f8f02752d56ffbb5e6dcb16f6c
506]
507[Re-enable SPECIALISE INSTANCE pragmas
508simonpj@microsoft.com**20110224174744
509 Ignore-this: 7dda31a2d9ffebfd3e8c1b038d767745
510 
511 This mirror a similar patch in HEAD. Lacking it was responsible
512 for signficant performance regressions in numeric operations on
513 Rationals.
514]
515[libffi: backport incorrect detection of selinux
516Sergei Trofimovich <slyfox@community.haskell.org>**20110208212140
517 Ignore-this: 31bdddb5683acae2bffa3e97effaefea
518 
519 This patch unbreaks ghci on GRSEC kernels hardened with
520 TPE (Trusted Path Execution) protection.
521 
522 TPE forbids mmap('rwx') files opened for writes:
523     fd = open (a_file_in_tmp, O_RDWR);
524     mmap (...,               PROT_READ | PROT_WRITE | PROT_EXEC, fd);
525 
526 while allows anonymous RWX mappings:
527     mmap (...MAP_ANONYMOUS , PROT_READ | PROT_WRITE | PROT_EXEC, -1);
528 
529 Thanks to klondike for finding it out.
530 
531 The result of a horrible typo.
532 
533 (unreleased yet) upstream also has the patch:
534 
535 http://github.com/atgreen/libffi/commit/eaf444eabc4c78703c0f98ac0197b1619c1b1bef
536]
537[Generate the OS X installer from a bindist, rather than from a source tree
538Ian Lynagh <igloo@earth.li>**20110223170016]
539[Fix another fundep error (fixes Trac #4969)
540simonpj@microsoft.com**20110221153239
541 Ignore-this: 9308a7c55346c9eaeaa0818903c8d67b
542 
543 If I had a pound for every hour Dimitrios and I have spent
544 making functional dependencies work right, we'd be rich!
545 
546 We had stupidly caused a 'wanted' to be rewritten by a 'derived', with
547 resulting abject failure.  As well as fixing the bug, this patch
548 refactors some more, adds useful assert and comments.
549]
550[Use -h rather than -soname; fixes dynlibs on Solaris 10; trac #4973
551Ian Lynagh <igloo@earth.li>**20110222152656]
552[Fix #4867 (updated; corrects address calculation)
553gwright@antiope.com**20110214150924
554 Ignore-this: b68bcf1262f3507e1b9a7459139054bc
555 
556 This is a corrected fix for ticket #4867, "ghci displays negative floats
557 incorrectly".  The previous patch sometimes gave incorrect offset to values
558 in the __const section of the __TEXT segment.  The new patch arranges a zero
559 fixup for non-external, not-global offset table signed relocations.  This
560 is apparently what is required, though documentation on this point is scarce.
561 
562 With this change Doubles are negated properly, because the sign bit mask
563 is loaded from the correct offset.  This was tested both on HEAD and the 7.0
564 branch.
565 
566]
567[Fix Trac #4966
568simonpj@microsoft.com**20110217141000
569 Ignore-this: d4caaf910dfb86b1e469c5da3fe9cde2
570 
571 This is just a program that exploits overlapping
572 instances in a delicate way. The fix makes GHC
573 a bit more friendly towards such programs.
574 
575 See Note [Overlap and deriving] in TcSimplify
576]
577[Use "on the spot" solving for fundeps
578simonpj@microsoft.com**20110217140921
579 Ignore-this: 99290ef5538819053af708f5f9464488
580 
581 When we spot an equality arising from a functional dependency,
582 we now use that equality (a "wanted") to rewrite the work-item
583 constraint right away.  This avoids two dangers
584 
585  Danger 1: If we send the original constraint on down the pipeline
586            it may react with an instance declaration, and in delicate
587           situations (when a Given overlaps with an instance) that
588           may produce new insoluble goals: see Trac #4952
589 
590  Danger 2: If we don't rewrite the constraint, it may re-react
591            with the same thing later, and produce the same equality
592            again --> termination worries.
593 
594 To achieve this required some refactoring of FunDeps.lhs (nicer
595 now!). 
596 
597 This patch also contains a couple of unrelated improvements
598 
599 * A bad bug in TcSMonad.nestImplicTcS whereby the Tcs tyvars
600   of an outer implication were not untouchable inside
601 
602 * Improved logging machinery for the type constraint solver;
603   use -ddump-cs-trace (probably with a wider default line width
604   -dppr-cols=200 or something)
605]
606[makeSolvedByInst is only called on wanteds
607simonpj@microsoft.com**20110211173415
608 Ignore-this: 36e6201ab59a082e6dc38e56bea99e29
609 
610 This patch just adds an assert error.
611]
612[Make exprIsCheap/exprIsExpandable understand about casts
613simonpj@microsoft.com**20110215120228
614 Ignore-this: 6d471f931a58896fb41131c513271ace
615 
616 This bug was causing arity lossage and lint errors
617]
618[Add a simple arity analyser
619simonpj@microsoft.com**20101221165800
620 Ignore-this: d5f3a9f56404d61bb7f374c875b42c49
621 
622 I've wanted to do this for ages, but never gotten around to
623 it.  The main notes are in Note [Arity analysis] in SimplUtils.
624 
625 The motivating example for arity analysis is this:
626 
627   f = \x. let g = f (x+1)
628           in \y. ...g...
629 
630 What arity does f have?  Really it should have arity 2, but a naive
631 look at the RHS won't see that.  You need a fixpoint analysis which
632 says it has arity "infinity" the first time round.
633 
634 This makes things more robust to the way in which you write code.  For
635 example, see Trac #4474 which is fixed by this change.
636 
637 Not a huge difference, but worth while:
638 
639         Program           Size    Allocs   Runtime   Elapsed
640 --------------------------------------------------------------------------------
641             Min          -0.4%     -2.2%    -10.0%    -10.0%
642             Max          +2.7%     +0.3%     +7.1%     +6.9%
643  Geometric Mean          -0.3%     -0.2%     -2.1%     -2.2%
644 
645 I don't really believe the runtime numbers, because the machine was
646 busy, but the bottom line is that not much changes, and what does
647 change reliably (allocation and size) is in the right direction.
648]
649[Just moving comments around
650simonpj@microsoft.com**20100924155600
651 Ignore-this: 96635b8e8c9d88b50d82938568152ef8
652]
653[Yet another go at CoreArity
654simonpj@microsoft.com**20101027185630
655 Ignore-this: 400f04c4c7b6999567410081c672b081
656 
657 Amazingly, there were still Wrong Things in the arity analysis,
658 exposed by my fiddling with eta expansion.
659 
660 I simplified the code, clarified the comments, added more examples,
661 and tidied it all up.  I hope it's better this time.
662]
663[Release note updates
664Ian Lynagh <igloo@earth.li>**20110215160114]
665[add missing initialisation of ws->todo_large_objects
666Simon Marlow <marlowsd@gmail.com>**20110204093148
667 Ignore-this: dc9a28f85aff97e0896d212d7b21ae30
668 Found-by: Valgrind.  Thanks Julian!
669]
670[Fix small but egregious error: using un-zonked constraints in simplifyRule
671simonpj@microsoft.com**20110211173835
672 Ignore-this: 238586e420dbbb1be7f6368117cf6280
673 
674 This resulted in double unifications.  Fix is trivial.
675]
676[Fix Trac #4953: local let binders can have IdInfo with free names
677simonpj@microsoft.com**20110214140334
678 Ignore-this: c8e5dbc6f0270e45d9cf2edee34d0354
679 
680 Local let binders in IfaceExpr never used to have unfoldings,
681 but lately they can (becuase they can have an INLINE pragma).
682 We must take account of the variables mentioned in the pragma
683 when computing the fingerprint.
684]
685[LLVM: Huge improvement to mangler speed.
686David Terei <davidterei@gmail.com>**20110213014406
687 Ignore-this: 4eeaa572dfe956c990895154bd942bb2
688 
689 The old llvm mangler was horrible! Very slow
690 due to bad design and code. New version is
691 linear complexity as it should be and far
692 lower coefficients. This fixes trac 4838.
693]
694[Defensify naked read in LLVM mangler
695Ben Lippmeier <benl@ouroborus.net>**20101210045922
696 Ignore-this: 1373f597863851bd03e7a7254558ed04
697]
698[Formatting only
699Ben Lippmeier <benl@ouroborus.net>**20101210042600
700 Ignore-this: 20bbcd95c70b59094d0bb8a63e459103
701]
702[New plan: push unsolved wanteds inwards
703simonpj@microsoft.com**20110211174058
704 Ignore-this: ed40762e260dab75b5e51c696f9965fa
705 
706 This fixes Trac #4935.  See Note [Preparing inert set for implications].
707 Lots of comments, but not a lot of code is changed!
708]
709[Fix platform detection in bindists
710Ian Lynagh <igloo@earth.li>**20110211184244
711 In a bindist, we generate files like the hsc2hs wrapper.
712 This means we need to have the right values for the variables like
713 CONF_GCC_LINKER_OPTS_STAGE1 which in turn means we need to know what
714 platform we're on.
715]
716[replace C++ comments with C comments (Solaris' DTrace fails on C++ comments)
717Karel Gardas <karel.gardas@centrum.cz>**20110112051829
718 Ignore-this: c229292227c7e2b512daf9129cb66aeb
719]
720[Use DTrace whenever it's available
721Ian Lynagh <igloo@earth.li>**20110210153300
722 Ignore-this: 111c72bf20d6eaafd3e488196a89b2c
723 Now that we've stopped trying to support 64bit OS X 10.5, the DTrace
724 problems there don't matter.
725]
726[Enable DTrace on Solaris; based on a patch from Karel Gardas
727Ian Lynagh <igloo@earth.li>**20110210155217
728 Ignore-this: 93eaf0e06c721c80c175aaee9a113e6
729]
730[Fix #4867, ghci displays negative floats incorrectly
731gwright@antiope.com**20110209222423
732 Ignore-this: 1b3279fa5f6c4849ed6311275b1a466a
733 
734 This patch fixes the erroneous relocations that caused
735 the bug in ticket #4867.  External addresses and global
736 offset table entries were relocated correctly, but all other
737 relocations were incorrectly calculated.  This caused, for
738 example, bad references to constants stored in the __const
739 section of the __TEXT segment.
740 
741 This bug only affected OS X on 64-bit platforms.
742 
743]
744[Simpify constraints from a TH bracket eagerly
745simonpj@microsoft.com**20110209175003
746 Ignore-this: b341ea3d235af1b2e617107f238ae1d6
747 
748 See Trac #4949, where having a TH bracket implication
749 was messing things up.  Better to get rid of it right away.
750]
751[Fix typo in SpecConstr that made it not work at all
752simonpj@microsoft.com**20110203172756
753 Ignore-this: b550d5c5b73ed13709ee2938c80a750f
754 
755 There was a terrible typo in this patch; I wrote "env"
756 instead of "env1".
757 
758    Mon Jan 31 11:35:29 GMT 2011  simonpj@microsoft.com
759      * Improve Simplifier and SpecConstr behaviour
760 
761 Anyway, this fix is essential to make it work properly.
762 Thanks to Max for spotting the problem (again).
763]
764[avoid adding HPC ticks to arrow constructs (fixes #1333)
765Ross Paterson <ross@soi.city.ac.uk>**20110202211425
766 Ignore-this: 2938850ebbb53d1bc6bf0399f68dd8e5
767]
768[Fix type checker error message
769simonpj@microsoft.com**20110201122920
770 Ignore-this: 7369cc5f8dae3d81621f580a8ddaf41e
771 
772 See Trac #4940. We had a message
773      The lambda expression `\ x -> x' has one argument one argument,
774 repeating the "one argument" part.  Easy fix.
775]
776[Fix bug in roughTopNames
777simonpj@microsoft.com**20110126171803
778 Ignore-this: eca8b144162f1bd94e2ccb433bca1e02
779 
780 roughTopNames was returning a name that in fact might be
781 "looked though" by the rule matcher. Result: a rule
782 that should match was being pre-emptively discarded.
783 
784 See Note [Care with roughTopName].
785 
786 Fixes a bug noticed by Pedro (Trac #4918).
787]
788[Fix Trac #4917: try a bit harder to unify on-the-fly
789simonpj@microsoft.com**20110125110112
790 Ignore-this: e96e0a19ab8517d4ba648efe91f6b379
791 
792 This is generally a modest improvement but, more important,
793 it fixes a "unify-under-forall" problem.  See Note [Avoid deferring].
794 
795 There's still a lurking unsatisfactory-ness in that we can't
796 defer arbitrary constraints that are trapped under a forall.
797]
798[Look through type synonyms when computing orphans
799simonpj@microsoft.com**20110126171229
800 Ignore-this: 6dfc45dae3a94cdb0022b2d21d6e09f6
801 
802 I renamed functions tyClsNamesOfTypes to oprhNamesOfType,
803 because it's only used in that capacity, and we therefore
804 want to look through type synonyms.  Similarly exprOrphNames.
805 
806 This fixes Trac #4912.
807]
808[Improve Simplifier and SpecConstr behaviour
809simonpj@microsoft.com**20110131113529
810 Ignore-this: e5b96c97cee0950e558ddf15178bb6c9
811 
812 Trac #4908 identified a case where SpecConstr wasn't "seeing" a
813 specialisation it should easily get.  The solution was simple: see
814 Note [Add scrutinee to ValueEnv too] in SpecConstr.
815 
816 Then it turned out that there was an exactly analogous infelicity in
817 the mighty Simplifer too; see Note [Add unfolding for scrutinee] in
818 Simplify. This fix is good for Simplify even in the absence of the
819 SpecConstr change.  (It arose when I moved the binder- swap stuff to
820 OccAnall, not realising that it *remains* valuable to record info
821 about the scrutinee of a case expression.  The Note says why.
822 
823 Together these two changes are unconditionally good.  Better
824 simplification, better specialisation. Thank you Max.
825]
826[Fix dependencies among specialisations for imported Ids
827simonpj@microsoft.com**20110126172112
828 Ignore-this: 364e09c11affe7bfe8f1b934ea28bbb6
829 
830 This was a subtle one (Trac #4903).  See
831   Note [Glom the bindings if imported functions are specialised]
832 in Speclialise.
833 
834 Fundamentally, a specialised binding for an imported Id was being
835 declared non-recursive, whereas in fact it can become recursive
836 via a RULE.  Once it's specified non-recurive the OccAnal pass
837 treats that as gospel -- and that in turn led to infinite inlining.
838 
839 Easily fixed by glomming all the specialised bindings in a Rec;
840 now the OccAnal will sort them out correctly.
841]
842[Fix Trac #4874: specialisation of INLINABLE things
843simonpj@microsoft.com**20110114163227
844 Ignore-this: b90543117ebddaf3bbeeaf0af0c18699
845 
846 Johan discovered that when INLINABLE things are specialised
847 bad things can happen. This patch implements a hack -- but
848 it's a simple hack and it solves the problem.
849 
850 See Note [Inline specialisations].
851 
852 The hack part is that really INLINABLE should not cause *any* loss
853 optimisation, and it does; see Note [Don't w/w INLINABLE things] in
854 WorkWrap.
855]
856[Fix an egregious strictness analyser bug (Trac #4924)
857simonpj@microsoft.com**20110128080748
858 Ignore-this: 3bf533c3d30b45a8e78b1fec3d9634f
859 
860 The "virgin" flag was being threaded rather than treated
861 like an environment.  As a result, the second and subsequent
862 recursive definitions in a module were not getting a
863 correctly-initialised fixpoint loop, causing much worse
864 strictness analysis results.  Indeed the symptoms in
865 Trac #4924 were quite bizarre.
866 
867 Anyway, it's easily fixed.  Merge to stable branch.
868]
869[tweak newArray# documentation again
870Simon Marlow <marlowsd@gmail.com>**20110119140633
871 Ignore-this: ceee33428dbad7e0f5eabfa0a2590466
872]
873[Fix documentation bug: newArray# accepts word count, not byte count.
874Edward Z. Yang <ezyang@mit.edu>**20110118221834
875 Ignore-this: 8daab134bf72a740b89d273fb4e983d5
876]
877[Fix validate on OS X 64
878Ian Lynagh <igloo@earth.li>**20110124183618]
879[Whitespace-only in rts/Linker.c
880Ian Lynagh <igloo@earth.li>**20101217234124]
881[Fix Windows build: move rtsTimerSignal to the POSIX-only section
882Simon Marlow <marlowsd@gmail.com>**20101210090045
883 Ignore-this: aa1844b70b9f1a44447787c4bbe10d44
884]
885[Export the value of the signal used by scheduler (#4504)
886Dmitry Astapov <dastapov@gmail.com>**20101208183755
887 Ignore-this: 427bf8c2469283fc7a6f759440d07d87
888]
889[Add some casts to fix warnings; patch from Greg Wright
890Ian Lynagh <igloo@earth.li>**20101217223811]
891[Keep separate linker flags, for when we want to link with gcc or ld
892Ian Lynagh <igloo@earth.li>**20110124233121]
893[Track change in isInlinePragma
894simonpj@microsoft.com**20101105131545
895 Ignore-this: 256f4940744d84086c0f1c99a9ab8778
896 
897 In TcBinds we want to use isAnyInlinePragma, to get
898 both INLINE and INLINABLE.  I don't know why this isn't
899 leading to failures for others!  The (bogus) error I got,
900 triggered by this bug was:
901 
902   libraries\haskeline\System\Console\Haskeline\Key.hs:23:1:
903     You cannot SPECIALISE `M.findWithDefault'
904       because its definition has no INLINE/INLINABLE pragma
905]
906[In configure, test that GHC generates code for the correct platform (#4819)
907Simon Marlow <marlowsd@gmail.com>**20110107163541
908 Ignore-this: 29541d3896f9c9bcf791510edae70254
909 Patch supplied by the bug reporter, tidied up by me.
910 
911 $ ./configure --with-ghc=$HOME/fp/bin/i386-unknown-linux/ghc --build=x86_64-unknown-linux
912 checking for gfind... no
913 checking for find... /usr/bin/find
914 checking for sort... /usr/bin/sort
915 checking for GHC version date... inferred 7.1.20110107
916 checking version of ghc... 7.0.1
917 checking build system type... x86_64-unknown-linux-gnu
918 checking host system type... x86_64-unknown-linux-gnu
919 checking target system type... x86_64-unknown-linux-gnu
920 Host platform inferred as: i386-unknown-linux
921 Target platform inferred as: i386-unknown-linux
922 This GHC (/home/simonmar/fp/bin/i386-unknown-linux/ghc) does not generate code for the build platform
923    GHC target platform    : i386-unknown-linux
924    Desired build platform : x86_64-unknown-linux
925]
926[Produce an error message, not a crash, for HsOpApp with non-var operator
927simonpj@microsoft.com**20110112170719
928 Ignore-this: df0f6f2e3318f9c33a714609019b0262
929 
930 Fixes Trac #4877.
931]
932[Fix longstanding bug in C-- inlining for functions calls.
933Edward Z. Yang <ezyang@mit.edu>**20110113130654
934 Ignore-this: 79001003b1f3cc5005207ccfed980c21
935]
936[Fix a buglet in postInlineUnconditionally
937simonpj@microsoft.com**20110114162927
938 Ignore-this: 7a7b8610ef863907843d4ae36a8a1a3c
939 
940 Under obscure circumstances (actually only shown up when fixing something
941 else) it was possible for a variable binding to be discarded although
942 it was still used.  See Note [Top level and postInlineUnconditionally]
943]
944[Some infrastruture for lambda-lifting
945simonpj@microsoft.com**20101116173500
946 Ignore-this: bb0b7db06898b9fa731602107febbf7
947 
948 This stuff should have no effect but it sets things
949 up so that we can try floating out lambdas of n value
950 arguments.
951 
952 The new (secret) flag is -ffloatt-lam-args=n.
953 
954 This is *not* working yet, but it's got tangled up with
955 other stuff I want to commit, and it does no harm.
956]
957[Refactoring of the way that inlinings and rules are activated
958simonpj@microsoft.com**20101116173719
959 Ignore-this: d195c39a646e1fac3804fb044644d226
960 
961 Principally, the SimplifierMode now carries several (currently
962 four) flags in *all* phases, not just the "Gentle" phase.
963 This makes things simpler and more uniform.
964 
965 As usual I did more refactoring than I had intended.
966 
967 This stuff should go into 7.0.2 in due course, once
968 we've checked it solves the DPH performance problems.
969]
970[Two signficant changes to the simplifier
971simonpj@microsoft.com**20101027193729
972 Ignore-this: 9b35e8ad975ba1cebbba28028f1c7f43
973 
974 1. Do eta-expansion at let-bindings, not lambdas.
975    I have wanted to do this for a long time.
976    See Note [Eta-expanding at let bindings] in SimplUtils
977 
978 2. Simplify the rather subtle way in which InlineRules (the
979    template captured by an INLINE pragma) was simplified.
980    Now, these templates are always simplified in "gentle"
981    mode only, and only INLINE things inline inside them.
982 
983    See Note Note [Gentle mode], Note [Inlining in gentle mode]
984    and Note [RULEs enabled in SimplGently] in SimplUtils
985]
986[Can't use DeriveFunctor in 7.0, as we need to be able to build with 6.10
987Ian Lynagh <igloo@earth.li>**20110121151201
988 Ignore-this: 5bdffaf4e23bf333bf5ca2d2872a026a
989]
990[Resolve conflicts
991Ian Lynagh <igloo@earth.li>**20110121150119
992 Ignore-this: b26de1a8fcd756bd233225f79724c032
993]
994[Resolve conflict
995Ian Lynagh <igloo@earth.li>**20110121144437
996 Ignore-this: 57893f741650c80c758f8d69ac192ed8
997]
998[Major refactoring of the type inference engine
999simonpj@microsoft.com**20110112145604
1000 Ignore-this: 6a7fc90c9b798e89505606726cc8090e
1001 
1002 This patch embodies many, many changes to the contraint solver, which
1003 make it simpler, more robust, and more beautiful.  But it has taken
1004 me ages to get right. The forcing issue was some obscure programs
1005 involving recursive dictionaries, but these eventually led to a
1006 massive refactoring sweep.
1007 
1008 Main changes are:
1009  * No more "frozen errors" in the monad.  Instead "insoluble
1010    constraints" are now part of the WantedConstraints type.
1011 
1012  * The WantedConstraint type is a product of bags, instead of (as
1013    before) a bag of sums.  This eliminates a good deal of tagging and
1014    untagging.
1015 
1016  * This same WantedConstraints data type is used
1017      - As the way that constraints are gathered
1018      - As a field of an implication constraint
1019      - As both argument and result of solveWanted
1020      - As the argument to reportUnsolved
1021 
1022  * We do not generate any evidence for Derived constraints. They are
1023    purely there to allow "impovement" by unifying unification
1024    variables.
1025 
1026  * In consequence, nothing is ever *rewritten* by a Derived
1027    constraint.  This removes, by construction, all the horrible
1028    potential recursive-dictionary loops that were making us tear our
1029    hair out.  No more isGoodRecEv search either. Hurrah!
1030 
1031  * We add the superclass Derived constraints during canonicalisation,
1032    after checking for duplicates.  So fewer superclass constraints
1033    are generated than before.
1034 
1035  * Skolem tc-tyvars no longer carry SkolemInfo.  Instead, the
1036    SkolemInfo lives in the GivenLoc of the Implication, where it
1037    can be tidied, zonked, and substituted nicely.  This alone is
1038    a major improvement.
1039 
1040  * Tidying is improved, so that we tend to get t1, t2, t3, rather
1041    than t1, t11, t111, etc
1042 
1043    Moreover, unification variables are always printed with a digit
1044    (thus a0, a1, etc), so that plain 'a' is available for a skolem
1045    arising from a type signature etc. In this way,
1046      (a) We quietly say which variables are unification variables,
1047          for those who know and care
1048      (b) Types tend to get printed as the user expects.  If he writes
1049              f :: a -> a
1050              f = ...blah...
1051          then types involving 'a' get printed with 'a', rather than
1052          some tidied variant.
1053 
1054  * There are significant improvements in error messages, notably
1055    in the "Cannot deduce X from Y" messages.
1056]
1057[A little refactoring (remove redundant argument passed to isGoodRecEv)
1058simonpj@microsoft.com**20101202123110
1059 Ignore-this: e517c5c12109a230f08dafb4d1e386df
1060]
1061[Doing the smart canonicalization only if we are not simplifying a Rule LHS.
1062dimitris@microsoft.com**20101210132221
1063 Also, same thing now applies for adding superclasses.
1064 
1065]
1066[Fix recursive superclasses (again).  Fixes Trac #4809.
1067simonpj@microsoft.com**20101213171511
1068 Ignore-this: b91651397918fd8f0183812f9a070073
1069 
1070 This patch finally deals with the super-delicate question of
1071 superclases in possibly-recursive dictionaries.  The key idea
1072 is the DFun Superclass Invariant (see TcInstDcls):
1073 
1074      In the body of a DFun, every superclass argument to the
1075      returned dictionary is
1076        either   * one of the arguments of the DFun,
1077        or       * constant, bound at top level
1078 
1079 To establish the invariant, we add new "silent" superclass
1080 argument(s) to each dfun, so that the dfun does not do superclass
1081 selection internally.  There's a bit of hoo-ha to make sure that
1082 we don't print those silent arguments in error messages; a knock
1083 on effect was a change in interface-file format.
1084 
1085 A second change is that instead of the complex and fragile
1086 "self dictionary binding" in TcInstDcls and TcClassDcl,
1087 using the same mechanism for existential pattern bindings.
1088 See Note [Subtle interaction of recursion and overlap] in TcInstDcls
1089 and Note [Binding when looking up instances] in InstEnv.
1090 
1091 Main notes are here:
1092 
1093   * Note [Silent Superclass Arguments] in TcInstDcls,
1094     including the DFun Superclass Invariant
1095 
1096 Main code changes are:
1097 
1098   * The code for MkId.mkDictFunId and mkDictFunTy
1099 
1100   * DFunUnfoldings get a little more complicated;
1101     their arguments are a new type DFunArg (in CoreSyn)
1102 
1103   * No "self" argument in tcInstanceMethod
1104   * No special tcSimplifySuperClasss
1105   * No "dependents" argument to EvDFunApp
1106 
1107 IMPORTANT
1108    It turns out that it's quite tricky to generate the right
1109    DFunUnfolding for a specialised dfun, when you use SPECIALISE
1110    INSTANCE.  For now I've just commented it out (in DsBinds) but
1111    that'll lose some optimisation, and I need to get back to
1112    this.
1113]
1114[Comments and layout
1115simonpj@microsoft.com**20101015131924
1116 Ignore-this: 126fbdb629a08c1380c7a1f5cd967d97
1117]
1118[Occurrence analyser takes account of the phase when handing RULES
1119simonpj@microsoft.com**20101116173312
1120 Ignore-this: 50558fb8ec8fe1d0d50db46a7153b077
1121 
1122 See Note [Finding rule RHS free vars]
1123 
1124 This should make Roman happy.
1125]
1126[Comments and formatting only
1127benl@ouroborus.net**20100914062903
1128 Ignore-this: b0fc25f0952cafd56cc25353936327d4
1129]
1130[Fix up TcInstDcls
1131simonpj@microsoft.com**20101203180758
1132 Ignore-this: 9311aeb4ee67c799704afec90b5982d0
1133 
1134 I really don't know how this module got left out of my last
1135 patch, namely
1136   Thu Dec  2 12:35:47 GMT 2010  simonpj@microsoft.com
1137   * Re-jig simplifySuperClass (again)
1138 
1139 I suggest you don't pull either the patch above, or this
1140 one, unless you really have to.  I'm not fully confident
1141 that it works properly yet.  Ran out of time. Sigh.
1142]
1143[Moved canonicalisation inside solveInteract
1144dimitris@microsoft.com**20101209141215
1145 
1146 Moreover canonicalisation now is "clever", i.e. it never canonicalizes a class
1147 constraint if it can already discharge it from some other inert or previously
1148 encountered constraints. See Note [Avoiding the superclass explosion]
1149 
1150]
1151[Fix Trac #3731: more superclass subtlety (sigh)
1152simonpj@microsoft.com**20101214180344
1153 Ignore-this: f4168e59f3164303ba7be022ba19c37b
1154 
1155 I will add more comments, but I want to commit this tonight,
1156 so the overnight builds get it.
1157]
1158[Re-jig simplifySuperClass (again)
1159simonpj@microsoft.com**20101202123547
1160 Ignore-this: fe4062b8988258f6748ebd8fbd6515b5
1161 
1162 This fixes the current loop in T3731, and will fix other
1163 reported loops.  The loops show up when we are generating
1164 evidence for superclasses in an instance declaration.
1165 
1166 The trick is to make the "self" dictionary simplifySuperClass
1167 depend *explicitly* on the superclass we are currently trying
1168 to build.  See Note [Dependencies in self dictionaries] in TcSimplify.
1169 
1170 That in turn means that EvDFunApp needs a dependency-list, used
1171 when chasing dependencies in isGoodRecEv.
1172]
1173[Do dependency analysis when kind-checking type declarations
1174simonpj@microsoft.com**20110110110351
1175 Ignore-this: 17a8dee32694d3e1835cf7bb02d3abb5
1176 
1177 This patch fixes Trac #4875.  The main point is to do dependency
1178 analysis on type and class declarations, and kind-check them in
1179 dependency order, so as to improve error messages.
1180 
1181 This patch means that a few programs that would typecheck before won't
1182 typecheck any more; but before we were (naughtily) going beyond
1183 Haskell 98 without any language-extension flags, and Trac #4875
1184 convinces me that doing so is a Bad Idea.
1185 
1186 Here's an example that won't typecheck any more
1187        data T a b = MkT (a b)
1188        type F k = T k Maybe
1189 
1190 If you look at T on its own you'd default 'a' to kind *->*;
1191 and then kind-checking would fail on F.
1192 
1193 But GHC currently accepts this program beause it looks at
1194 the *occurrences* of T.
1195]
1196[Update the generics docs; pointed out by Christian Maeder
1197Ian Lynagh <igloo@earth.li>**20110117214632]
1198[Reinstate the OS X flags in the LDFLAGS etc variables
1199Ian Lynagh <igloo@earth.li>**20110117200540
1200 Ignore-this: 9261baa1843100f65b02fb91c1a0d225
1201 I expect this will fix:
1202 http://www.haskell.org/pipermail/cvs-ghc/2011-January/059098.html
1203]
1204[It's not clear if LDFLAGS flags will be given to gcc or ld,
1205Ian Lynagh <igloo@earth.li>**20110116151230
1206 Ignore-this: a6a2d0b1f550c922c32f6f252e4e3285
1207 and they accept different flags, so for now do nothing
1208]
1209[Fix libffi build rules
1210Ian Lynagh <igloo@earth.li>**20110115202104
1211 Ignore-this: 57e1763d2079301b0165be7deba29c85
1212 Fixes a rare race when both libHSffi.a and libHSffi_p.a were being built
1213 at the same time:
1214 
1215 "cp" libffi/dist-install/build/libffi.a libffi/dist-install/build/libHSffi.a
1216 "cp" libffi/dist-install/build/libffi.a libffi/dist-install/build/libHSffi.a
1217 "cp" libffi/dist-install/build/libffi.so libffi/dist-install/build/libHSffi-ghc7.1.20110115.so
1218 cp: cannot create regular file `libffi/dist-install/build/libHSffi.a': File exists
1219]
1220[Turn off dtrace unless you override USE_DTRACE
1221Ian Lynagh <igloo@earth.li>**20110116180306
1222 Ignore-this: beafc2002091fa7f0e66666004c870a5
1223 There are problems with dtrace on 64bit 10.5. For now at least, we
1224 just turn dtrace off unless you override USE_DTRACE
1225]
1226[throwTo: report the why_blocked value in the barf()
1227Simon Marlow <marlowsd@gmail.com>**20101203094840
1228 Ignore-this: 3b167c581be1c51dfe3586cc6359e1d0
1229]
1230[Fix Trac #4870: get the inlining for an imported INLINABLE Id
1231simonpj@microsoft.com**20110105002712
1232 Ignore-this: 60c0192eb48590c2e6868d15ba8f84ce
1233 
1234 We need the unfolding even for a *recursive* function (indeed
1235 that's the point) and I was using the wrong function to get it
1236 (idUnfolding rather than realIdUnfolding).
1237]
1238[Fix installation on cygwin
1239Ian Lynagh <igloo@earth.li>**20110111194838
1240 Ignore-this: fe923d0619da3bd3a34968106c92fdab
1241]
1242[Rejig the includes/ installation rules
1243Ian Lynagh <igloo@earth.li>**20110109181158
1244 They're a little nicer now, and a regression in the cygwin build is
1245 fixed (the $i in the destination wasn't surviving being passed through
1246 cygpath).
1247]
1248[MERGED: releaseCapabilityAndQueueWorker: task->stopped should be false (#4850)
1249Ian Lynagh <igloo@earth.li>**20110109005801]
1250[boundTaskExiting: don't set task->stopped unless this is the last call (#4850)
1251Simon Marlow <marlowsd@gmail.com>**20101221115807
1252 Ignore-this: 7e1b990aa08b3ea9cdaa9385d8e41e48
1253 The bug in this case was that we had a worker thread making a foreign
1254 call which invoked a callback (in this case it was performGC, I
1255 think).  When the callback ended, boundTaskExiting() was setting
1256 task->stopped, but the Task is now per-OS-thread, so it is shared by
1257 the worker that made the original foreign call.  When the foreign call
1258 returned, because task->stopped was set, the worker was not placed on
1259 the queue of spare workers.  Somehow the worker woke up again, and
1260 found the spare_workers queue empty, which lead to a crash.
1261 
1262 Two bugs here: task->stopped should not have been set by
1263 boundTaskExiting (this broke when I split the Task and InCall structs,
1264 in 6.12.2), and releaseCapabilityAndQueueWorker() should not be
1265 testing task->stopped anyway, because it should only ever be called
1266 when task->stopped is false (this is now an assertion).
1267]
1268[Add utils/ghc-cabal/Makefile
1269Ian Lynagh <igloo@earth.li>**20110108144049]
1270[Make DESTDIR an absolute path when installing; fixes #4883
1271Ian Lynagh <igloo@earth.li>**20110108171635]
1272[Improve error message when importing data constructors (ticket #4058).
1273Michal Terepeta <michal.terepeta@gmail.com>**20101127211338
1274 Ignore-this: 3289a08f0391dd90dfef2e0403a04ccd
1275]
1276[Remove redundant import
1277Ian Lynagh <igloo@earth.li>**20110108130047
1278 Ignore-this: 1c7fdec77b48319c845c9593b5fb94af
1279]
1280[catch SIGTSTP and save/restore terminal settings (#4460)
1281Simon Marlow <marlowsd@gmail.com>**20110107124042
1282 Ignore-this: 38f7f27bf75178899f466404c048241d
1283 As far as I can tell, it is the responsibility of the program to save
1284 and restore its own terminal settings across a suspend/foreground, the
1285 shell doesn't do it (which seems odd).  So I've added a signal handler
1286 for SIGTSTP to the RTS which will save and restore the terminal
1287 settings iff we modified them with hSetBuffering or hSetEcho (we
1288 already restore them at exit time in these cases).
1289]
1290[Improve error message of :set in ghci (ticket #4190).
1291Michal Terepeta <michal.terepeta@gmail.com>**20101130211505
1292 Ignore-this: ccc8a0816a900ba8c4a966285a465b23
1293]
1294[Improve printing for -ddump-deriv
1295simonpj@microsoft.com**20101215121955
1296 Ignore-this: 3181c948c4c2471bd99b32c5ee487a1e
1297]
1298[do not compile part of shared lib RTS with -fno-PIC on Solaris
1299Karel Gardas <karel.gardas@centrum.cz>**20101217085133
1300 Ignore-this: 8c8dbb45cac0578a58a3557f1e03c66
1301]
1302[provide shared libraries support on i386-unknown-solaris2 platform
1303Karel Gardas <karel.gardas@centrum.cz>**20101217084617
1304 Ignore-this: b6079c6a39a71200a1ee863573e40828
1305]
1306[fix CPP detection of Solaris in NCG
1307Karel Gardas <karel.gardas@centrum.cz>**20101217084510
1308 Ignore-this: 9d1ce59d469294eab1f0cbc697e48d69
1309]
1310[Fix a bug in functorLikeTraverse, which was giving wrong answer for tuples
1311simonpj@microsoft.com**20101215123725
1312 Ignore-this: 560220e92429b5b1a6197a62f94a4ff2
1313 
1314 This bug led to Trac #4816, which is hereby fixed
1315]
1316[Allow enumerations to have phantom arguments.
1317simonpj@microsoft.com**20101215121817
1318 Ignore-this: 32ef8cb869e6e38c2e43b3ae87b1b9a8
1319 
1320 The bytecode generator was being too eager.
1321 Fixes Trac #4528, or rather, a near variant.
1322]
1323[Tighten up what it means to be an "enumeration data constructor"
1324simonpj@microsoft.com**20101215121927
1325 Ignore-this: 459b3f9f7994a13094ed87b0768b33a8
1326 
1327 See Note [Enumeration types] in TyCon, and comments in Trac #4528
1328]
1329[add 'make re2' for rebuilding stage2 (similarly re1 and re3)
1330Simon Marlow <marlowsd@gmail.com>**20101221100254
1331 Ignore-this: 5c0afe3810b66a5b6e53a3a0fe933945
1332]
1333[add comment to remind people to update driver/gcc/gcc.c
1334Simon Marlow <marlowsd@gmail.com>**20110106152402
1335 Ignore-this: c07d7ac11eb9221ef821f78aab1807cb
1336]
1337[update paths now that we upgraded gcc to 4.5.0
1338Simon Marlow <marlowsd@gmail.com>**20110106133729
1339 Ignore-this: f8f9bcad984fdd472e0ae958b66bea9d
1340]
1341[Create ~/.ghc/ if it doesn't already exist; fixes trac #4522
1342Ian Lynagh <igloo@earth.li>**20101218184925]
1343[Pass --hoogle to haddock; fixes trac #4521
1344Ian Lynagh <igloo@earth.li>**20101219125243]
1345[use Win32 CreateProcess() rather than mingw spawnv() (#4531)
1346Simon Marlow <marlowsd@gmail.com>**20110106133834
1347 Ignore-this: 4c0947853549dad034622c044391af6c
1348]
1349[Fix mkUserGuidePart program name on Windows
1350Ian Lynagh <igloo@earth.li>**20110106143707]
1351[On Cygwin, use a Cygwin-style path for /bin/install's destination
1352Ian Lynagh <igloo@earth.li>**20110106223030
1353 
1354 cygwin's /bin/install doesn't set file modes correctly if the
1355 destination path is a C: style path:
1356 
1357 $ /bin/install -c -m 644 foo /cygdrive/c/cygwin/home/ian/foo2
1358 $ /bin/install -c -m 644 foo c:/cygwin/home/ian/foo3
1359 $ ls -l foo*
1360 -rw-r--r-- 1 ian None 0 2011-01-06 18:28 foo
1361 -rw-r--r-- 1 ian None 0 2011-01-06 18:29 foo2
1362 -rwxrwxrwx 1 ian None 0 2011-01-06 18:29 foo3
1363 
1364 This causes problems for bindisttest/checkBinaries.sh which then
1365 thinks that e.g. the userguide HTML files are binaries.
1366 
1367 We therefore use a /cygdrive path if we are on cygwin
1368]
1369[Fix #4829 (build does not respect --with-gcc option)
1370gwright@antiope.com**20101221133233
1371 Ignore-this: 37918feb82f911c2beb75915b6e8b97b
1372 
1373 This patch fixes what seems to be the last problem with the --with-gcc
1374 option.  On OS X, we need to pass the path to gcc to dtrace as the
1375 preprocessor.  (Internally, dtrace on OS X sets the default preprocessor
1376 to /usr/bin/gcc.)  ATM, dtrace is only supported on OS X, so we don't
1377 need any conditionalization.  If dtrace is ported to other platforms,
1378 we might need to change this. However, usage on other platforms will
1379 probably be similar to OS X, since many of Apple's changes are to
1380 use the gnu toolchain instead of the Sun toolchain.
1381   
1382]
1383[comments on SRC_HC_OPTS (#4829)
1384Simon Marlow <marlowsd@gmail.com>**20101214101340
1385 Ignore-this: e2bdec00f07b68e82837e77a4faf6514
1386]
1387[fix #3910
1388Simon Marlow <marlowsd@gmail.com>**20101216114452
1389 Ignore-this: 410e95e188344a523520e192a3fb58ea
1390]
1391[refactor and tidy up the section on RTS options
1392Simon Marlow <marlowsd@gmail.com>**20101216123151
1393 Ignore-this: 9cdafd687351d8a3ff879b64347f85d3
1394]
1395[Related to #4826: Some minor tweaks to the wording of the User Guide, section 4.16
1396Orphi <MathematicalOrchid@hotmail.com>**20101209170440
1397 Ignore-this: c3d942d58594be7d4c2eb4dc3a22f19
1398]
1399[FIX #4826 partial: Add -rtsopts and -with-rtsopts to User Guide section 4.11.6
1400Orphi <MathematicalOrchid@hotmail.com>**20101209165152
1401 Ignore-this: 2fc1c0abbb783695773ab0f9c013bbaa
1402]
1403[FIX #4826 partially: Change -f to -? in User Guide section F4.16
1404Orphi <MathematicalOrchid@hotmail.com>**20101209144148
1405 Ignore-this: 73410b350e80c8943ae722dec8dea44b
1406]
1407[Fix error compiling AsmCodeGen.lhs for PPC Mac (unused makeFar addr)
1408naur@post11.tele.dk**20101219213555
1409 Ignore-this: ab25d5f2e2ebe163547d5babaf4b1dbf
1410]
1411[Fix error compiling AsmCodeGen.lhs for PPC Mac (rtsPackageId)
1412naur@post11.tele.dk**20101219212530
1413 Ignore-this: 946f6d3e0d3c3ddf2dc07b85e1f82d85
1414]
1415[Add gcc and ld flags to --info output
1416Ian Lynagh <igloo@earth.li>**20101220173520]
1417[Updated ANNOUNCE
1418Ian Lynagh <igloo@earth.li>**20101220162525
1419 Ignore-this: 9cde75aea69b8c945a1cbee488bd8ee4
1420]
1421[Fix checkBinaries on OS X
1422Ian Lynagh <igloo@earth.li>**20101216201121]
1423[Use "-perm -u+x" rather than "-executable" to find executables
1424Ian Lynagh <igloo@earth.li>**20101216145235
1425 On Windows, -executable is matching the html docs.
1426]
1427[Remove a debugging print
1428Ian Lynagh <igloo@earth.li>**20101216011459]
1429[Add release notes for 7.0.2
1430Ian Lynagh <igloo@earth.li>**20101215165746
1431 Ignore-this: 686eeb9b0b301444a2ab0ed81e9d1d76
1432]
1433[Wibble to InstEnv.instanceHead
1434simonpj@microsoft.com**20101214082939
1435 Ignore-this: 851db517f8638a0aeb7ad461298f7e9f
1436 
1437 Fixes an accidental glitch in T1835
1438]
1439[MERGED: Fix recursive superclasses (again).  Fixes Trac #4809.
1440Ian Lynagh <igloo@earth.li>**20101214180026
1441 simonpj@microsoft.com**20101213171511
1442  Ignore-this: b91651397918fd8f0183812f9a070073
1443 
1444  This patch finally deals with the super-delicate question of
1445  superclases in possibly-recursive dictionaries.  The key idea
1446  is the DFun Superclass Invariant (see TcInstDcls):
1447 
1448       In the body of a DFun, every superclass argument to the
1449       returned dictionary is
1450         either   * one of the arguments of the DFun,
1451         or       * constant, bound at top level
1452 
1453  To establish the invariant, we add new "silent" superclass
1454  argument(s) to each dfun, so that the dfun does not do superclass
1455  selection internally.  There's a bit of hoo-ha to make sure that
1456  we don't print those silent arguments in error messages; a knock
1457  on effect was a change in interface-file format.
1458 
1459  A second change is that instead of the complex and fragile
1460  "self dictionary binding" in TcInstDcls and TcClassDcl,
1461  using the same mechanism for existential pattern bindings.
1462  See Note [Subtle interaction of recursion and overlap] in TcInstDcls
1463  and Note [Binding when looking up instances] in InstEnv.
1464 
1465  Main notes are here:
1466 
1467    * Note [Silent Superclass Arguments] in TcInstDcls,
1468      including the DFun Superclass Invariant
1469 
1470  Main code changes are:
1471 
1472    * The code for MkId.mkDictFunId and mkDictFunTy
1473 
1474    * DFunUnfoldings get a little more complicated;
1475      their arguments are a new type DFunArg (in CoreSyn)
1476 
1477    * No "self" argument in tcInstanceMethod
1478    * No special tcSimplifySuperClasss
1479    * No "dependents" argument to EvDFunApp
1480 
1481  IMPORTANT
1482     It turns out that it's quite tricky to generate the right
1483     DFunUnfolding for a specialised dfun, when you use SPECIALISE
1484     INSTANCE.  For now I've just commented it out (in DsBinds) but
1485     that'll lose some optimisation, and I need to get back to
1486     this.
1487]
1488[Add libstdc++-4.5.0-1-mingw32-dll-6.tar.lzma to mingw tarballs
1489Ian Lynagh <igloo@earth.li>**20101213223153]
1490[GHCi linker: Assume non-Haskell libraries are dynamic libs
1491Ian Lynagh <igloo@earth.li>**20101213124930
1492 Ignore-this: aa153a8f6e309c7b3dae7e46bb7a9583
1493 This works around a segfault we get when trying to load libiconv.a on
1494 some platforms.
1495]
1496[Make the case-to-let transformation a little less eager
1497simonpj@microsoft.com**20101208172251
1498 Ignore-this: 55eaa1b5753af31aeb32ec792cb6b662
1499 
1500 See Note [Case elimination: lifted case].
1501 Thanks to Roman for identifying this case.
1502]
1503[Fix Trac #4534: renamer bug
1504simonpj@microsoft.com**20101210084530
1505 Ignore-this: 8163bfa3a56344cfe89ad17c62e9655d
1506   
1507 The renamer wasn't attaching the right used-variables to a
1508 TransformStmt constructor.
1509 
1510 The real modification is in RnExpr; the rest is just
1511 pretty-printing and white space.
1512]
1513[Only reset the event log if logging is turned on (addendum to #4512)
1514Simon Marlow <marlowsd@gmail.com>**20101210093951
1515 Ignore-this: c9f85f0de2b11a37337672fba59aecc6
1516]
1517[allocate enough room for the longer filename (addendum to #4512)
1518Simon Marlow <marlowsd@gmail.com>**20101210093906
1519 Ignore-this: 270dc0219d98f1e0f9e006102ade7087
1520]
1521[warning fix: don't redefine BLOCKS_PER_MBLOCK
1522Simon Marlow <marlowsd@gmail.com>**20101210094002
1523 Ignore-this: cadba57f1c38f5e2af1de37d0a79c7ee
1524]
1525[Add a test that all programs in the bindist were built with the right GHC
1526Ian Lynagh <igloo@earth.li>**20101210161218
1527 They should use the GHC from the build tree, not the bootstrapping compiler.
1528]
1529[Add --version support to ghc-cabal
1530Ian Lynagh <igloo@earth.li>**20101212213600
1531 Ignore-this: ef696dcb1b96a23765f9f18e75a56f5
1532]
1533[Don't link the GHC RTS into our C-only programs
1534Ian Lynagh <igloo@earth.li>**20101210185402
1535 Ignore-this: 56f620f7eb16a03e7497a161bc48458e
1536]
1537[Build a copy of ghc-cabal with the in-tree compiler, for the bindist
1538Ian Lynagh <igloo@earth.li>**20101210181123]
1539[fix warnings
1540Simon Marlow <marlowsd@gmail.com>**20101209115844
1541 Ignore-this: ffff37feb2abbfc5bd12940c7007c208
1542]
1543[:unset settings support
1544Boris Lykah <lykahb@gmail.com>**20101123190132
1545 Ignore-this: 5e97c99238f5d2394592858c34c004d
1546 Added support for settings [args, prog, prompt, editor and stop].
1547 Now :unset supports the same set of options as :set.
1548]
1549[Use liftIO rather than io
1550Ian Lynagh <igloo@earth.li>**20101103212216]
1551[Fixes for #4512: EventLog.c - provides ability to terminate event logging, Schedule.c - uses them in forkProcess.
1552Dmitry Astapov <dastapov@gmail.com>**20101203133950
1553 Ignore-this: 2da7f215d6c22708a18291a416ba8881
1554]
1555[fix ticket number (#4505)
1556Simon Marlow <marlowsd@gmail.com>**20101209120404
1557 Ignore-this: 5769c5ce2a8d69d62d977a9ae138ec23
1558]
1559[Catch too-large allocations and emit an error message (#4505)
1560Simon Marlow <marlowsd@gmail.com>**20101209114005
1561 Ignore-this: c9013ab63dd0bd62ea045060528550c6
1562 
1563 This is a temporary measure until we fix the bug properly (which is
1564 somewhat tricky, and we think might be easier in the new code
1565 generator).
1566 
1567 For now we get:
1568 
1569 ghc-stage2: sorry! (unimplemented feature or known bug)
1570   (GHC version 7.1 for i386-unknown-linux):
1571         Trying to allocate more than 1040384 bytes.
1572 
1573 See: http://hackage.haskell.org/trac/ghc/ticket/4550
1574 Suggestion: read data from a file instead of having large static data
1575 structures in the code.
1576]
1577[Tweak the "sorry" message a bit
1578Simon Marlow <marlowsd@gmail.com>**20101208163212
1579 Ignore-this: aa1ce5bc3c27111548204b740572efbe
1580 
1581 -              "sorry! (this is work in progress)\n"
1582 +              "sorry! (unimplemented feature or known bug)\n"
1583]
1584[Cleanup comments and formatting only
1585benl@ouroborus.net**20101029065837
1586 Ignore-this: 393131d43ae57e4c1e7ac0dce734c452
1587]
1588[Fix Windows memory freeing: add a check for fb == NULL; fixes trac #4506
1589Ian Lynagh <igloo@earth.li>**20101208152349
1590 Also added a few comments, and a load of code got indented 1 level deeper.
1591]
1592[Make CPPFLAGS variables, as well as CFLAGS and LDFLAGS
1593Ian Lynagh <igloo@earth.li>**20101207010033
1594 Ignore-this: 2fc1ca1422aae1988d0fe1d29a8485d9
1595 This fixes the "does unsetenv return void" test in the unix package on
1596 OS X, if I tell it to make 10.4-compatible binaries. The test uses
1597 CPPFLAGS but not CFLAGS, so it thought it returned int (as it was
1598 in 10.5-mode), but the C compiler (using CFLAGS, so in 10.4 mode)
1599 thought it returned void.
1600 
1601 I also added CONF_LD_OPTS_STAGE$3 to the list of things in LDFLAGS,
1602 which looks like an accidental ommission.
1603]
1604[Tweak the cleaning of inplace/; fixes trac #4320
1605Ian Lynagh <igloo@earth.li>**20101205212048]
1606[Add a configure message
1607Ian Lynagh <igloo@earth.li>**20101206215201]
1608[Tweak a configure test
1609Ian Lynagh <igloo@earth.li>**20101123170621]
1610[Link even programs containing no Haskell modules with GHC
1611Ian Lynagh <igloo@earth.li>**20101206203329
1612 I don't remember why we made it use gcc instead, but going back to
1613 using ghc doesn't seem to break anything, and should fix the build
1614 on OS X 10.6.
1615]
1616[Correct the stage that the includes/ tools are built in
1617Ian Lynagh <igloo@earth.li>**20101206203125]
1618[Close .ghci files after reading them; fixes trac #4487
1619Ian Lynagh <igloo@earth.li>**20101205205301]
1620[Fix a nasty bug in RULE matching: Trac #4814
1621simonpj@microsoft.com**20101202102618
1622 Ignore-this: ba058ad46a02bd2faf3a14de93fd19c6
1623 
1624 See Note [Matching lets], which explains it all in detail.
1625 It took me a day to think of a nice way to fix the bug,
1626 but I think the result is quite respectable. Subtle, though.
1627]
1628[Fix a recomp bug: make classes/datatypes depend directly on DFuns (#4469)
1629Simon Marlow <marlowsd@gmail.com>**20101202122349
1630 Ignore-this: 61c765583bb1d97caa88cf9b4f45b87c
1631 And remove the old mechanism of recording dfun uses separately,
1632 because it didn't work.
1633 
1634 This wiki page describes recompilation avoidance and fingerprinting.
1635 I'll update it to describe the new method and what went wrong with the
1636 old method:
1637 
1638 http://hackage.haskell.org/trac/ghc/wiki/Commentary/Compiler/RecompilationAvoidance
1639]
1640[removeThreadFromQueue: stub out the link field before returning (#4813)
1641Simon Marlow <marlowsd@gmail.com>**20101202160838
1642 Ignore-this: 653ae17bc1120d7f4130da94665002a1
1643]
1644[handle ThreadMigrating in throwTo() (#4811)
1645Simon Marlow <marlowsd@gmail.com>**20101203094818
1646 Ignore-this: 8ef8cb7fd3b50a27f83c29968131d461
1647 If a throwTo targets a thread that has just been created with
1648 forkOnIO, then it is possible the exception strikes while the thread
1649 is still in the process of migrating.  throwTo() didn't handle this
1650 case, but it's fairly straightforward.
1651]
1652[Tell gcc to support back to OS X 10.5
1653Ian Lynagh <igloo@earth.li>**20101203201558
1654 Ignore-this: f02d70e5b9cce50137981c6cb2b62a18
1655]
1656[Remove the no-ghci-lib warning in ghc-pkg
1657Ian Lynagh <igloo@earth.li>**20101127235805
1658 GHCi libs are no longer necessary, as we can use the .a or .so versions
1659 instead.
1660]
1661[rts/Linker.c (loadArchive):
1662pho@cielonegro.org**20101130142700
1663 Ignore-this: bc84f9369ce5c2d289440701b7a3a2ab
1664 
1665 This routine should be aware of Mach-O misalignment of malloc'ed memory regions.
1666]
1667[Add GNU-variant support to the .a parser, and other improvements/tidyups
1668Ian Lynagh <igloo@earth.li>**20101127223945]
1669[Re-indent only
1670Ian Lynagh <igloo@earth.li>**20101127191646]
1671[Improve linker debugging for archive files
1672Ian Lynagh <igloo@earth.li>**20101127190907]
1673[Always enable the archive-loading code
1674Ian Lynagh <igloo@earth.li>**20101127173000
1675 If the GHCi .o lib doesn't exist, load the .a instead
1676]
1677[FIX #1845 (unconditional relative branch out of range)
1678pho@cielonegro.org**20101130143014
1679 Ignore-this: df234bd8ad937104c455656fe3c33732
1680 
1681 Don't use mmap on powerpc-apple-darwin as mmap doesn't support
1682 reallocating but we need to allocate jump islands just after each
1683 object images. Otherwise relative branches to jump islands can fail
1684 due to 24-bits displacement overflow.
1685]
1686[rts/Linker.c (machoGetMisalignment):
1687pho@cielonegro.org**20101130123355
1688 Ignore-this: 75425600049efd587e9873578e26392f
1689 
1690 Use fseek(3) instead of rewind(3) to move the file position indicator back to the initial position. Otherwise we can't use this function in loadArchive().
1691]
1692[rts/Linker.c (ocFlushInstructionCache):
1693pho@cielonegro.org**20101130121425
1694 Ignore-this: 1e2c207e4b1d17387617ec5d645204b7
1695 
1696 I found this function causes a segfault when ocAllocateSymbolExtras() has allocated a separate memory region for jump islands.
1697]
1698[fix ref to utils/ext-core, which moved to Hackage (extcore package)
1699Simon Marlow <marlowsd@gmail.com>**20101201092147
1700 Ignore-this: 272a7daaa335ef60bcc645db70b4d68b
1701]
1702[fix floating-point/FFI section: fenv is C99, not POSIX
1703Simon Marlow <marlowsd@gmail.com>**20101201092119
1704 Ignore-this: ce8b3edd428e4f77691dd739b5b4ae73
1705]
1706[Document the behaviour of fenv.h functions with GHC (#4391)
1707Simon Marlow <marlowsd@gmail.com>**20101126125336
1708 Ignore-this: bc4eab49428d567505a28add6fed90f1
1709]
1710[Substitution should just substitute, not optimise
1711simonpj@microsoft.com**20101125172356
1712 Ignore-this: 657628d9b6796ceb5f915c43d56e4a06
1713 
1714 This was causing Trac #4524, by optimising
1715      (e |> co)  to   e
1716 on the LHS of a rule.  Result, the template variable
1717 'co' wasn't bound any more.
1718 
1719 Now that substition doesn't optimise, it seems sensible to call
1720 simpleOptExpr rather than substExpr when substituting in the
1721 RHS of rules.  Not a big deal either way.
1722]
1723[Allow the old [$foo| ... |] syntax for quasi-quotes
1724simonpj@microsoft.com**20101112083052
1725 Ignore-this: 868e0e07fc6bbc9772bcba54e8ca79d
1726 
1727 This is just a backward-compatibility thing, to be removed
1728 eventually.
1729]
1730[For bindists, build ghc-pwd with stage 1
1731Ian Lynagh <igloo@earth.li>**20101121183520
1732 Ignore-this: a3b5c8b78c81ec1b6d5fbf23da346ff5
1733 rather then the bootstrapping compiler. This fixes problems where the
1734 bootstrapping compiler dynamically links against libraries not on the
1735 target machine.
1736]
1737[Makefile tweak
1738Ian Lynagh <igloo@earth.li>**20101121183342
1739 Ignore-this: cd55a2819c1a5fd36da1bc7a75d2ded1
1740]
1741[Fix a makefile include ordering sanity check
1742Ian Lynagh <igloo@earth.li>**20101121174916
1743 Ignore-this: d0bdd41c4b618944d04ecb4f54fdd0f1
1744]
1745[Tweak the bindist configure.ac.in
1746Ian Lynagh <igloo@earth.li>**20101120173735]
1747[configure.ac tweaks
1748Ian Lynagh <igloo@earth.li>**20101120170245]
1749[When testing the bindist, tell it where gcc is
1750Ian Lynagh <igloo@earth.li>**20101120155920
1751 The location isn't baked into the bindist, as it may differ from
1752 machine to machine.
1753]
1754[Add -fwarn-lazy-unlifted-bindings to the list of flags
1755simonpj@microsoft.com**20101116172211
1756 Ignore-this: 4f150f347bb74027adacb64545f6b757
1757]
1758[Improve documentation for -fwarn-incomplete-patterns
1759simonpj@microsoft.com**20101116171527
1760 Ignore-this: d8386202cc322207436db0c5b185dab
1761]
1762[Eventlog: Put correct size for startup event
1763scpmw@leeds.ac.uk**20101105151655
1764 Ignore-this: 8b6eb4fa2137c8dfe50c5917e3a609a7
1765]
1766[Omit bogus test for -XDeriveFunctor
1767simonpj@microsoft.com**20101118090028
1768 Ignore-this: a534243011809ebbb788b910961601c5
1769 
1770 It was duplicated in the case of 'deriving( Functor )'
1771 and wrong for 'deriving( Foldable )'
1772]
1773[Move the superclass generation to the canonicaliser
1774simonpj@microsoft.com**20101118120533
1775 Ignore-this: 5e0e525402a240b709f2b8104c1682b2
1776 
1777 Doing superclass generation in the canonicaliser (rather than
1778 TcInteract) uses less code, and is generally more efficient.
1779 
1780 See Note [Adding superclasses] in TcCanonical.
1781 
1782 Fixes Trac #4497.
1783]
1784[Improve error message on advice from a user
1785simonpj@microsoft.com**20101118085306
1786 Ignore-this: bd4f3858ff24e602e985288f27d536f3
1787 
1788 See Trac #4499
1789]
1790[Buglet in tcIface, now that nested binders can have pragmas
1791simonpj@microsoft.com**20101027184235
1792 Ignore-this: de2db50370c35b8ae92ec2574d806b33
1793 
1794 This fix ties the knot for recursive groups properly
1795]
1796[Fix initialisation of strictness in the demand analyser
1797simonpj@microsoft.com**20101026081757
1798 Ignore-this: d89b117caa95b51b6c24584ac03bedf6
1799 
1800 Previously, the demand analyser assumed that every binder
1801 starts off with no strictness info.  But now that we are
1802 preserving strictness on nesting bindings in interface files,
1803 that assumption is no longer correct, because an inlined function
1804 might have a nested binding with strictness set.
1805 
1806 So we need to know when we are in the initial sweep, so that we can
1807 set the strictness to 'bottom'.
1808 
1809 See Note [Initialising strictness]
1810]
1811[Fix the generation of in-scope variables for IfaceLint check
1812simonpj@microsoft.com**20101118090057
1813 Ignore-this: bbcdba61ddf89d07fe69ca99c2017e3f
1814]
1815[Serialise nested unfoldings across module boundaries
1816simonpj@microsoft.com**20101025152817
1817 Ignore-this: 1520586f152501d4acb084ebf9cd3136
1818 
1819 As Roman reported in #4428, nested let-bindings weren't
1820 being recorded with their unfoldings.  Needless to say,
1821 fixing this had more knock-on effects than I expected.
1822]
1823[Nicer error message for #3782
1824benl@ouroborus.net**20101029063320
1825 Ignore-this: fc746cad57410123a29f37f61f13dd3c
1826 It now says:
1827 
1828 ghc-stage2: sorry! (this is work in progress)
1829   (GHC version 7.1.20101028 for i386-apple-darwin):
1830        Vectorise.Builtins.indexBuiltin
1831     
1832     DPH builtin function 'sumTyCon' of size '11' is not yet implemented.
1833     This function does not appear in your source program, but it is needed
1834     to compile your code in the backend. This is a known, current limitation
1835     of DPH. If you want it to to work you should send mail to cvs-ghc@haskell.org
1836     and ask what you can do to help (it might involve some GHC hacking).
1837 
1838 
1839 I added 'pprSorry' that behaves like 'pprPanic' except it say sorry! instead
1840 of panic!, and doesn't ask the user to report a bug.
1841]
1842[Build system tweak: Inline DQ now it's the same on all platforms
1843Ian Lynagh <igloo@earth.li>**20101114134636]
1844[Update to docbook 4.5; fixes trac #4447
1845Ian Lynagh <igloo@earth.li>**20101114155023]
1846[Fix -fwarn-missing-import-lists (fix Trac #4489)
1847simonpj@microsoft.com**20101115232142
1848 Ignore-this: 656b3a76540a488a7111ba7c9ec8ebc4
1849]
1850[Ensure that instance overlap errors are report properly
1851simonpj@microsoft.com**20101115142805
1852 Ignore-this: 2fca29a95bdc69a4c783cbcc663a10f7
1853 
1854 This (annoyingly) requires us to re-flatten the class predicate.
1855 See Note [Flattening in error message generation]
1856]
1857[Fix Trac #4501: a transposition error in DynFlags
1858simonpj@microsoft.com**20101117100832
1859 Ignore-this: b81eca419581a7cec773556514915814
1860 
1861 Push to STABLE
1862]
1863[Fix Trac #4498: bang-pattern bindings are monomorphic
1864simonpj@microsoft.com**20101117101058
1865 Ignore-this: 2a739aeca590b4dd1907078ba80133ff
1866 
1867 This patch forces bang patterns to be monomorphic,
1868 and documents this fact.
1869]
1870[Ensure that unification variables alloc'd during solving are untouchable
1871simonpj@microsoft.com**20101115121540
1872 Ignore-this: 4cdb38180488e605489ce5d018998089
1873 
1874 This fixes Trac #4494.  See Note [Extra TcsTv untouchables] in TcSimplify.
1875]
1876[Document SPECIALISE for imported functions
1877simonpj@microsoft.com**20101117111559
1878 Ignore-this: 5c9e83d15b85fe5a8639321e00e5dcaa
1879 
1880 This is a really useful new facility, but I'd forgotten to document it.
1881 Pls merge to 7.0 branch
1882]
1883[Add a build system dependency; fixes #4357
1884Ian Lynagh <igloo@earth.li>**20101114140311]
1885[Set RELEASE to NO
1886Ian Lynagh <igloo@earth.li>**20101117141621]
1887[TAG GHC 7.0.1 release
1888Ian Lynagh <igloo@earth.li>**20101117140118
1889 Ignore-this: ac737bfbb99523a6e0aa7f7a32727de9
1890]
1891Patch bundle hash:
1892cdb3939dfd7d1a449349979c9d469e1ef887e4cb