Patch by lukexi.

Fixing #8217 for the unix(-like) case.
Improve Linting in GHCi (fixes Trac #8215)

The original problem was that we weren't bringing varaibles bound in the
interactive context into scope before Linting the result of a top-level
declaration in GHCi.  (We were doing this for expressions.)

Moreover I found that we weren't Linting the result of desugaring
a GHCi expression, which we really should be doing.

It took me a bit of time to unravel all this, and I did some refactoring
to make it easier next time.

  * CoreMonad contains the Lint wrappers that get the right
    environments into place.  It always had endPass and lintPassResult
    (which Lints bindings), but now it has lintInteractiveExpr.

  * Both use a common function CoreMonad.interactiveInScope to find
    those in-scope variables.

Quite a bit of knock-on effects from this, but nothing exciting.
Comment only
Comments and type synonym in CmmSink
Fix #7918
Allow non-Nominal covars (bugfix)
Make validate play nice with clang (for Xcode 5 command line tools)

* This partially fixes #8148. However, --with-ghc-4.8 will still not work given the rather dubious m4 macros and the failures in the test suite due to '-nodefaultlibs' still need to be fixed.
Hack-fix build breakage on Linux/GCC from fc4856f9

For some reason, the new `GccIsClang` variable introduced via
fc4856f9e811d9a23ae9212f43a09ddf5ef12b26 for addressing #8148
isn't set explicitly to `NO`; so this simply changes the test
`ifeq $(GccIsClang) NO` to `ifneq $(GccIsClang) YES` which
should fix the build with and w/o Clang.
Don't move Capabilities in setNumCapabilities (#8209)

We have various problems with reallocating the array of Capabilities,
due to threads in waitForReturnCapability that are already holding a
pointer to a Capability.

Rather than add more locking to make this safer, I decided it would be
easier to ensure that we never move the Capabilities at all.  The
capabilities array is now an array of pointers to Capabaility.  There
are extra indirections, but it rarely matters - we don't often access
Capabilities via the array, normally we already have a pointer to
one.  I ran the parallel benchmarks and didn't see any difference.
Fix printf formats for pathchar on Windows (where it's wchar_t, not char)
Don't refer to oc->next after freeing oc.
Fix over-eager unpacking in isUnpackableType

This bug meant that we tried to unpack Link in

  data Link a = MkLink !(Link a)

when -funbox-small-strict-fields was on.  See Trac #8221.
Improve debug tracing a bit
Put the interface-file typechecking of IfUnpackCo inside forkM

Now that IfBangs can contain coercions, which can mention the
very type being typechecked, the tc_strict call must be inside
forkM. This led to Trac #8221
Make role inference work on the source type of a data con

When inferring roles it is Much More Kosher to work on the source
type, as written by the user, rather than the representation type as
computed by GHC.  Error messages may be better and, more subtly, the
representation type is the result of a pretty complicated calculation
and I'm worried about accidental cycles.
Fix definition of DefinerOfRegs for CmmForeignCall

And update comments
Turn manual Typeable instances into errors; fixes #8132
Add --show-options to --help (#8190)

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Remove -fglasgow-exts from --help

It's been deprecated for who knows how long, and gives a warning.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Make sure -fcmm-sink is passed to Parser properly

Parser.hs needs to be compiled with -fcmm-sink on x86 platforms, so the
register allocator doesn't run out of stack slots. Previously, we had to
do some CPP hacks in order to emit an #ifdef into the file - this is
because we preprocess it once up front, and run the preprocessor again
when we compile it.

There's two cases: the boostrap compiler is > 7.8, and the stage1 parser
needs the flag, or the stage1 compiler is compiling the stage2
Parser.hs, and needs the flag..

The previous approach was super fragile with Clang. The more principled
fix is to instead do this through the build system.

This fixes #8182.

Signed-off-by: Austin Seipp <aseipp@pobox.com>