In bisect{,-runner}.pl, refactor the code for CPU probing and make jobs.

Move the code that attempts various ways to probe for the number of CPUs
from bisect-runner.pl to bisect.pl. Skip the probe entirely if a -j (--jobs)
options is passed to bisect.pl. For --jobs=0 (or -j0) entirely skip adding
-j to the make command line. (For heretical versions of make which don't use
-j for parallelism).

Previously the probe code always ran for each call to bisect-runner.pl,
which is completely redundant if bisect-runner.pl is being called for
argument validation or help text, and inefficient even when building, as the
number of CPUs rarely changes during a bisect run. Additionally there was no
way to avoid a -j in the make command line, which isn't going to fly on
systems where the make utility doesn't have a -j option.
On HP-UX, bisect without any -j option as the system make is "special".

HP-UX system make offers parallelism with -P not -j. (But doesn't deliver on
it, so we're not going to attempt to work round its crankiness and failings.)
bisect-runner.pl needs to know how to identify HP-UX's patch.

Unlike AIX, HP-UX patch offers no meaningful clue as to its upstream version:

$ patch -v
$Header: patch.c,v 76.1.1.2.1.3 2001/12/03 12:24:52 abhinav Exp $
Patch level: 0

But it ignores unified diffs, so assume the worst and feed it context diffs.
Teach bisect-runner.pl that on HP-UX, _filbuf() is named __filbuf().

This is all that is needed to build 5.003 and earlier. bisect.pl can validate
all stable versions from blead back to 5.002
bisect-runner.pl should use ".$Config{dlext}" instead of hard-coding ".so".
bisect-runner.pl should search for lib*.a as well as lib*.so

When forcing the library list on earlier perls to avoid versioned shared
objects, also look for static libraries. Also, ensure bisect-runner.pl
searches additional library paths given to it via -Alibpth

Without this, one can't test build against static libraries in non-standard
locations.
When testing the end version, bisect.pl should treat a 'skip' as fatal.

git bisect uses exit code 125 to signal a skip. Previously bisect.pl would
treat 125 just like every other non-zero exit code, assume that it meant
'fail', and if 'fail' was expected for the end version then it would start
the bisect run as normal. Which isn't useful, as it means that there's a
problem with the user's test case.
In bisect-runner.pl, refactor the system ... and die; into system_or_die().
bisect-runner.pl should always exit fatally with 255, to abort the bisect.

Don't use die or croak, as these will exit with the value of $! or $? instead
of 255, and git bisect doesn't treat these as fatal errors, but ploughs on
before inevitably failing messily for some other reason, concealing the true
error message.
Add --all-fixups to bisect.pl, to apply all patches and fixups.

bisect-runner.pl will minimally patch various files on a platform and
version dependent basis to get the build to complete. Normally it defers
doing this as long as possible - .SH files aren't patched until after
Configure is run, and C and XS code isn't patched until after miniperl is
built. If --all-fixups is specified, all the fixups are done before running
Configure.
Add --early-fixup and --late-fixup to bisect.pl, for user-controlled patching.

These provide a way to run code or to conditionally or unconditionally
apply patches for each revision tested during git bisect. This is very
useful when for the commit range, operating system and configuration options
tested, the behaviour otherwise would be to fail to build for a wide range
of revisions, and hence the bisect would finish without finding culprit
commit due to getting bogged down in 'skipped' revisions.
bisect-runner.pl should fix Makefile.SH to remove remove GNU make-isms.

Commit c7b956bbbaff0c46 inadvertently added a GNU (and BSD) make specific
construction to the *nix Makefile, which other platforms' makes choke on.
It was corrected with commit cfe76a0a8e5b6f21 (and 0961731461727bea), but
those changes are not the simplest way to get things passing again, so use
a simpler custom patch here.
bisect-runner.pl will now invoke with ./perl -Ilib if it sees a #!./perl line

If the first argument of the test case given to bisect-runner.pl is a readable
file with a #! line of ./perl or ./miniperl (only), bisect-runner.pl with
prepend ./perl -Ilib or ./miniperl -Ilib to the command sent to system.
This increases flexibility somewhat, and will avoid problems with
inconsistencies between directly running system(...), and running
system('valgrind', ...). The former accepts a #!./perl line, the latter sends
it to /bin/sh.
Add a --valgrind option to bisect.pl, to run the test program with valgrind.

Specifically this option prepends valgrind --error-exitcode=124
to the command line, so that git bisect run will treat this revision as a
failure if valgrind finds any problems.
Tweak to make it clearer what to do if your working space is dirty

If you try to biect in a directory with .gitignore'd files in it
bisect will refuse to run. Since these files arent shown by status
this can cause some head scratching.

This patch makes it more obvious what is wrong by showing the listed
files and suggesting git clean as a solution. I deliberately did not
document the command to clean up untracked files, so people wouldn't
knee jerk paste it somewhere and lose something important. And by people
I mean me. :-) Thus it just shows the command to wipe ignored files,
which I figure is safe.
bisect-runner.pl should fix a typo in the Solaris hints file.

Without this typo fix about 700 revisions from 5.13.10 to 5.14.0-RC1 can't
be built on Solaris with Sun's compiler.
bisect-runner.pl should fix 5.7.x to export Perl_cxinc on AIX.

Without this, about 60 commits in a key area of history fail to build,
between the upgrade of Scalar-List-Utils to 1.03, and the commit that
amends makedef.pl to export Perl_cxinc, which Utils.xs indirectly started
using (via a macro).
bisect-runner.pl needs another minor fixup to build 5.004_05 on Linux.

bisect-runner.pl already reverts a sequence of commits to doio.c related to
special case handling of union semun on Linux and Solaris, which cause the
build to fail on current Linux. The last of these, 9b599b2a63d2324d is
described as "[win32] merge change#887 from maintbranch". However, it uses
__sun__ and __svr4__ instead of the __sun and __SVR4 of the maint branch
commit 6cdf74fe31f049dc. Hence the code in bisect-runner.pl needs to be
taught about this variation in the maint-5.004 branch, so that it can also
unwind the problematic code in doio.c there.
bisect-runner.pl needs to probe DB_File.xs before running Configure

Commit f2f0a0ff7250e0ba (in Nov 2011), consolidated all the code that
patches extensions. As a side effect, it moved all extension patching
after Configure is run. Unfortunately this introduced a bug, because one
test of DB_File.xs was to change the arguments to Configure to skip building
DB_File at all if it's too old. Return this logic to before when Configure
is run, so that bisect-runner.pl can once again build 5.005 and earlier on
machines with the Berkley DB headers installed, by forcibly skipping the
build of DB_File there.
When bisecting, use `git tag -l` to get the list of stable releases.

Previously bisect.pl was using a hard coded list, which (obviously) will
become stale.

Also, note in the docs that we only use .0 stable releases, and why.