General-purpose symbol shortening for VMS.
authorCraig A. Berry <craigberry@mac.com>
Sat, 11 Feb 2012 20:17:12 +0000 (14:17 -0600)
committerCraig A. Berry <craigberry@mac.com>
Sat, 11 Feb 2012 20:47:25 +0000 (14:47 -0600)
commit24ad4a07e88519ae8e63d0b67d519e62a935b577
tree99c7ecf78369b59dc562e0c18bb191ed8f79ddab
parent2bce2197f3ee44d0b4726e1ac8112b1c95457f7e
General-purpose symbol shortening for VMS.

Some folks like to write long sentences and then use them as
variable names, which doesn't come up that often, but when it
does, the build on VMS falls down hard if any of the resulting
symbols is longer than 31 characters.  The problem is not for
the compiler, which when using /NAMES=SHORTENED (which we now do
by default) will shorten the symbols, but for the linker, which
must have an exact list of the symbol names to be exported when
creating the perlshr.exe shareable image.

That list of potentially shortened symbols goes in a linker options
file created by vms/gen_shrfls.pl.  Until now we had no recourse
but to hard-code there a mapping of long symbols to shortened ones,
but the AUTODIN-II polynomial used by the compiler to do the
shortening is (partially) documented under the help for CC/NAMES,
and it was possible to extrapolate from there and create a pure-
Perl implementation that mimics precisely what the C compiler (and
the C++ compiler under "extern C" declarations) use for shortening
long symbol names.

Symbols like Perl__it_was_the_best_of_times_it_was_the_worst_of_times
can now be created freely without causing the VMS linker to seize up.
vms/gen_shrfls.pl