OS X: use mmap() instead of malloc for allocating the bss (#7040)

MERGED from commit e590ad77f9596a8389409ae56ea902c97e5dbfb0
Make badImportItem into a warning (#7167)

Also fix a bug where a dodgy import warning was emitted for data
families with a single constructor.

MERGED from commit 3d7c81a4be00a6d72b321b4811ab316ea3301a60
Improve Safe Haskell warn/error output.

MERGED from commit 2b5b178f4880b8034ef8c187e6227cfc09edf0d5
Fix :issafe command (#7172).

MERGED from commit 93e8ae26e42fbe9e600db125182d7823a78e2925
Fix missing case in coVarsOfTcCo

Reported by Ganesh, Trac #7178.  Fix is easy.

MERGED from commit a0788a8b2ba19b7f3205010a71472342a75395f8
Fix for optimizer bug on linux-powerpc (#6156).

MERGED from commit b4b78631890a4cd9cde1551de9a4440e7e750372
Retain ordering of finalizers during GC (#7160)

This came up since the addition of C finalizers, since Haskell
finalizers are already stored in an explicit list.  C finalizers on
the other hand get a WEAK object each, so in order to run them in the
right order we have to make sure that list stays in the correct
order.  I hate adding new invariants, but this is the quickest way to
fix the bug for now.  A better way to fix it would be to have a single
WEAK object with a list of finaliers attached to it, and a primop
for adding finalizers to the list.

MERGED from commit cec899d9fb668d4adccf731a63902e5be49f0660
Don't assume that coercion variables have (~) types

The constraint solver doesn't zonk the types of coercion variables
so we can't assume that a coercion variable will have a (~) type.

Fixes Trac #7090.

MERGED from commit d6918e9072e421178d59cd13ee352337a4090c39
Fix Trac #7092, involving Template Hsakell and name shadowing

All the mechanism was there, but it wasn't being use for the
name-shadowing test.

MERGED from commit b2e8bed817483e80d721cc69720d3d547edab4f5
Don't specialise on implicit-parameter arguments in Specalise

This is a fix for Trac #7101

MERGED from commit 2f08f709cfdace23a4e32d80a57af349f7cc785a
Profiling: open .prof when -hr<cc> is specified

The code for retainer profiling is used with e.g. +RTS -hc -hrfoo -RTS,
as well as with +RTS -hr -RTS.

MERGED from commit 4e0a957758af94bc39ff51814bad54faf96a94b9
Re-jig the reporting of names bound multiple times

Fixes Trac #7164

MERGED from commit 2c6d11fa17ff5cab7d62e6dbea3fc9e501fce7f3
Two small fixes to SpecConstr for functions with equality-proof args

First, make Rules.match_co able to deal wit some modest coercions
Second, make SpecConstr use wild-card for coercion arguments

This is the rest of the fix for Trac #7165

MERGED from commit b04ff2fe83d8a5f9c176739559ac722521a7bdcc
Refactor the way we infer types for functions in a mutually recursive group

See Note [Impedence matching] in TcBinds.
Fixes Trac #7173

MERGED from commit 1a591a0ce0e1b70eb5e6646542d5f110bfefc9af
Fail earlier if there's an error in a type declaration

This change means that we don't recover from erroneous type
declarations, thereby reporting fewer errors.  But trying to
recover confused GHC (leading to a pattern match failure in
the compiler Trac #7175), and it turned out to be tricky
to fix that.

So this patch takes the more conservative path of failing
earlier, perhaps reporting fewer real errors.

MERGED from commit d0ddde58f928a6b156d8061c406226c4fbb7cd22
Emit a warning for -rtsopts -shared, as well as -rtsopts -no-hs-main

-rtsopts has no effect with -shared, so we should emit a warning.  See
 #5373 and #7177.

MERGED from commit 9a3c8bd700a63dadcf1e238408b490908cbf6765
Fix Trac #7196 by adding a case to the desugarer

Pls merge to 7.6

MERGED from commit f27c631a16a17b8ad740d7d28c6ff267fb189c2c