Fix GHCi macros not shadowing builtins (#8113)

This restores the original behaviour that was broken accidentally during
the refactoring peformed via 4f764d06f3b9899c09a6a459a22d4be694ee45d9.

This has been broken effectively for all GHC 7.6.x releases.
Fix i386/Linux build.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Fix build on non-unicode locale

happy reads .y files with the system encoding, so keep Parser.y.pp ASCII.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Add support for iOS simulator (issue #8152).

The iOS simulator is essentially an iOS target but for an x86 machine
instead. It doesn't support the native code generator either, though.

Authored-by: Stephen Blackheath <...@blacksapphire.com>
Signed-off-by: Austin Seipp <aseipp@pobox.com>
Delete trailing whitespace in mk/config.mk.in

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Delete trailing whitespace in aclocal.m4

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Delete trailing whitespace in LlvmCodeGen/Ppr.hs

Signed-off-by: Austin Seipp <aseipp@pobox.com>
UniqSupply: make genSym thread-safe
TcRnMonad: make forkM thread-safe

A forkM'd action cannot safely share a UniqSupply with its parent.
FastString: make the string table thread-safe

While we're at it, consolidate duplicate code into a helper function and
strictify a few arguments.
SysTools: make various functions thread-safe
TidyPgm: Atomically update the NameCache in tidyTopName
Binary: Make lazyGet more thread-safe

All values read lazily from the same BinHandle share the same mutable
offset variable (_off_r). If two such lazy values are simultaneously
evaluated, the two threads will step over each other when writing to
_off_r.

Fortunately, for BinMem handles, making lazyGet thread-safe is simple:
just use a fresh off_r variable when deferring the call to getAt.

For BinIO handles, a race condition still exists because IO handles
contain their own mutable file pointer variable that gets clobbered in a
similar way that _off_r would. But GHC doesn't use BinIO handles anywhere
so this particular issue could be ignored for now.
TcEnv: Make mkWrapperName deterministic and thread-safe
Make stdout and stderr line-buffered

An unbuffered handle is very slow to output to and there doesn't seem to
be any reason to have these handles unbuffered.
Implement the parallel upsweep (#910)

The parallel upsweep is the parallel counterpart to the default
sequential upsweep. It attempts to compile modules in parallel by
subdividing the work of the upsweep into parts that can be executed
concurrently by multiple Haskell threads.

In order to enable the parallel upsweep, the user has to pass the -jN
flag to GHC, where N is an optional number denoting the number of jobs,
or modules, to compile in parallel, like with GNU make. In GHC this just
sets the number of capabilities to N.
Binary: eradicate BinIO handles

They are not used anywhere in the compiler.
Properly handle import loops in the parallel upsweep
Buffer stdout and stderr when we're compiling via GHCi