Terminate in forkProcess like in real_main

Test Plan: validate

Reviewers: simonmar, austin

Reviewed By: simonmar, austin

Subscribers: phaskell, simonmar, relrod, carter

Differential Revision: https://phabricator.haskell.org/D99

GHC Trac Issues: #9377
docs: fix typo: 'OVERLAPPINGP' -> 'OVERLAPPING'

Summary: Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

Test Plan: proofread

Reviewers: ezyang, austin

Reviewed By: ezyang, austin

Subscribers: phaskell, ezyang, simonmar, relrod, carter

Differential Revision: https://phabricator.haskell.org/D100
Use 'install' command for 'inplace/' install as we do in 'make install'

Summary:
On hardened gentoo ghc-stage2 does not work as-is,
as it uses runtime code generation/loading, thus
ghc0stage2 needs to be marked in a special way
(via POSIX extened attributes).

Before the patch we used 'cp -p' command, which
does not preserve that marking. It leads to buid
failure on hardened. Hardened's 'install' does
preserve POSIX xattrs, thus patch uses it instead.

'inplace/' directory can be seen the same way as target
for 'make install', thus using the same facilities
to install files to 'inplace/' sounds more consistent.

Reported-by: Jay Yang
Gentoo-bug: https://bugs.gentoo.org/518734
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

Test Plan: tested ghc installation on vanilla and hardened distributions

Reviewers: austin

Reviewed By: austin

Subscribers: phaskell, simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D108
fix linker_unload test on Solaris/i386 platform

Summary:
This patch set fixes two issues in linker_unload test case
on Solaris/i386 platform. First there is an issue in linker_unload.c
which causes warning to be emitted about _FILE_OFFSET_BITS redefined.
This is solved by including ghcconfig.h as a first header file.
Another issue is that on Solaris and its builders we use to configure
ghc with --with-gmp-libraries=/usr/lib and this causes issue with
test case Makefile's logic. It attempts to start linker_unload
and pass it HSinteger-gmp library for unload, but the library
name is prefixed with two directories names. The first is of
ghc's integer-gmp/build itself and another is the directory name
passed to --with-gmp-libraries= configure parameter. In case
of Solaris this is /usr/lib. The testcase then fails on unloading
integer-gmp/build directory thinking that this is a library to unload.
This issue is solved by cuting the first library name from the list
and using this for unloading the HSinteger-gmp library.

Test Plan: validate

Reviewers: ezyang, austin

Reviewed By: ezyang, austin

Subscribers: phaskell, simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D110
ghc --make: add nicer names to RTS threads (threaded IO manager, make workers)

Summary:
The patch names most of RTS threads
and ghc (the tool) threads.

It makes nicer debug and eventlog output for ghc itself.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

Test Plan: ran debugged ghc under '+RTS -Ds'

Reviewers: simonmar, austin

Reviewed By: austin

Subscribers: phaskell, simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D101