diff options
author | Brian Fraser <fraserbn@gmail.com> | 2014-01-18 10:03:00 -0300 |
---|---|---|
committer | Brian Fraser <fraserbn@gmail.com> | 2014-01-18 11:01:27 -0300 |
commit | 7ba225eadec0366e19617a31ac282c3c618bd5b1 (patch) | |
tree | f58b7aad5e1cfdcffca38aed5536d1e57ae3a248 | |
parent | 6722cd980ee1a229bf8ada5ddac9e51945946812 (diff) | |
download | perl-7ba225eadec0366e19617a31ac282c3c618bd5b1.tar.gz |
DynaLoader: Pure-perl mod2fname shouldn't use %Config at runtime
This is somewhat obscure. Previously, mod2fname would've tried
accessing $Config{dlext} each time it was called. The reason this
can be problematic is that mod2fname can be called during global destruction,
after %Config is freed but before its magic is. This was causing
Devel::GlobalDestruction's tests to fail on builds with -Dd_libname_unique.
This commit grabs the data we need when DynaLoader.pm is being built in
DynaLoader_pm.PL, so it no longer need to depend on %Config.
-rw-r--r-- | ext/DynaLoader/DynaLoader_pm.PL | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/DynaLoader/DynaLoader_pm.PL b/ext/DynaLoader/DynaLoader_pm.PL index 6c2a3e61ed..5c71aaf79a 100644 --- a/ext/DynaLoader/DynaLoader_pm.PL +++ b/ext/DynaLoader/DynaLoader_pm.PL @@ -85,7 +85,7 @@ package DynaLoader; # Tim.Bunce@ig.co.uk, August 1994 BEGIN { - $VERSION = '1.23'; + $VERSION = '1.24'; } use Config; @@ -236,10 +236,10 @@ EOT } if ( $Config::Config{d_libname_unique} ) { - print OUT <<'EOT'; + printf OUT <<'EOT', length($Config::Config{dlext}) + 1; sub mod2fname { my $parts = shift; - my $so_len = length($Config::Config{dlext})+1; + my $so_len = %d; my $name_max = 255; # No easy way to get this here my $libname = "PL_" . join("__", @$parts); |