Restore cross-compilation with CLISP.

Due to WHILE before FOR in a LOOP in sb-impl::split-version-string.

Reported by Vasily Postnicov.
Really restore clisp cross-compilation.

Some more loop madness.

Patch by Vasily Postnicov, lp#1261451.
external-formats: Add support for MacRoman character encoding.

  * This is rarely used these days, having been supplanted by the
use of UTF-8 with the adoption of OSX, but it is occasionally seen
"in the wild", or if someone has an interoperability concern with
antique macs.  I was rather surprised to encounter a CSV file
recently, with data for an event in May of 2013, that happened to
be MacRoman encoded, and then further surprised to find that SBCL
had no support for the encoding.

  * I have tested this interactively only, using OCTETS-TO-STRING
to verify that a sequence of the upper half of the 8-bit encoding
space was correctly mapped to unicode characters.
gencgc: Reduce conservatism for pointers to unboxed pages.

  * Because return addresses are unmarked, unboxed interior
pointers must be allowed to pin if they point within a code object.
Assuming that code objects are only allocated to CODE_PAGE_FLAG
pages, preserve_pointer() will allow any code_page_p() true page
to be pinned by any pointer to within its body.

  * But code_page_p() was broken, being an alternate version of
page_allocated_p() in implementation, with no warning or comment.
The net effect is extra conservatism: Any pointer to allocated
space will pin whatever page it points to.

  * Code pages aren't always allocated to CODE_PAGE_FLAG pages,
for a couple of reasons.  Until we can maintain such an invariant,
we can only use the weaker version (which DOES hold): code objects
are always allocated to boxed pages (either BOXED_PAGE_FLAG or
CODE_PAGE_FLAG, never FREE_PAGE_FLAG or UNBOXED_PAGE_FLAG).

  * Reduce conservatism in the GC by making code_page_p() delegate
to page_boxed_p(), thus tightening up the test for pinning unboxed
pages.

  * Also leave the "correct" logic for code_page_p() in place but
disabled (and make it actually BE correct), and add a comment
explaining part of what's going on.
Handle run-program with :directory nil.

Handle :directory nil as advertised, not changing the current directory.

Fixes lp#1265077.
gencgc: Extract go/no-go decision logic from preserve_pointer().

  * Approximately 1/pi of preserve_pointer() is involved in
verifying that the candidate pointer is valid as a conservative
root.  This is easily extractable logic that acts as a predicate,
so box it up as one, calling it as a guard clause from where it
originally stood.
gencgc: Simpler conservative root validation on non-x86oids.

  * On "precise" gencgc targets (currently, non-x86oids), we only
ever treat valid object pointers as conservative (pinned) roots,
so most of the validity checking is unnecessary.

  * Add a shortcut path through valid_conservative_root_p() for
this precise case.
gencgc: More precise conservatism for pointers to boxed pages.

  * The commentary for possibly_valid_dynamic_space_pointer()
claims that it matches unboxed return addresses (to within code
objects), but this turns out not to be the case.

  * Fix the code to match the comment, at least somewhat, by
checking to see if the object found is a code object and
shortcutting the full validation if it is.

  * And, now that we have a version of p_v_d_s_p() that does the
"right thing", or at least close to it with respect to the only
truly unboxed interior pointers that we should have to deal with,
call it straight up instead of only for unboxed pages when we have
a true pointer type.

  * Overall, this can be expected to be slower than the prior
version, but more precise in terms of rogue integers in the heap
range.  The remaining conservation effects would be due to the
fact that we can't move ANYTHING that's a conservative root and
stale pointers within our active area (truly precise ports are
less affected by this because they can relocate objects pointed to
by stale pointers).
gencgc: Pick out shrunk object tails earlier in conservative root logic.

  * BIGNUM and VECTOR objects can be allocated overlarge and then
shrunk once the actual required length is known.  This leaves a
"tail" of dead (0 . 0) CONSes.  When this happens in large-object
pages (as opposed to normal pages), we can see that this has
happened and treat any pointer to such objects as not being a
conservative root.

  * Unfortunately, where we currently perform this test we don't
have enough information available to easily say that the reference
is definitely to one of these dead objects, so we use a more
conservative test than strictly required.

  * Add another test for the same situation, but earlier in the
logic, and using a more precise test, so that we can skip a bit of
extra work in such (rare) cases, and so that we can simplify the
overall logic.
gencgc: code_page_p() must die!

  * The last call site for code_page_p() is now a redundant test
for a specific (non-critical) edge case in the logic for dealing
with conservative roots, so kill it.

  * And now that nothing calls code_page_p(), kill it before it
has a chance to maul any other SBCL hackers.
Optimize MAKE-ARRAY on unknown element-type.

Reimplement %vector-widetag-and-n-bits without using subtypep,
providing an order of magnitude speed up.

Out of line make-array :element-type 'character also caused to cons
twice larger than needed vectors on x86-64.
(Though that wasted space was reclaimed after GC).

Closes lp#1004501.
Restore PPC build.

Adjust register lifetime in calling VOPs.

Thanks to Alastair Bridgewater.
Fix the recent %vector-widetag-and-n-bits change.

Handle extended-char, interval type designators, and union types.
UPGRADED-ARRAY-ELEMENT-TYPE: more thoroughly signal errors on unknown types.

Intersection and union types containing unknown types were handled incorrectly.
(upgraded-array-element-type '(and fixnum unknown)) => was FIXNUM.
better encapsulation support in generic functions

It's not very nice to alter the fdefinition of names which refer to
generic functions: it might not be strictly required by the spec, but
preserving the class of generic functions when encapsulated is more
friendly, so that attempts to trace or profile them doesn't break any
metaobject protocol logic which refers to particular functions by
name.  Fortunately, it's fairly straightforward to
support (un)encapsulation of generic functions through adapting the
discriminating function instead.
Fix make-array transforms.

Don't call UPGRADED-ARRAY-ELEMENT-TYPE on types without checking that
they don't contain unknown types (i.e., intersections or unions
containing unknown-type), since U-A-E-T now signals errors for these.

Reported by Bart Botta.
run-program: Don't check element-type of :output/:input streams.

Instead of checking ahead of time that stream-element-type is
compatible with unsigned-byte-8 buffers, rely on
write-sequence/read-sequence to signal any type errors, while wrapping
them in handler-bind to resignal errors with more context.
Optimize sb-bsd-sockets a bit.

Add declarations and rearrange some code to reduce consing.
Fix format argument handling of ASSERT-SYMBOL-HOME-PACKAGE-UNLOCKED

* ASSERT-SYMBOL-HOME-PACKAGE-UNLOCKED was already used as if it
  accepted an optional format string and format arguments, but that
  was not the case, previously

* ASSERT-SYMBOL-HOME-PACKAGE-UNLOCKED has been slightly simplified
Simplify report function of PACKAGE-LOCK-VIOLATION