This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Provide a fixed $DynaLoader::XS_VERSION of 1.05, to fix bug #32539
authorNicholas Clark <nick@ccl4.org>
Sun, 4 Feb 2007 11:54:14 +0000 (11:54 +0000)
committerNicholas Clark <nick@ccl4.org>
Sun, 4 Feb 2007 11:54:14 +0000 (11:54 +0000)
whilst also allowing $DynaLoader::VERSION to be incremented (and
DynaLoader upgraded)

p4raw-id: //depot/maint-5.8/perl@30112

ext/DynaLoader/DynaLoader_pm.PL
ext/DynaLoader/Makefile.PL

index aff74a4..ee81d93 100644 (file)
@@ -27,10 +27,26 @@ package DynaLoader;
 #
 # Tim.Bunce@ig.co.uk, August 1994
 
-use vars qw($VERSION *AUTOLOAD);
+use vars qw($VERSION *AUTOLOAD $XS_VERSION);
 
 $VERSION = '1.05';     # avoid typo warning
 
+# See http://rt.perl.org/rt3//Public/Bug/Display.html?id=32539
+# for why we need this. Basically any embedded code will have 1.05 hard-coded
+# in it as the XS_VERSION to check against. If a shared libperl is upgraded,
+# then it will pull in a newer DynaLoader.pm file, because the shared libperl
+# provides the paths for @INC. The file in @INC provides the
+# $DynaLoader::XS_VERSION that the existing embedded code checks against, so
+# we must keep this value constant, else bootstrap_DynaLoader will croak()
+# Whilst moving bootstrap_DynaLoader to the shared libperl is the correct
+# long-term fix, it doesn't help current installations, as they're still
+# going to find the boot_DynaLoader linked to them (with its hard-coded 1.05)
+# (It's found via a passed in function pointer in the xsinit parameter to
+# perl_parse, and in turn that is typically the static function xs_init
+# defined in the same place as the caller to perl_parse, and at the same time,
+# so compiled in and installed as binaries now deployed.)
+$XS_VERSION = '1.05';
+
 require AutoLoader;
 *AUTOLOAD = \&AutoLoader::AUTOLOAD;
 
index 83cbd77..5dad27b 100644 (file)
@@ -8,6 +8,7 @@ WriteMakefile(
     SKIP       => [qw(dynamic dynamic_lib dynamic_bs)],
     XSPROTOARG => '-noprototypes',             # XXX remove later?
     VERSION_FROM => 'DynaLoader_pm.PL',
+    XS_VERSION  => '1.05',
     PL_FILES   => {'DynaLoader_pm.PL'=>'DynaLoader.pm',
                    'XSLoader_pm.PL'=>'XSLoader.pm'},
     PM         => {'DynaLoader.pm' => '$(INST_LIBDIR)/DynaLoader.pm',