Merge fix for #5252.

Based on:

  commit 5bae803a18b17bdb158a7780e6b6ac3c520e5b39
  Author: Simon Peyton Jones <simonpj@microsoft.com>
  Date:   Sat Sep 15 23:09:25 2012 +0100

      Fix UNPACK with -fomit-interface-pragmas.

      We were missing a case, so that you could expose a constructor
      with UNPACKed fields, but the field tpye was trimmed, and hence
      can't be expanded.

      Fixes Trac #5252 (revived)
Fix #7087 (integer overflow in getDelayTarget())

MERGED from commit 598ee1ad1b8de089a2ed207543761d617a90db52
wibbles to #5252.
Merge remote branch 'upstream/ghc-7.6' into ghc-7.6
Build fix on OS X
More OS X build fixes
More OS X build fixes

Conflicts:

	rts/sm/Sanity.c
OS X build fixes
MERGED: Fix building on Sparc/Solaris with non-GNU linker; fixes #5407

commit 9ef4d48e296d4b96492a839f9ee569f8f90c617b
Author: Ian Lynagh <ian@well-typed.com>
Date:   Fri Nov 23 16:54:15 2012 +0000

    Fix building on Sparc/Solaris with non-GNU linker; fixes #5407

    Patch from maeder.
Fix #7231: don't unload stable modules when there is an error later
Wrap a bracket quotation in a coercion that makes it have the right type

This is the right fix to Trac #7276 (part 2), which makes the
interaction with -fdefer-type-errors and TH work properly.
rts: Ignore signal before deleting timer. Fixes #7303.

Was getting an ocassional hang or segfault when building GHC in a
Qemu user space emulation of ARM. Turned out that the ITIMER_SIGNAL
was being delivered *after* the call to timer_delete(). Setting the
signal to SIG_IGN before deleting the timer solves the problem.
Ensure we produce a FunTy for functions (Trac #7312)

The issue here was with a function type written prefix
  (->) a b
where we were not generating a FunTy, which blew the
invariant that function types are always FunTys.  We
can't look at the TyCon directly because it may be
knot-tied, so we look at the name instead.
Fix doc typo; fixes #7318
Be lazier when typechecking data type contexts (Trac #7321)

We should be lazy when type-checking the equality-contraint
part of a data constructor's type, to make the knot-tying
work out right.  The fact that it's always worked before
is a fluke: no one else wrote a GADT whose type index mentions
itself
  data T a wher
    MkT :: T (T Int)
Improve reporting of duplicate signatures

Fixes Trac #7338
Fix bug with reporting deprecated use of flag (Trac #7349)
Fix the instantiation of data constructors in the GHCi debugger

This bug caused Trac #7386, because in the (rather tricky) "type
inference" (aka run time type reconstruction) done by the GHCi
debugger, we were failing to instantiate a data type family
correctly.  When that code was written we didn't *have* data
families.

I wrote Note [Constructor arg types] to explain the new scheme.
Use the right environment for tidying the types of a data constructor

Fixes Trac #7438
Make sure that we check for type errors strictly in a Template Haskell splice, even if -fdefer-type-errors is on

We're going to run this code, so there's no point in deferring type
errors.  Worse, TcSplice uses unsafeCoerce (for vevy good reasons),
so splicing a type into a place where an expression is expected would
yield a seg-fault if we plough on regardless.

Fixes Trac #7276