Extract derived constants from nm output for various OSes differently.

Fixes #8783.

In order to avoid querying the nm version that does not work on Mac OS X
we use the "nm -P" output that is supposed to produce (more portable)
POSIX output and works on all tested OSes (MinGW, Mac OS X, Solaris and
Linux using GNU nm) although slightly different (as documented). The "nm
-P" output is actually only needed to recognize the output of a non-GNU
Solaris nm (all other OSes produce sane outut using "nm" only).

Signed-off-by: Austin Seipp <austin@well-typed.com>
Add missing stack checks to stg_ap_* functions (#9001)

(cherry picked from commit fc0ed8a7309e7cc863b8155fae6b57cb23331c44)

Conflicts:
	testsuite/tests/codeGen/should_run/all.T
Only uninstall signal handlers if they were actually installed (#9068)

Submitted by: tomgr

(cherry picked from commit bc7d49a658a516679cc264502e72560c1d2c2314)
rts: remove stable-names from hashtable upon free

This fixes #9078.

Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit b75d126e779e8690c675be84e8972dc023e04b9b)
Fix missing unlockClosure() call in tryReadMVar (#9148)

(cherry picked from commit 96a95f0513de785a185fd8a46c7ed2643f698295)
annth_make, annth_compunits: Only run these tests if have_dynamic()
Add ".text.unlikely" to recognized code sections on Windows.

Fixes #9080

Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit 56ea745c3dd00c87ad86b80f91a31ced5e86e488)
Fix discarding of unreachable code in the register allocator (#9155)

A previous fix to this was wrong: f5879acd018494b84233f26fba828ce376d0f81d
and left some unreachable code behind.  So rather than try to be clever and
do this at the same time as the strongly-connected-component analysis, I'm
doing a separate reachability pass first.

(cherry picked from commit e577a52363ee7ee8a07f1d863988332ae8fbf2e4)
Fix compilation of cmm files with -outputdir (Trac #9050)

(cherry picked from commit 2a463ebeba4dff6793ae16707712f1e9245225e8)
Emit error in case of duplicate GRE; fixes #7241

Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit c226d25fef519db663d0c9efe7845637423f1dca)

Conflicts:
	testsuite/tests/th/all.T
Fix obscure problem with using the system linker (#8935)

See Note [RTLD_LOCAL] for a summary of the problem and solution, and

(cherry picked from commit 2f8b4c9330b455d4cb31c186c747a7db12a69251)
7.8.3 release notes.

Signed-off-by: Austin Seipp <austin@well-typed.com>
Ship xhtml, terminfo, haskeline (#8919)

Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit 4caadb7cbee5c176abb99df25c4cc1657ae57f40)
Release notes

Signed-off-by: Austin Seipp <austin@well-typed.com>