From 8b4039846548684eda3376f80a4a5cb7a47ccc94 Mon Sep 17 00:00:00 2001 From: "Craig A. Berry" Date: Sun, 25 Aug 2019 13:50:46 -0500 Subject: [PATCH] Prepare VMS linker GSMATCH for 5.32. GSMATCH in the linker options file tells the image activator whether a dynamic library being loaded is compatible with what it originally linked against. Ideally we would like to encode the version number and all the options that can make a build binary incompatible with another build of the same version, but there are about 30 such options and only 8 bits (on Alpha) in which to store both the version number and the options. We've lived with only 3 bits reserved for 3 options, but as of version 32 of Perl 5, we'll need 6 bits for the version number: $ perl -e "$v = 31; printf('%b', $v);" 11111 $ perl -e "$v = 32; printf('%b', $v);" 100000 leaving us only 2 bits for options. The code modified here only kicks in when PERLSHR_USE_GSMATCH is defined in the environment. --- vms/gen_shrfls.pl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/vms/gen_shrfls.pl b/vms/gen_shrfls.pl index c3842c0..7b9f606 100644 --- a/vms/gen_shrfls.pl +++ b/vms/gen_shrfls.pl @@ -180,18 +180,17 @@ my (@symfiles, $drvrname); if ($ENV{PERLSHR_USE_GSMATCH}) { if ($ENV{PERLSHR_USE_GSMATCH} eq 'INCLUDE_COMPILE_OPTIONS') { # 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. + # the version number in the top 6 bits and use the bottom 2 for build + # options most likely to cause incompatibilities. Breaks at Perl 5.64. my ($ver, $sub) = $] =~ /\.(\d\d\d)(\d\d\d)/; $ver += 0; $sub += 0; my $gsmatch = ($ver % 2 == 1) ? "EQUAL" : "LEQUAL"; # Force an equal match for # dev, but be more forgiving # for releases - $ver <<= 3; + $ver <<= 2; $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 { -- 1.8.3.1