Avoid generating empty llvm.used definitions.

LLVM 3.3rc3 complains when the llvm.used global is an empty array, so don't
define llvm.used at all when it would be empty.
Typo in hp2ps help output

As spotted by Julian Gilbey and reported at http://bugs.debian.org/710305
--show-options lists all flags. Add user documentation for #7843
Cleaning fixes, and other build system tweaks; part of #7941
Whitespace only in rts/storage/SMPClosureOps.h
Optimization for takeMVar/putMVar when MVar left empty; fixes #7923

We only need to apply the write barrier to an MVar when it acquires
a reference to live data; when the MVar is left empty in the case
of a takeMVar/putMVar, we can save a memory reference.

Patch from Edward Z. Yang.
Allow multiple C finalizers to be attached to a Weak#

The commit replaces mkWeakForeignEnv# with addCFinalizerToWeak#.
This new primop mutates an existing Weak# object and adds a new
C finalizer to it.

This change removes an invariant in MarkWeak.c, namely that the relative
order of Weak# objects in the list needs to be preserved across GC. This
makes it easier to split the list into per-generation structures.

The patch also removes a race condition between two threads calling
finalizeWeak# on the same WEAK object at that same time.
Check for a weak pointer being dead before we do any allocation for it
Maintain per-generation lists of weak pointers (#7847)
Add braces for clarity
Whitespace and braces only
Optimise lockClosure when n_capabilities == 1; fixes #693

Based on a patch from Yuras Shumovich.
Fix ghci crash when the user code closes stdin

Now that we share stdin with the program, we have to check for
handle-closed as well as EOF, as the program might have closed
stdin.
Detect linker information at runtime. Fixes Trac #6063

Previously, we did ./configure time checks to see if 'GNU ld' supported
certain options. If it does, we bake those options into the link step.
See Trac #5240.

Unfortunately, the linker we use at runtime can change for several
reasons. One is that the user specifies -pgml 'foo'. The other is if
/usr/bin/ld or whatnot changes from when GHC was built.  Those options
mentioned earlier are specific to GNU ld, but many systems support GNU
gold too. This is Trac #6063.

So we need to check at runtime what linker we're using. This is actually
a little bit complicated because we normally use the C compiler as our
linker. Windows and OS X are also special here.

Finally, this patch also unconditionally gives '--hash-size=31' and
'--reduce-memory-overheads' to the system linker if it's GNU ld. These
options have been supported for 8+ years from what I can see, and there
are probably a lot of other reasons why GHC would not work with such an
ancient binutils, all things considered.

See Note [Run-time linker info] in SysTools for details. There are
plenty of comments as well in the surrounding code.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Release note blurb for Linker fixes.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Add some missing clang bits to the build system.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Work-around clang weirdness by adding a newline.

I really wish this were a joke, but alas...

This gets me a working stage1 compiler on Linux with Clang with no
modifications. Unfortunately it won't get much farther than that for
various other reasons.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Use ideclImplicit to filter out only *implict* Prelude imports (Trac #7963)

The ideclImplicit flag didn't exist before, but it does now,
and it makes this code simpler and makes it easy to fix Trac #7963.
Emit addUsedRdrNames for the datacons in a standalone deriving (Trac #7969)
Remove redundant import, revealed by the fix to #7963