Do not assert that the integer returned by UNIX-ISATTY is a BIT
Fix the single-threaded Windows build

For this release, we purport to support Windows without threads as
an option.  Make it so.
1.1.1: will be tagged as "sbcl-1.1.1"
Allow synchronous win32 I/O to be interrupted, too

... if and only if running on a version of Windows new enough to
support doing so.  Two scenarios come to mind where synchronous (i.e.
non-overlapped) I/O might matter:

  - There is one kind of HANDLE which is never overlapped: Unnamed
    pipes.  Unlike named pipes, the feature added by this commit is
    our only option of interrupting I/O on the former.

  - User code might pass in a HANDLE through MAKE-FD-STREAM without
    the right flag set.  In principle, non-interruptibily of such a
    HANDLE is a bug in said user code, but it doesn't hurt to deal
    with these correctly as a side benefit.  (The only Windows
    releases which support re-opening of a HANDLE with the right
    flag also have the functions needed by this commit.)

One downside for users might be an element of surprise, in that the
same SBCL binary will exhibit the presence or lack of features,
respectively, when started on recent Windows or old Windows.  However,
the advantages of offering the feature seem to me to outweigh that
disadvantage.

Thanks to Anton Kovalenko.
Windows console I/O overhaul

  - Make non-interruptible I/O interruptable by means of a
    background thread.

  - Fixes lp#308923.

  - Use Unicode in stdio streams.

Thanks to Anton Kovalenko.
Move the global safepoint to one page before static space

New attempt at finding an optimal location for the global safepoint
page.  Hopefully this solution will cover all our use cases for
the foreseeable future.

  - Relative to static space for architectures with small immediates.

  - Also addresses the requirements of sb-dynamic-core, which needs
    the safepoint to have an absolute address on x86(-64).

Hence, a new macro !gencgc-space-setup -- tweaks space parameters to
squeeze in the safepoint page, while also simplifying parms.lisp for
some platforms.
Extend use of the linkage table to static symbols

  - Formerly static symbols are static no more:

  - Always use the linkage table, even in cross compilation.  The
    runtime retrieves the resulting list of foreign symbols and installs
    linkage table entries before calling into Lisp for the first time.

  - Simplify/remove various win32 foreign symbol special cases.

  - Almost remove scratch().

Conditional on feature SB-DYNAMIC-CORE; required on Windows and optional
on other platforms supporting the linkage table.

With this feature, changes to src/runtime can be built using make,
without requiring a slam.sh step to update core files.

For LINKAGE-TABLE platforms only.  Currently supported on x86 and
x86-64.  (PowerPC does not yet work.)  In the interest of simplicity,
disable this feature permanently on non-SB-THREAD platforms, because
these would require unpleasant changes to allocation macros.

Thanks to Anton Kovalenko.
Update NEWS; explain Windows system requirements
Safepoint protocol upgrade

Upgrade to the new stop-the-world protocol from the Windows branch,
dating back to late 2011, an all-in-one readability and correctness
improvement.

Replace per-thread qrl locks with one process-wide lock for all
operations relating to GC state and the threads' CSP area.  Use
condition variables for notifications on GC state changes.

Thanks to Anton Kovalenko.
sb-concurrency: frlocks
alien type improvement: handle offsets in unparse-alien-record-type

Previously, when recomputing the offset to struct fields we would
ignore the offset and attempt to recompute it, occasionally getting it
wrong. Now store the offset in uparse-alien-record-field and use in
parse-alien-record-fields.

Also, fix some comment typos.
compiler/sparc/arith: Fix SCs for FAST-EQL{,-C}/FIXNUM.

  * There's a KLUDGE in build-order.lisp-expr wherein failures
when building this file are ignored.

  * The failures are specifically an SC vs. arg-type mismatch for
the FAST-EQL/FIXNUM and FAST-EQL-C/FIXNUM VOPs.

  * Fix the mismatch by altering the VOP definitions to match what
the MIPS backend uses (since it doesn't have the failure).

  * And remove SPARC from the reader conditional on the KLUDGE.
compiler/generic/genesis: Report FDEFN addresses for undefined functions.

  * In order to make debugging bootstrapping problems easier,
include the address of FDEFNs which have not been defined in the
cold-sbcl.map file.  This address is what shows up in ldb when
such an FDEFN is invoked.
Thou shalt not MAKE-OTHER-IMMEDIATE-TYPE.

  * Really, it's only ever used to make unbound-markers, for which
we have MAKE-UNBOUND-MARKER, which produces more optimal code in
the first place, has a shorter invocation, and reveals intention
far better than using MAKE-OTHER-IMMEDIATE-TYPE.

  * Rewrite all uses of MAKE-OTHER-IMMEDIATE-TYPE, excise the VOPs
from all of the backends, and remove the symbol name from package-
data.

  * And add DESCRIPTOR-REG to the permitted SCs for
MAKE-UNBOUND-MARKER, since it now must be legal to use a TN of
primitive-type T.
runtime/cheneygc.c: Use binding-stack-pointer access macro.

  * Rather than access current_binding_stack_pointer (a global
variable) directly, use access_binding_stack_pointer() (a macro
defined in thread.h).
runtime/thread.h: Fix non-thread binding and control stack pointer access.

  * In the non-threaded case, these macros used to break up into two
groups, one for x86oids and one for everything else.  This is wrong
just as soon as a non-x86oid port uses a static symbol for the binding
stack pointer.

  * Reorganize the non-threaded cases to parallel the structure of the
threaded case, dispatching on the presense of the static symbol for
binding stack access and specifically detecting non-x86oids for the
control frame pointer access.
mips: Revert remaining badness from 0.9.1.45.

  * There were two pieces of badness in 0.9.1.45, both to do with
the call_into_lisp LRA handling, and each compensated for the other
to a limited extent.  One change (since reverted) was to decrease
the alignment requirement on positioning the LRA header, allowing
it to be placed on a non-doubleword boundary.  The second change
(being reverted here) was to change the LRA address calculation to
subtract the entry point offset from the address of the header
instead of adding OTHER_POINTER_LOWTAG.  If the header wound up on
a doubleword boundary (the correct alignment) then the LRA computed
would have LIST_POINTER_LOWTAG, leading to badness when doing a
backtrace.  In any event, typechecking the resulting LRA would
fail, and actually attempting to return to it would also fail.

  * Revert to computing the LRA by adding OTHER_POINTER_LOWTAG to
the address of the header, bringing MIPS inline with all of the
other RETURN-PC-HEADER (LRA) using backends.
PowerPC safepoints

"I saw it almost pass tests once.  Ship it."

Rough PowerPC port of sb-safepoint and related features.  Occasional
issues remain (see comment in test suite).

  - Sprinkle fake_foreign_function_call fairy dust over safepoint code.

  - Use the CSP page for synchronization, but not for its value.

  - No altstack, hence no tricks to escape from it.

  - Remove workarounds related to the SIGALRM handler; but keep
    SIGINT happy for now, with a somewhat less questionable check.
Further work towards use of win32 file HANDLEs

Expose the fact that we are working with file handles (not simulated
file descriptors), and directly store those handles in fd-streams.

Represent them as integers (not SAPs) to avoid needless
incompatibilities between POSIX and Windows builds.  However, adjust
types so as to remove fixnum assumptions.

Includes some further tweaks to file-related foreign definitions
(and run-program in particular), to remove remaining uses of CRT
when possible.

Does not add any `feature' to help user code distinguish between
this SBCL and versions prior to this change using read-time
conditionals, since the changes are, in principle, not considered
user-visible.  (We are now unconditionally running the equivalent of
what is marked #!+fds-are-windows-handles on the Windows branch.)

To avoid breaking any user code that might have learned to retrieve
handles from our streams previously, preserve "osf handle"
conversion functions as trivial identity definitions for a while.

Thanks to Anton Kovalenko.
Forcibly fail frlock.1 on Windows by means of a timeout

Presumably due to windows sb-thread bugs, this test often hangs on
Windows.  For now, establish a timeout, and mark the test as a known
failure on this platform.