This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix PathTools dynamic linking for Perl 5.6
authorZefram <zefram@fysh.org>
Thu, 20 Jul 2017 06:20:52 +0000 (07:20 +0100)
committerZefram <zefram@fysh.org>
Thu, 20 Jul 2017 06:20:52 +0000 (07:20 +0100)
commit8316a7e5fe811053d160adb18b0f473d2f070a43
tree358ac7eeeef5a9bcb1781e8b17a75cae44c37ea4
parent2ba334c7bf8365ab5c22306f4ef14f6d16569157
fix PathTools dynamic linking for Perl 5.6

On Perl 5.6, PathTools's use of SvPV_nomg() is satisfied by a definition
in ppport.h.  That definition calls out to the function sv_2pv_flags(),
which is also not defined by the 5.6.  ppport.h can define the function,
but doesn't unless requested to.  Cwd.xs wasn't requesting it, resulting
in Cwd.so having a reference to a non-existent function of a decorated
version of that name.  Fix this by making Cwd.xs request that function.

Some of the existing test cases already exercise the call out to
sv_2pv_flags(), but in non-obvious ways.  Add a more direct test,
requesting canonisation of a number.  However, the use of PERL_DL_NONLAZY
for running the test suite hides the problem.  The XS loading for
PathTools is optional, so with PERL_DL_NONLAZY making the loading fail
due to the unresolvable symbol, PathTools just falls back to its pure
Perl backup implementation, and passes all the tests.  The problem only
really manifests when PERL_DL_NONLAZY is unset, i.e., in real use: the
XS loading succeeds, so PathTools will rely on the XS, but then the code
fails when called.  This issue remains, lurking to bite if PathTools
develops another dynamic linking problem in the future.
dist/PathTools/Changes
dist/PathTools/Cwd.xs
dist/PathTools/t/Spec.t