diff options
author | Craig A. Berry <craigberry@mac.com> | 2013-05-31 16:23:24 -0500 |
---|---|---|
committer | Craig A. Berry <craigberry@mac.com> | 2013-05-31 16:52:41 -0500 |
commit | 0412267b40f63a0cda6ce338475f9dabaef73fa9 (patch) | |
tree | 77f7fe57b7ca6acd4d968d893e2a264eb400ef28 | |
parent | 5e220227379abcad75ff0534a6b23aa30c22c695 (diff) | |
download | perl-0412267b40f63a0cda6ce338475f9dabaef73fa9.tar.gz |
Update the GSMATCH handling in vms/gen_shrfls.pl.
This code (which only runs if you have set PERLSHR_USE_GSMATCH in
the environment) has not been updated in a long time. It was
assuming that $] had only five digits after the decimal, whereas
it's had six for some time. And it assumed that the Perl5 version
could be represented in 4 bits, which was true up through 5.15
but isn't true anymore.
So get all the digits of the version number, and go wild and spend
5 bits on the value of $Config{PERL_VERSION}, which will get us
through 5.31. That only leaves three bits in which to encode all
the options that could break binary compatibility, whereas in fact
we need about thirty bits.
So clearly this only works in a situation where the configuration
can be standardized and/or different configurations are packaged
separately.
-rw-r--r-- | vms/gen_shrfls.pl | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/vms/gen_shrfls.pl b/vms/gen_shrfls.pl index 650b8cf754..e24c49d2b6 100644 --- a/vms/gen_shrfls.pl +++ b/vms/gen_shrfls.pl @@ -256,19 +256,19 @@ if ($isvax) { # given version of Perl. if ($ENV{PERLSHR_USE_GSMATCH}) { if ($ENV{PERLSHR_USE_GSMATCH} eq 'INCLUDE_COMPILE_OPTIONS') { - # Build up a major ID. Since it can only be 8 bits, we encode the version - # number in the top four bits and use the bottom four for build options - # that'll cause incompatibilities - my ($ver, $sub) = $] =~ /\.(\d\d\d)(\d\d)/; + # Build up a major ID. Since on Alpha it can only be 8 bits, we encode + # the version number in the top 5 bits and use the bottom 3 for build + # options most likely to cause incompatibilities. Breaks at Perl 5.32. + my ($ver, $sub) = $] =~ /\.(\d\d\d)(\d\d\d)/; $ver += 0; $sub += 0; - my $gsmatch = ($sub >= 50) ? "equal" : "lequal"; # Force an equal match for + my $gsmatch = ($ver % 2 == 1) ? "EQUAL" : "LEQUAL"; # Force an equal match for # dev, but be more forgiving # for releases - $ver *=16; - $ver += 8 if $debugging_enabled; # If DEBUGGING is set - $ver += 4 if $use_threads; # if we're threaded - $ver += 2 if $use_mymalloc; # if we're using perl's malloc + $ver <<= 3; + $ver += 1 if $debugging_enabled; # If DEBUGGING is set + $ver += 2 if $use_threads; # if we're threaded + $ver += 4 if $use_mymalloc; # if we're using perl's malloc print OPTBLD "GSMATCH=$gsmatch,$ver,$sub\n"; } else { @@ -277,7 +277,7 @@ if ($ENV{PERLSHR_USE_GSMATCH}) { print OPTBLD "GSMATCH=LEQUAL,$major,$minor\n"; } print OPTBLD 'CLUSTER=$$TRANSFER_VECTOR,,', - map(",$_$objsuffix",@symfiles), "\n"; + map(",$_$objsuffix",@symfiles), "\n" if $isvax; } elsif (@symfiles) { $incstr .= ',' . join(',',@symfiles); } # Include object modules and RTLs in options file |