Fix array.sort.

array.sort was broken since 2001 when the implementation was changed
from merge sort to SAM sort.

library/array.m:
	Fix the confusion as to which output argument of samsort_up is
	sorted.

	Add optional runtime checks of the pre- and post-conditions
	of samsort_up and samsort_down when built with a trace flag.

	Add array.sort_fix_2014.

tests/hard_coded/Mmakefile:
tests/hard_coded/array_sort.exp:
tests/hard_coded/array_sort.m:
	Add test program.

NEWS:
	Announce the fix.
boehm_gc: Apply upstream BoehmGC changes for lock elision bug workaround

This code was written by Ivan Maidanski <ivmai@mail.ru> in response to my
patch to the the Boehm GC to work-around the lock elision bug in glibc.

Fix and code refactoring of lock elision workaround (Linux/x64)
https://github.com/ivmai/bdwgc/commit/3d342554dc03af8d27925706a6513080995e1904

boehm_gc/private/gcconfig.h:
    + (GLIBC_2_19_TSX_BUG): New macro defined for Linux/x86_64 (if Glibc
      used) to workaround a bug in Glibc lock elision implementation.

boehm_gc/misc.c:
    + (GC_init): Reformat code.

boehm_gc/pthread_support.c:
    + Move include of gnu/libc-version.h to gcconfig.h (used to check
      whether lock elision workaround needed).

    + (mark_mutex): Initialize (to PTHREAD_MUTEX_INITIALIZER) even lock
      elision workaround is needed (revert change in previous commit).

    + (parse_version): New static function (defined only if
      GLIBC_2_19_TSX_BUG).

    + (GC_setup_mark_lock): Use parse_version to check target Glibc version
      properly; do not reinitialize mutex unless workaround needed; call
      ABORT (with the appropriate message) in case of a failure in
      pthread_mutexattr_init/settype, pthread_mutex_init.
boehm_gc: Use PTHREAD_MUTEX_NORMAL in the lock elision bug workaround

Peter Wang found that PTHREAD_MUTEX_NORMAL is sufficient to disable lock
elision for a mutex and avoid comprimising performance with
PTHREAD_MUTEX_ERRORCHECK.

I'll be writing to Ivan to let him know about this change.

boehm_gc/pthread_support.c:
    As above.
boehm_gc: Fix declration of setup_mark_lock()

These patches have been applied to upstream boehm_gc by Ivan Maidanski.
We're applying them here as we're tracking their fixes for the TSX lock
elision bug.

boehm_gc/pthread_support.c:
    Rename GC_setup_mark_lock() to setup_mark_lock() and make it static.
    Add static declration of setup_mark_lock();
    Call setup_mark_lock() while setting up parallel marking.

boehm_gc/include/private/pthread_support.h:
    Remove declaration of GC_setup_mark_lock();

boehm_gc/misc.c:
    Remove call to GC_setup_mark_lock();
boehm_gc: Enable the TSX bug workaround on x86

Jan Alexander Steffens made this change to upstream boehm_gc.

boehm_gc/include/private/gcconfig.h:
    As above.